api

package
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestTimeout = 1200
)

Variables

View Source
var ErrNoPrefixMatchsSizeCriteria = errors.New("no available prefix matches size criterias")

Functions

func AssertError

func AssertError(t *testing.T, err error, msg string)

func AssertIpAddress

func AssertIpAddress(t *testing.T, given *netboxModels.WritableIPAddress, actual *netboxModels.IPAddress)

func AssertNil

func AssertNil(t *testing.T, err error)

Types

type CustomFieldStringFilter

type CustomFieldStringFilter struct {
	CustomFieldName  string
	CustomFieldValue string
}

func (*CustomFieldStringFilter) WriteToRequest

type NetboxClient

type NetboxClient struct {
	Ipam    interfaces.IpamInterface
	Tenancy interfaces.TenancyInterface
	Extras  interfaces.ExtrasInterface
}

func GetNetboxClient

func GetNetboxClient() (*NetboxClient, error)

func (*NetboxClient) CreateIpAddress

func (r *NetboxClient) CreateIpAddress(ipAddress *netboxModels.WritableIPAddress) (*netboxModels.IPAddress, error)

func (*NetboxClient) CreatePrefix

func (r *NetboxClient) CreatePrefix(prefix *netboxModels.WritablePrefix) (*netboxModels.Prefix, error)

func (*NetboxClient) DeleteIpAddress

func (r *NetboxClient) DeleteIpAddress(ipAddressId int64) error

func (*NetboxClient) DeletePrefix

func (r *NetboxClient) DeletePrefix(prefixId int64) error

func (*NetboxClient) GetAvailableIpAddressByClaim

func (r *NetboxClient) GetAvailableIpAddressByClaim(ipAddressClaim *models.IPAddressClaim) (*models.IPAddress, error)

GetAvailableIpAddressByClaim searches an available IpAddress in Netbox matching IpAddressClaim requirements

func (*NetboxClient) GetAvailableIpAddressesByParentPrefix

func (r *NetboxClient) GetAvailableIpAddressesByParentPrefix(parentPrefixId int64) (*ipam.IpamPrefixesAvailableIpsListOK, error)

func (*NetboxClient) GetAvailablePrefixByClaim

func (r *NetboxClient) GetAvailablePrefixByClaim(prefixClaim *models.PrefixClaim) (*models.Prefix, error)

GetAvailablePrefixByClaim searches an available Prefix in Netbox matching PrefixClaim requirements

func (*NetboxClient) GetAvailablePrefixesByParentPrefix

func (r *NetboxClient) GetAvailablePrefixesByParentPrefix(parentPrefixId int64) (*ipam.IpamPrefixesAvailablePrefixesListOK, error)

func (*NetboxClient) GetIpAddress

func (r *NetboxClient) GetIpAddress(ipAddress *models.IPAddress) (*ipam.IpamIPAddressesListOK, error)

func (*NetboxClient) GetPrefix

func (r *NetboxClient) GetPrefix(prefix *models.Prefix) (*ipam.IpamPrefixesListOK, error)

func (*NetboxClient) GetTenantDetails

func (r *NetboxClient) GetTenantDetails(name string) (*models.Tenant, error)

func (*NetboxClient) ReserveOrUpdateIpAddress

func (r *NetboxClient) ReserveOrUpdateIpAddress(ipAddress *models.IPAddress) (*netboxModels.IPAddress, error)

func (*NetboxClient) ReserveOrUpdatePrefix

func (r *NetboxClient) ReserveOrUpdatePrefix(prefix *models.Prefix) (*netboxModels.Prefix, error)

ReserveOrUpdatePrefix creates or updates the prefix passed as parameter

func (*NetboxClient) RestoreExistingIpByHash

func (r *NetboxClient) RestoreExistingIpByHash(customFieldName string, hash string) (*models.IPAddress, error)

func (*NetboxClient) RestoreExistingPrefixByHash

func (r *NetboxClient) RestoreExistingPrefixByHash(hash string) (*models.Prefix, error)

func (*NetboxClient) SetIpAddressMask

func (r *NetboxClient) SetIpAddressMask(ip string, ipMask string) (string, error)

func (*NetboxClient) UpdateIpAddress

func (r *NetboxClient) UpdateIpAddress(ipAddressId int64, ipAddress *netboxModels.WritableIPAddress) (*netboxModels.IPAddress, error)

func (*NetboxClient) UpdatePrefix

func (r *NetboxClient) UpdatePrefix(prefixId int64, prefix *netboxModels.WritablePrefix) (*netboxModels.Prefix, error)

func (*NetboxClient) VerifyNetboxConfiguration

func (r *NetboxClient) VerifyNetboxConfiguration() error

Checks that the Netbox host is properly configured for the operator to function. Currently only checks that the required custom fields for IP address handling have been added.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL