Revert categorized services.

This commit is contained in:
Kalle Carlbark 2021-11-26 13:34:15 +01:00
parent 2be4afbbfd
commit eb8f761cbc
No known key found for this signature in database

View file

@ -49,27 +49,27 @@ type Tenancy struct {
// Client struct is used to create a new NetBox endpoint
type Client struct {
DCIM *DCIM
Tenancy *Tenancy
IPAM *IPAM
Virtualization *Virtualization
Secret *Secret
// DCIM *DCIM
// Tenancy *Tenancy
// IPAM *IPAM
// 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
@ -145,21 +145,21 @@ func NewClient(apiurl string, httpClient *http.Client) (*Client, error) {
}
c.common.client = c
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)
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)
return c, nil
}