v1.5.0
This commit is contained in:
@@ -16,7 +16,7 @@ type ExtNetListRequest struct {
|
||||
}
|
||||
|
||||
// ExtNetList show list of VINS external network connections
|
||||
func (v VINS) ExtNetList(ctx context.Context, req ExtNetListRequest) (ListExtNets, error) {
|
||||
func (v VINS) ExtNetList(ctx context.Context, req ExtNetListRequest) (*ListExtNets, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -31,7 +31,7 @@ func (v VINS) ExtNetList(ctx context.Context, req ExtNetListRequest) (ListExtNet
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := ListExtNets{}
|
||||
list := &ListExtNets{}
|
||||
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
|
||||
@@ -16,7 +16,7 @@ type IPListRequest struct {
|
||||
}
|
||||
|
||||
// IPList show DHCP IP reservations on VINS
|
||||
func (v VINS) IPList(ctx context.Context, req IPListRequest) (ListIPs, error) {
|
||||
func (v VINS) IPList(ctx context.Context, req IPListRequest) (*ListIPs, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -31,7 +31,7 @@ func (v VINS) IPList(ctx context.Context, req IPListRequest) (ListIPs, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := ListIPs{}
|
||||
list := &ListIPs{}
|
||||
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
|
||||
@@ -104,7 +104,13 @@ type ItemExtNet struct {
|
||||
}
|
||||
|
||||
// List of external networks
|
||||
type ListExtNets []ItemExtNet
|
||||
type ListExtNets struct {
|
||||
// Data
|
||||
Data []ItemExtNet `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about IP
|
||||
type ItemIP struct {
|
||||
@@ -131,7 +137,13 @@ type ItemIP struct {
|
||||
}
|
||||
|
||||
// List of IPs
|
||||
type ListIPs []ItemIP
|
||||
type ListIPs struct {
|
||||
// Data
|
||||
Data []ItemIP `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about VNF device
|
||||
type RecordVNFDev struct {
|
||||
@@ -671,7 +683,13 @@ type ItemNATRule struct {
|
||||
}
|
||||
|
||||
// List of NAT rules
|
||||
type ListNATRules []ItemNATRule
|
||||
type ListNATRules struct {
|
||||
// Data
|
||||
Data []ItemNATRule `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about reservation
|
||||
type ItemReservation struct {
|
||||
|
||||
@@ -16,7 +16,7 @@ type NATRuleListRequest struct {
|
||||
}
|
||||
|
||||
// NATRuleList gets list of NAT (port forwarding) rules
|
||||
func (v VINS) NATRuleList(ctx context.Context, req NATRuleListRequest) (ListNATRules, error) {
|
||||
func (v VINS) NATRuleList(ctx context.Context, req NATRuleListRequest) (*ListNATRules, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -31,7 +31,7 @@ func (v VINS) NATRuleList(ctx context.Context, req NATRuleListRequest) (ListNATR
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := ListNATRules{}
|
||||
list := &ListNATRules{}
|
||||
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user