first commit
This commit is contained in:
commit
066a3e5251
3 changed files with 101 additions and 0 deletions
0
README.md
Normal file
0
README.md
Normal file
76
netbox_interfaces.go
Normal file
76
netbox_interfaces.go
Normal file
|
@ -0,0 +1,76 @@
|
|||
package main
|
||||
|
||||
type dcim_interfaces_create struct {
|
||||
Device int `json:"device"`
|
||||
Name string `json:"name"`
|
||||
Type int `json:"type"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Lag int `json:"lag"`
|
||||
Mtu int `json:"mtu"`
|
||||
MacAddress string `json:"mac_address"`
|
||||
MgmtOnly bool `json:"mgmt_only"`
|
||||
Description string `json:"description"`
|
||||
ConnectionStatus bool `json:"connection_status"`
|
||||
Cable struct {
|
||||
Label string `json:"label"`
|
||||
} `json:"cable"`
|
||||
Mode int `json:"mode"`
|
||||
UntaggedVlan int `json:"untagged_vlan"`
|
||||
TaggedVlans []int `json:"tagged_vlans"`
|
||||
Tags []string `json:"tags"`
|
||||
}
|
||||
|
||||
type dcim_interfaces_list struct {
|
||||
Count int `json:"count"`
|
||||
Next interface{} `json:"next"`
|
||||
Previous interface{} `json:"previous"`
|
||||
Results []struct {
|
||||
ID int `json:"id"`
|
||||
Device struct {
|
||||
ID int `json:"id"`
|
||||
URL string `json:"url"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
} `json:"device"`
|
||||
Name string `json:"name"`
|
||||
Type struct {
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
} `json:"type"`
|
||||
FormFactor struct {
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
} `json:"form_factor"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Lag struct {
|
||||
ID int `json:"id"`
|
||||
URL string `json:"url"`
|
||||
Device struct {
|
||||
ID int `json:"id"`
|
||||
URL string `json:"url"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
} `json:"device"`
|
||||
Name string `json:"name"`
|
||||
Cable interface{} `json:"cable"`
|
||||
ConnectionStatus interface{} `json:"connection_status"`
|
||||
} `json:"lag"`
|
||||
Mtu interface{} `json:"mtu"`
|
||||
MacAddress interface{} `json:"mac_address"`
|
||||
MgmtOnly bool `json:"mgmt_only"`
|
||||
Description string `json:"description"`
|
||||
ConnectedEndpointType interface{} `json:"connected_endpoint_type"`
|
||||
ConnectedEndpoint interface{} `json:"connected_endpoint"`
|
||||
ConnectionStatus interface{} `json:"connection_status"`
|
||||
Cable interface{} `json:"cable"`
|
||||
Mode interface{} `json:"mode"`
|
||||
UntaggedVlan interface{} `json:"untagged_vlan"`
|
||||
TaggedVlans []interface{} `json:"tagged_vlans"`
|
||||
Tags []interface{} `json:"tags"`
|
||||
CountIpaddresses int `json:"count_ipaddresses"`
|
||||
} `json:"results"`
|
||||
}
|
||||
|
||||
func (i *NbInterfaces) CreateInterface() {
|
||||
|
||||
|
25
netboxclient.go
Normal file
25
netboxclient.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
type DeviceInterface struct {
|
||||
Id int `json:"id"`
|
||||
Device int `json:"device"`
|
||||
Name string `json:"name"`
|
||||
Type int `json:"type"`
|
||||
FormFactor string `json:"form_factor"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Lag int `json:"lag"`
|
||||
Mtu int `json:"mtu"`
|
||||
MacAddress string `json:"mac_address"`
|
||||
|
||||
func main() {
|
||||
|
||||
}
|
||||
|
||||
func (i * InterfacesCreate
|
Loading…
Reference in a new issue