Fix netbox 2.9 api changes

Status is no longer returning int but string
This commit is contained in:
Kalle Carlbark 2020-12-22 16:20:23 +01:00
parent 5ec76803a5
commit 19e0e8f21d
No known key found for this signature in database
GPG key ID: 5E4BAB01A57CDD62

View file

@ -60,7 +60,7 @@ type IpamVLANsList struct {
} `json:"tenant"` } `json:"tenant"`
Status struct { Status struct {
Label string `json:"label"` Label string `json:"label"`
Value int `json:"value"` Value string `json:"value"`
} `json:"status"` } `json:"status"`
Role struct { Role struct {
ID int `json:"id"` ID int `json:"id"`
@ -152,7 +152,7 @@ type VLANFilter struct {
// ListVLANs returns Netbox ipam_vlans_list // ListVLANs returns Netbox ipam_vlans_list
func (n *NetBox) ListVLANs(i *IpamVLANsList, f *VLANFilter) error { func (n *NetBox) ListVLANs(i *IpamVLANsList, f *VLANFilter) error {
var encoder = schema.NewEncoder() encoder := schema.NewEncoder()
form := url.Values{} form := url.Values{}
err := encoder.Encode(f, form) err := encoder.Encode(f, form)