diff --git a/netbox_tenants.go b/netbox_tenants.go index ce02c58..65a96e0 100644 --- a/netbox_tenants.go +++ b/netbox_tenants.go @@ -46,6 +46,9 @@ type TenancyTenantsList struct { Comments string `json:"comments"` Tags []interface{} `json:"tags"` CustomFields struct { + AccountNumber string `json:"account_number"` + AtlasCustNumber interface{} `json:"atlas_cust_number"` + TextField interface{} `json:"text_field"` } `json:"custom_fields"` Created string `json:"created"` LastUpdated time.Time `json:"last_updated"` @@ -66,7 +69,7 @@ type TenantFilter struct { Offset int64 `schema:"offset,omitempty"` Limit int64 `schema:"limit,omitempty"` - //User specific filters + // User specific filters Name string `schema:"name,omitempty"` Slug string `schema:"slug,omitempty"` Group string `schema:"group,omitempty"` @@ -78,7 +81,7 @@ type TenantFilter struct { // ListTenants returns Netbox tenancy_tenants_list func (n *NetBox) ListTenants(i *TenancyTenantsList, f *TenantFilter) error { - var encoder = schema.NewEncoder() + encoder := schema.NewEncoder() form := url.Values{} err := encoder.Encode(f, form) diff --git a/netbox_vlans.go b/netbox_vlans.go index 251acde..b573def 100644 --- a/netbox_vlans.go +++ b/netbox_vlans.go @@ -81,6 +81,51 @@ type IpamVLANsList struct { } `json:"results"` } +type VLAN struct { + ID int `json:"id"` + Site struct { + ID int `json:"id"` + URL string `json:"url"` + Name string `json:"name"` + Slug string `json:"slug"` + } `json:"site"` + Group struct { + ID int `json:"id"` + URL string `json:"url"` + Name string `json:"name"` + Slug string `json:"slug"` + VLANCount int `json:"vlan_count"` + } `json:"group"` + Vid int `json:"vid"` + Name string `json:"name"` + Tenant struct { + ID int `json:"id"` + URL string `json:"url"` + Name string `json:"name"` + Slug string `json:"slug"` + } `json:"tenant"` + Status struct { + Label string `json:"label"` + Value int `json:"value"` + } `json:"status"` + Role struct { + ID int `json:"id"` + URL string `json:"url"` + Name string `json:"name"` + Slug string `json:"slug"` + PrefixCount int `json:"prefix_count"` + VLANCount int `json:"vlan_count"` + } `json:"role"` + Description string `json:"description"` + Tags []string `json:"tags"` + DisplayName string `json:"display_name"` + CustomFields struct { + } `json:"custom_fields"` + Created string `json:"created"` + LastUpdated time.Time `json:"last_updated"` + PrefixCount int `json:"prefix_count"` +} + // VLANFilter is used to filter out returned object from Netbox API ipam_vlans_list type VLANFilter struct { Offset int64 `schema:"offset,omitempty"`