backend

package
v0.0.0-...-68594da Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContextCustomFieldQueries = contextType("netbox-customfield-query")
	ErrValueNotFound          = fmt.Errorf("netbox error: value not found")
)

Functions

This section is empty.

Types

type Backend

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

func NewBackend

func NewBackend(config BackendConfig) *Backend

func (*Backend) CreateApplication

func (b *Backend) CreateApplication(app netbox.Application) (*netbox.Application, error)

func (*Backend) CreateApplicationGroup

func (b *Backend) CreateApplicationGroup(group netbox.ApplicationGroup) (*netbox.ApplicationGroup, error)

func (*Backend) CreateApplicationPort

func (b *Backend) CreateApplicationPort(port netbox.ApplicationPort) (*netbox.ApplicationPort, error)

func (*Backend) CreateDevice

func (*Backend) CreateDeviceType

func (b *Backend) CreateDeviceType(platform netbox.DeviceType) (*netbox.DeviceType, error)

func (*Backend) CreateIPAddress

func (b *Backend) CreateIPAddress(value netbox.IPAddress) (*netbox.IPAddress, error)

func (*Backend) CreateInterface

func (b *Backend) CreateInterface(deviceId int32, value netbox.Interface) (*netbox.Interface, error)

func (*Backend) CreateInventoryItem

func (b *Backend) CreateInventoryItem(inventoryItem netbox.InventoryItem) (*netbox.InventoryItem, error)

func (*Backend) CreateInventoryRole

func (b *Backend) CreateInventoryRole(role netbox.InventoryItemRole) (*netbox.InventoryItemRole, error)

func (*Backend) CreateManufacturer

func (b *Backend) CreateManufacturer(platform netbox.Manufacturer) (*netbox.Manufacturer, error)

func (*Backend) CreatePlatform

func (b *Backend) CreatePlatform(platform netbox.Platform) (*netbox.Platform, error)

func (*Backend) DeleteApplicationPort

func (b *Backend) DeleteApplicationPort(portId int32) error

func (*Backend) DeleteIP

func (b *Backend) DeleteIP(ipId int32) error

func (*Backend) DeleteInterface

func (b *Backend) DeleteInterface(interfaceId int32) error

func (*Backend) DeleteInventoryItem

func (b *Backend) DeleteInventoryItem(inventoryItemId int32) error

func (*Backend) GetApplicationGroups

func (b *Backend) GetApplicationGroups() ([]netbox.ApplicationGroup, error)

func (*Backend) GetApplicationPorts

func (b *Backend) GetApplicationPorts() ([]netbox.ApplicationPort, error)

func (*Backend) GetApplications

func (b *Backend) GetApplications() ([]netbox.Application, error)

func (*Backend) GetDeviceByUuid

func (b *Backend) GetDeviceByUuid(uuid string) (*netbox.DeviceWithConfigContext, error)

func (*Backend) GetDeviceTypes

func (b *Backend) GetDeviceTypes() ([]netbox.DeviceType, error)

func (*Backend) GetDevices

func (b *Backend) GetDevices() ([]netbox.DeviceWithConfigContext, error)

func (*Backend) GetIPAddressByDevice

func (b *Backend) GetIPAddressByDevice(deviceId int32) ([]netbox.IPAddress, error)

func (*Backend) GetIPAddressByInterface

func (b *Backend) GetIPAddressByInterface(interfaceId int32) ([]netbox.IPAddress, error)

func (*Backend) GetInterfaces

func (b *Backend) GetInterfaces(deviceId int32) ([]netbox.Interface, error)

func (*Backend) GetInventoryItemRoles

func (b *Backend) GetInventoryItemRoles() ([]netbox.InventoryItemRole, error)

func (*Backend) GetInventoryItemsByRoles

func (b *Backend) GetInventoryItemsByRoles(role int32) ([]netbox.InventoryItem, error)

func (*Backend) GetManufacturers

func (b *Backend) GetManufacturers() ([]netbox.Manufacturer, error)

func (*Backend) GetPlatforms

func (b *Backend) GetPlatforms() ([]netbox.Platform, error)

func (*Backend) InitBackend

func (b *Backend) InitBackend() error

func (*Backend) UpdateApplication

func (b *Backend) UpdateApplication(app netbox.Application) (*netbox.Application, error)

func (*Backend) UpdateDevice

func (*Backend) UpdateIPAddress

func (b *Backend) UpdateIPAddress(value netbox.IPAddress) (*netbox.IPAddress, error)

func (*Backend) UpdateInterface

func (b *Backend) UpdateInterface(value netbox.Interface) (*netbox.Interface, error)

func (*Backend) UpdateInventoryItem

func (b *Backend) UpdateInventoryItem(inventoryItem netbox.InventoryItem) (*netbox.InventoryItem, error)

type BackendConfig

type BackendConfig struct {
	Server string
	Apikey string
}

type CustomField

type CustomField interface {
	GetKey() string
	CreateCustomFieldRequest() netbox.WritableCustomFieldRequest
}
var (
	CustomFieldAgent CustomField = customFieldAgent{}
	CustomFieldUuid  CustomField = customFieldUuid{}
)

type NetboxHost

type NetboxHost struct {
	Device         *netbox.DeviceWithConfigContext
	Platform       *netbox.Platform
	Manufacturer   *netbox.Manufacturer
	InventoryItems []*netbox.InventoryItem
	Interfaces     []*netbox.Interface
	DeviceRole     *netbox.DeviceRole
	IPAddresses    []*netbox.IPAddress
	Applications   []*netbox.ApplicationGroup
}

type NetboxOther

type NetboxOther struct {
	Wlan     []*netbox.WirelessLAN
	IPRanges []*netbox.IPRange
}

Jump to

Keyboard shortcuts

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