Linting and add custom fields
This commit is contained in:
parent
6e2b8836b2
commit
1f2c63c568
2 changed files with 50 additions and 2 deletions
|
@ -46,6 +46,9 @@ type TenancyTenantsList struct {
|
||||||
Comments string `json:"comments"`
|
Comments string `json:"comments"`
|
||||||
Tags []interface{} `json:"tags"`
|
Tags []interface{} `json:"tags"`
|
||||||
CustomFields struct {
|
CustomFields struct {
|
||||||
|
AccountNumber string `json:"account_number"`
|
||||||
|
AtlasCustNumber interface{} `json:"atlas_cust_number"`
|
||||||
|
TextField interface{} `json:"text_field"`
|
||||||
} `json:"custom_fields"`
|
} `json:"custom_fields"`
|
||||||
Created string `json:"created"`
|
Created string `json:"created"`
|
||||||
LastUpdated time.Time `json:"last_updated"`
|
LastUpdated time.Time `json:"last_updated"`
|
||||||
|
@ -78,7 +81,7 @@ type TenantFilter struct {
|
||||||
|
|
||||||
// ListTenants returns Netbox tenancy_tenants_list
|
// ListTenants returns Netbox tenancy_tenants_list
|
||||||
func (n *NetBox) ListTenants(i *TenancyTenantsList, f *TenantFilter) error {
|
func (n *NetBox) ListTenants(i *TenancyTenantsList, f *TenantFilter) error {
|
||||||
var encoder = schema.NewEncoder()
|
encoder := schema.NewEncoder()
|
||||||
|
|
||||||
form := url.Values{}
|
form := url.Values{}
|
||||||
err := encoder.Encode(f, form)
|
err := encoder.Encode(f, form)
|
||||||
|
|
|
@ -81,6 +81,51 @@ type IpamVLANsList struct {
|
||||||
} `json:"results"`
|
} `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
|
// VLANFilter is used to filter out returned object from Netbox API ipam_vlans_list
|
||||||
type VLANFilter struct {
|
type VLANFilter struct {
|
||||||
Offset int64 `schema:"offset,omitempty"`
|
Offset int64 `schema:"offset,omitempty"`
|
||||||
|
|
Loading…
Reference in a new issue