diff --git a/client.go b/client.go index 805391b..fb67a09 100644 --- a/client.go +++ b/client.go @@ -11,9 +11,9 @@ import ( // NetBoxAPI is the type we use to add custom functions type NetBoxAPI struct { - API client.NetBoxAPI - Token string - URL string + client.NetBoxAPI // API of NetBox + Token string // Token used to access the NetBox API + URL string // URL of this NetBox instance } // NewNetBoxClient returns a client to NetBox at the given url, @@ -32,9 +32,9 @@ func NewNetBoxClient(token string, url string) NetBoxAPI { // create a new variable for our custom functions nb := NetBoxAPI{ - API: *n, - Token: token, - URL: url, + NetBoxAPI: *n, + Token: token, + URL: url, } return nb } diff --git a/dcim.go b/dcim.go index 7e55839..7c51f50 100644 --- a/dcim.go +++ b/dcim.go @@ -28,7 +28,7 @@ func (nb NetBoxAPI) GetDevices(param dcim.DcimDevicesListParams) ([]*models.Devi } // get devices - devices, err := nb.API.Dcim.DcimDevicesList(¶m, nil) + devices, err := nb.Dcim.DcimDevicesList(¶m, nil) if err != nil { return nil, err } diff --git a/ipam.go b/ipam.go index 368d9ef..61edc2e 100644 --- a/ipam.go +++ b/ipam.go @@ -28,7 +28,7 @@ func (nb NetBoxAPI) GetPrefixes(param ipam.IpamPrefixesListParams) ([]*models.Pr } // get prefixes - prefixes, err := nb.API.Ipam.IpamPrefixesList(¶m, nil) + prefixes, err := nb.Ipam.IpamPrefixesList(¶m, nil) if err != nil { return nil, err } @@ -81,7 +81,7 @@ func (nb NetBoxAPI) GetIPAddresses(param ipam.IpamIPAddressesListParams) ([]*mod } // get addresses - addresses, err := nb.API.Ipam.IpamIPAddressesList(¶m, nil) + addresses, err := nb.Ipam.IpamIPAddressesList(¶m, nil) if err != nil { return nil, err } diff --git a/virtualization.go b/virtualization.go index 68475bb..57df2e3 100644 --- a/virtualization.go +++ b/virtualization.go @@ -28,7 +28,7 @@ func (nb NetBoxAPI) GetClusters(param virtualization.VirtualizationClustersListP } // get clusters - clusters, err := nb.API.Virtualization.VirtualizationClustersList(¶m, nil) + clusters, err := nb.Virtualization.VirtualizationClustersList(¶m, nil) if err != nil { return nil, err } @@ -80,7 +80,7 @@ func (nb NetBoxAPI) GetClusterGroups(param virtualization.VirtualizationClusterG } // get clusterGroups - clusterGroups, err := nb.API.Virtualization.VirtualizationClusterGroupsList(¶m, nil) + clusterGroups, err := nb.Virtualization.VirtualizationClusterGroupsList(¶m, nil) if err != nil { return nil, err }