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 // Client struct is used to create a new NetBox endpoint
type Client struct { type Client struct {
DCIM *DCIM // DCIM *DCIM
Tenancy *Tenancy // Tenancy *Tenancy
IPAM *IPAM // IPAM *IPAM
Virtualization *Virtualization // Virtualization *Virtualization
Secret *Secret // Secret *Secret
// Tenants *TenantsService Tenants *TenantsService
// Sites *SitesService Sites *SitesService
// SiteGroups *SiteGroupsService SiteGroups *SiteGroupsService
// VirtualMachines *VirtualMachinesService VirtualMachines *VirtualMachinesService
// Clusters *ClustersService Clusters *ClustersService
// VLANs *VLANsService VLANs *VLANsService
// Secrets *SecretsService Secrets *SecretsService
// InventoryItems *InventoryItemsService InventoryItems *InventoryItemsService
// Devices *DevicesService Devices *DevicesService
// DeviceRoles *DeviceRolesService DeviceRoles *DeviceRolesService
// DeviceTypes *DeviceTypesService DeviceTypes *DeviceTypesService
// Interfaces *InterfacesService Interfaces *InterfacesService
// Prefixes *PrefixesService Prefixes *PrefixesService
// VRFs *VRFsService VRFs *VRFsService
// RearPorts *RearPortsService RearPorts *RearPortsService
// baseURL is the URL used for the base URL of the API // baseURL is the URL used for the base URL of the API
baseURL *url.URL baseURL *url.URL
@ -145,21 +145,21 @@ func NewClient(apiurl string, httpClient *http.Client) (*Client, error) {
} }
c.common.client = c c.common.client = c
c.Virtualization.Clusters = (*ClustersService)(&c.common) c.Clusters = (*ClustersService)(&c.common)
c.DCIM.Devices = (*DevicesService)(&c.common) c.Devices = (*DevicesService)(&c.common)
c.DCIM.DeviceRoles = (*DeviceRolesService)(&c.common) c.DeviceRoles = (*DeviceRolesService)(&c.common)
c.DCIM.DeviceTypes = (*DeviceTypesService)(&c.common) c.DeviceTypes = (*DeviceTypesService)(&c.common)
c.DCIM.Interfaces = (*InterfacesService)(&c.common) c.Interfaces = (*InterfacesService)(&c.common)
c.DCIM.InventoryItems = (*InventoryItemsService)(&c.common) c.InventoryItems = (*InventoryItemsService)(&c.common)
c.IPAM.Prefixes = (*PrefixesService)(&c.common) c.Prefixes = (*PrefixesService)(&c.common)
c.DCIM.RearPorts = (*RearPortsService)(&c.common) c.RearPorts = (*RearPortsService)(&c.common)
c.Tenancy.Tenants = (*TenantsService)(&c.common) c.Tenants = (*TenantsService)(&c.common)
c.Secret.Secrets = (*SecretsService)(&c.common) c.Secrets = (*SecretsService)(&c.common)
c.Tenancy.Sites = (*SitesService)(&c.common) c.Sites = (*SitesService)(&c.common)
c.Tenancy.SiteGroups = (*SiteGroupsService)(&c.common) c.SiteGroups = (*SiteGroupsService)(&c.common)
c.Virtualization.VirtualMachines = (*VirtualMachinesService)(&c.common) c.VirtualMachines = (*VirtualMachinesService)(&c.common)
c.IPAM.VLANs = (*VLANsService)(&c.common) c.VLANs = (*VLANsService)(&c.common)
c.IPAM.VRFs = (*VRFsService)(&c.common) c.VRFs = (*VRFsService)(&c.common)
return c, nil return c, nil
} }