netbox

package
v0.0.0-...-d9482cb Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigContext

type ConfigContext struct {
	Baremetal TemperContext `json:"baremetal"`
}

type Data

type Data struct {
	Device        *models.DeviceWithConfigContext
	RemoteIP      string
	PrimaryIP     string
	DNSName       string
	IpamAddresses []models.IPAddress
	Interfaces    []NodeInterface `json:"-"`
}

type Exec

type Exec struct {
	Fn   func() error
	Name string
}

type Netbox

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

func New

func New(node string, cfg config.Config, ctxLogger *logrus.Entry) (*Netbox, error)

func (*Netbox) GetAvailabilityZone

func (n *Netbox) GetAvailabilityZone(block string) (az string, err error)

func (*Netbox) GetData

func (n *Netbox) GetData() (*Data, error)

func (*Netbox) GetTemperConfigContext

func (n *Netbox) GetTemperConfigContext() (temperCtx ConfigContext, err error)

func (*Netbox) SetStatus

func (n *Netbox) SetStatus(status string) (err error)

SetStatus does not return error to not trigger errorhandler and cleanup of node

func (*Netbox) Update

func (n *Netbox) Update(serialNumber string) error

Update node serial and primaryIP. Does not return error to not trigger errorhandler and cleanup of node

func (*Netbox) WriteLocalContextData

func (n *Netbox) WriteLocalContextData(t []*Task) (err error)

type NodeInterface

type NodeInterface struct {
	Name           string
	RedfishName    string
	Connection     string
	ConnectionIP   string
	Port           string
	Mac            string
	PortLinkStatus redfish.PortLinkStatus
	PortNumber     int
	Nic            int
}

type Task

type Task struct {
	Service string  `json:"service"`
	Task    string  `json:"task"`
	Exec    []*Exec `json:"-"`
	Error   string  `json:"error,omitempty"`
	Status  string  `json:"status"`
}

type TaskContext

type TaskContext struct {
	Tasks []*Task `json:"tasks"`
}

type TemperContext

type TemperContext struct {
	Temper TaskContext `json:"temper"`
}

Jump to

Keyboard shortcuts

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