netbox

package
v0.0.0-...-996c443 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestroyIPAddress

func DestroyIPAddress(ctx context.Context, id int32) error

func GetIPRangesID

func GetIPRangesID(ctx context.Context, filter string) (iprangesID []int32, err error)

func Login

func Login(host string, token string) error

Types

type AssignedObject

type AssignedObject interface{}

type AvailableIP

type AvailableIP struct {
	Family  int32  `json:"family"`
	Address string `json:"address"`
	VRF     string `json:"vrf"`
}

type IPAddress

type IPAddress struct {
	ID                 int32  `json:"id"`
	Address            string `json:"address"`
	Description        string `json:"description"`
	Comments           string `json:"comments"`
	DNSName            string `json:"dns_name"`
	AssignedObjectType string `json:"assigned_object_type"`
	AssignedObject     `json:"assigned_object"`
}

func GetAssignedIPFromPrefix

func GetAssignedIPFromPrefix(ctx context.Context, filter string, mac string) (ipnet *IPAddress, err error)

func GetAvailableIPFromIPRangeID

func GetAvailableIPFromIPRangeID(ctx context.Context, id int32, mac string, dryRun bool) (ip *IPAddress, err error)

func GetIPsFromInterface

func GetIPsFromInterface(ctx context.Context, interfaceFilter string, interfaceID int32, prefix string) (ips []*IPAddress, err error)

type IPAddressResponse

type IPAddressResponse struct {
	Count    int         `json:"count"`
	Next     string      `json:"next"`
	Previous string      `json:"previous"`
	Results  []IPAddress `json:"results"`
}

type IPRange

type IPRange struct {
	ID int32 `json:"id"`
}

type IPRangeResponse

type IPRangeResponse struct {
	Count    int       `json:"count"`
	Next     string    `json:"next"`
	Previous string    `json:"previous"`
	Results  []IPRange `json:"results"`
}

type Interface

type Interface struct {
	ID  int32  `json:"id"`
	Mtu *int32 `json:"mtu"`
}

func GetDeviceInterfacesFromMac

func GetDeviceInterfacesFromMac(ctx context.Context, mac string) (interfaces []Interface, err error)

func GetVMInterfacesFromMac

func GetVMInterfacesFromMac(ctx context.Context, mac string) (interfaces []Interface, err error)

type InterfaceResponse

type InterfaceResponse struct {
	Count    int         `json:"count"`
	Next     string      `json:"next"`
	Previous string      `json:"previous"`
	Results  []Interface `json:"results"`
}

type Prefix

type Prefix struct {
	Prefix       string                 `json:"prefix"`
	CustomFields map[string]interface{} `json:"custom_fields"`
}

func GetPrefixes

func GetPrefixes(ctx context.Context, filter string) (prefixes []Prefix, err error)

type PrefixResponse

type PrefixResponse struct {
	Count    int      `json:"count"`
	Next     string   `json:"next"`
	Previous string   `json:"previous"`
	Results  []Prefix `json:"results"`
}

Jump to

Keyboard shortcuts

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