api was not exported, changed that
This commit is contained in:
parent
431cc0f1ad
commit
c2f0f06b59
@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
// NetBoxAPI is the type we use to add custom functions
|
// NetBoxAPI is the type we use to add custom functions
|
||||||
type NetBoxAPI struct {
|
type NetBoxAPI struct {
|
||||||
api client.NetBoxAPI
|
API client.NetBoxAPI
|
||||||
Token string
|
Token string
|
||||||
URL string
|
URL string
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ func NewNetBoxClient(token string, url string) (NetBoxAPI, error) {
|
|||||||
|
|
||||||
// create a new variable for our custom functions
|
// create a new variable for our custom functions
|
||||||
nb := NetBoxAPI{
|
nb := NetBoxAPI{
|
||||||
api: *n,
|
API: *n,
|
||||||
Token: token,
|
Token: token,
|
||||||
URL: url,
|
URL: url,
|
||||||
}
|
}
|
||||||
|
4
ipam.go
4
ipam.go
@ -29,7 +29,7 @@ func (nb NetBoxAPI) GetPrefixes(param ipam.IpamPrefixesListParams) ([]*models.Pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get prefixes
|
// get prefixes
|
||||||
prefixes, err := nb.api.Ipam.IpamPrefixesList(¶m, nil)
|
prefixes, err := nb.API.Ipam.IpamPrefixesList(¶m, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, e.FormatError("can't get prefixes", err)
|
return nil, e.FormatError("can't get prefixes", err)
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ func (nb NetBoxAPI) GetIPAddresses(param ipam.IpamIPAddressesListParams) ([]*mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get addresses
|
// get addresses
|
||||||
addresses, err := nb.api.Ipam.IpamIPAddressesList(¶m, nil)
|
addresses, err := nb.API.Ipam.IpamIPAddressesList(¶m, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, e.FormatError("can't get prefixes", err)
|
return nil, e.FormatError("can't get prefixes", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user