Initialize service structs
* DCIM * Tenancy * IPAM * Virtualization * Secret
This commit is contained in:
parent
375dc521dc
commit
c578285a05
1 changed files with 37 additions and 36 deletions
73
netbox.go
73
netbox.go
|
@ -21,6 +21,7 @@ type DCIM struct {
|
|||
Devices *DevicesService
|
||||
DeviceRoles *DeviceRolesService
|
||||
DeviceTypes *DeviceTypesService
|
||||
Interfaces *InterfacesService
|
||||
InventoryItems *InventoryItemsService
|
||||
RearPorts *RearPortsService
|
||||
}
|
||||
|
@ -54,21 +55,21 @@ type Client struct {
|
|||
Virtualization *Virtualization
|
||||
Secret *Secret
|
||||
|
||||
Tenants *TenantsService
|
||||
Sites *SitesService
|
||||
SiteGroups *SiteGroupsService
|
||||
VirtualMachines *VirtualMachinesService
|
||||
Clusters *ClustersService
|
||||
VLANs *VLANsService
|
||||
Secrets *SecretsService
|
||||
InventoryItems *InventoryItemsService
|
||||
Devices *DevicesService
|
||||
DeviceRoles *DeviceRolesService
|
||||
DeviceTypes *DeviceTypesService
|
||||
Interfaces *InterfacesService
|
||||
Prefixes *PrefixesService
|
||||
VRFs *VRFsService
|
||||
RearPorts *RearPortsService
|
||||
// Tenants *TenantsService
|
||||
// Sites *SitesService
|
||||
// SiteGroups *SiteGroupsService
|
||||
// VirtualMachines *VirtualMachinesService
|
||||
// Clusters *ClustersService
|
||||
// VLANs *VLANsService
|
||||
// Secrets *SecretsService
|
||||
// InventoryItems *InventoryItemsService
|
||||
// Devices *DevicesService
|
||||
// DeviceRoles *DeviceRolesService
|
||||
// DeviceTypes *DeviceTypesService
|
||||
// Interfaces *InterfacesService
|
||||
// Prefixes *PrefixesService
|
||||
// VRFs *VRFsService
|
||||
// RearPorts *RearPortsService
|
||||
|
||||
// baseURL is the URL used for the base URL of the API
|
||||
baseURL *url.URL
|
||||
|
@ -85,17 +86,17 @@ type Client struct {
|
|||
// Token is set for authentication of the API
|
||||
Token string
|
||||
|
||||
// Debug enables verbose debugging messages to console.
|
||||
Debug bool
|
||||
|
||||
// InsecureSkipVerify is used to selectively skip InsecureVerifications
|
||||
InsecureSkipVerify bool
|
||||
|
||||
// SessionKey is used to read authentication data
|
||||
SessionKey string
|
||||
|
||||
// Used by golang wasm
|
||||
FetchMode string
|
||||
|
||||
// Debug enables verbose debugging messages to console.
|
||||
Debug bool
|
||||
|
||||
// InsecureSkipVerify is used to selectively skip InsecureVerifications
|
||||
InsecureSkipVerify bool
|
||||
}
|
||||
|
||||
type service struct {
|
||||
|
@ -144,21 +145,21 @@ func NewClient(apiurl string, httpClient *http.Client) (*Client, error) {
|
|||
}
|
||||
|
||||
c.common.client = c
|
||||
c.Clusters = (*ClustersService)(&c.common)
|
||||
c.Devices = (*DevicesService)(&c.common)
|
||||
c.DeviceRoles = (*DeviceRolesService)(&c.common)
|
||||
c.DeviceTypes = (*DeviceTypesService)(&c.common)
|
||||
c.Interfaces = (*InterfacesService)(&c.common)
|
||||
c.InventoryItems = (*InventoryItemsService)(&c.common)
|
||||
c.Prefixes = (*PrefixesService)(&c.common)
|
||||
c.RearPorts = (*RearPortsService)(&c.common)
|
||||
c.Tenants = (*TenantsService)(&c.common)
|
||||
c.Secrets = (*SecretsService)(&c.common)
|
||||
c.Sites = (*SitesService)(&c.common)
|
||||
c.SiteGroups = (*SiteGroupsService)(&c.common)
|
||||
c.VirtualMachines = (*VirtualMachinesService)(&c.common)
|
||||
c.VLANs = (*VLANsService)(&c.common)
|
||||
c.VRFs = (*VRFsService)(&c.common)
|
||||
c.Virtualization.Clusters = (*ClustersService)(&c.common)
|
||||
c.DCIM.Devices = (*DevicesService)(&c.common)
|
||||
c.DCIM.DeviceRoles = (*DeviceRolesService)(&c.common)
|
||||
c.DCIM.DeviceTypes = (*DeviceTypesService)(&c.common)
|
||||
c.DCIM.Interfaces = (*InterfacesService)(&c.common)
|
||||
c.DCIM.InventoryItems = (*InventoryItemsService)(&c.common)
|
||||
c.IPAM.Prefixes = (*PrefixesService)(&c.common)
|
||||
c.DCIM.RearPorts = (*RearPortsService)(&c.common)
|
||||
c.Tenancy.Tenants = (*TenantsService)(&c.common)
|
||||
c.Secret.Secrets = (*SecretsService)(&c.common)
|
||||
c.Tenancy.Sites = (*SitesService)(&c.common)
|
||||
c.Tenancy.SiteGroups = (*SiteGroupsService)(&c.common)
|
||||
c.Virtualization.VirtualMachines = (*VirtualMachinesService)(&c.common)
|
||||
c.IPAM.VLANs = (*VLANsService)(&c.common)
|
||||
c.IPAM.VRFs = (*VRFsService)(&c.common)
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue