netbox

package
v0.0.0-...-38618e0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Netbox

type Netbox struct {
	// contains filtered or unexported fields
}

func New

func New(host, token string) (*Netbox, error)

New creates a Netbox instance with the host and token

func NewDefaultHost

func NewDefaultHost(token string) (*Netbox, error)

NewDefaultHost creates a Netbox instance for the default host

func (*Netbox) ActiveDevicesByCustomParameters

func (nb *Netbox) ActiveDevicesByCustomParameters(query string, params *dcim.DcimDevicesListParams) ([]models.DeviceWithConfigContext, error)

AcitveDevicesByCustomParameters retrievs all active devices with custom parameters

func (*Netbox) DeviceByParams

func (nb *Netbox) DeviceByParams(params dcim.DcimDevicesListParams) (res models.DeviceWithConfigContext, err error)

DevicesByRegion retrieves devices by region, manufacturer and status

func (*Netbox) DeviceInterfaceNameIPs

func (nb *Netbox) DeviceInterfaceNameIPs(name, deviceID string) (ips []string, err error)

DeviceInterfaceNameIPs retrieves the IP of the named interface for server

func (*Netbox) DevicesByParams

func (nb *Netbox) DevicesByParams(params dcim.DcimDevicesListParams) (res []models.DeviceWithConfigContext, err error)

DevicesByRegion retrieves devices by region, manufacturer and status

func (*Netbox) DevicesByRegion

func (nb *Netbox) DevicesByRegion(query, manufacturer, region, status string) (res []models.DeviceWithConfigContext, err error)

DevicesByRegion retrieves devices by region, manufacturer and status

func (*Netbox) GetNestedDeviceIP

func (nb *Netbox) GetNestedDeviceIP(i *models.NestedIPAddress) (ip string, err error)

func (*Netbox) IPAddress

func (nb *Netbox) IPAddress(id int64) (*models.IPAddress, error)

IPAddress retrieves the IPAddress by its ID

func (*Netbox) IPAddressByDeviceAndIntefrace

func (nb *Netbox) IPAddressByDeviceAndIntefrace(deviceID string, interfaceID string) (*models.IPAddress, error)

IPAddressByDeviceAndIntefrace retrieves the IP address by device and interface

func (*Netbox) Interface

func (nb *Netbox) Interface(deviceID string, interfaceName string) (*models.Interface, error)

Interface retrieves the interface on the device

func (*Netbox) ManagementIPs

func (nb *Netbox) ManagementIPs(serverID string) (ips []string, err error)

ManagementIP retrieves the IP of the management interface for server

func (*Netbox) MgmtInterface

func (nb *Netbox) MgmtInterface(deviceID string, mgmtOnly bool) ([]*models.Interface, error)

MgmtInterface retrieves the management interface on the device

func (*Netbox) Racks

func (nb *Netbox) Racks(role string, siteID string) ([]models.Rack, error)

Racks retrieves all the racks with the specified role in the site

func (*Netbox) RacksByRegion

func (nb *Netbox) RacksByRegion(role string, region string) ([]models.Rack, error)

RacksByRegion retrieves all the racks in the region with specified role

func (*Netbox) Servers

func (nb *Netbox) Servers(rackID string) ([]models.DeviceWithConfigContext, error)

Servers retrieves all the servers in the rack

func (*Netbox) ServersByRegion

func (nb *Netbox) ServersByRegion(rackRole string, region string) ([]models.DeviceWithConfigContext, error)

ServersByRegion retrieves all the servers in the region with the specified rack role

func (*Netbox) Sites

func (nb *Netbox) Sites(region string) ([]models.Site, error)

Sites retrieves the all sites in the region

func (*Netbox) VMsByParams

VMsByTag retrieves devices by region, manufacturer and status

func (*Netbox) VMsByTag

func (nb *Netbox) VMsByTag(query, status, tag string) (res []models.VirtualMachineWithConfigContext, err error)

VMsByTag retrieves devices by region, manufacturer and status

Jump to

Keyboard shortcuts

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