diff --git a/netbox_vlans.go b/netbox_vlans.go index a71ceb5..1431474 100644 --- a/netbox_vlans.go +++ b/netbox_vlans.go @@ -30,55 +30,57 @@ type IpamVLANsCreate struct { } `json:"custom_fields"` } +type IpamVLAN 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 string `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"` +} + // IpamVLANsList is used for the return value from NetBox API ipam_vlans_list type IpamVLANsList struct { - Count int `json:"count"` - Next string `json:"next"` - Previous string `json:"previous"` - Results []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 string `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"` - } `json:"results"` + Count int `json:"count"` + Next string `json:"next"` + Previous string `json:"previous"` + Results []IpamVLAN `json:"results"` } type VLAN struct {