From 19e0e8f21dc899cd6dd361923b947391876361ab Mon Sep 17 00:00:00 2001 From: Kalle Carlbark Date: Tue, 22 Dec 2020 16:20:23 +0100 Subject: [PATCH] Fix netbox 2.9 api changes Status is no longer returning int but string --- netbox_vlans.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netbox_vlans.go b/netbox_vlans.go index b573def..db80227 100644 --- a/netbox_vlans.go +++ b/netbox_vlans.go @@ -60,7 +60,7 @@ type IpamVLANsList struct { } `json:"tenant"` Status struct { Label string `json:"label"` - Value int `json:"value"` + Value string `json:"value"` } `json:"status"` Role struct { ID int `json:"id"` @@ -131,7 +131,7 @@ type VLANFilter struct { Offset int64 `schema:"offset,omitempty"` Limit int64 `schema:"limit,omitempty"` - //User specific filters + // User specific filters Vid string `schema:"vid,omitempty"` Name string `schema:"name,omitempty"` TenantGroupID string `schema:"tenant_group_id,omitempty"` @@ -152,7 +152,7 @@ type VLANFilter struct { // ListVLANs returns Netbox ipam_vlans_list func (n *NetBox) ListVLANs(i *IpamVLANsList, f *VLANFilter) error { - var encoder = schema.NewEncoder() + encoder := schema.NewEncoder() form := url.Values{} err := encoder.Encode(f, form)