bmc

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsole

func NewConsole(log *slog.Logger, client metalgo.Client, c config.Config) (*console, error)

Types

type BMCService

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

func New

func New(log *slog.Logger, c *config.Config) *BMCService

func (*BMCService) HandleMessage added in v0.5.0

func (b *BMCService) HandleMessage(message *nsq.Message) error

func (*BMCService) InitConsumer

func (b *BMCService) InitConsumer() error

func (*BMCService) UpdateFirmware

func (b *BMCService) UpdateFirmware(outBand hal.OutBand, event *MachineEvent) error

type EventType

type EventType string
const (
	Create  EventType = "create"
	Update  EventType = "update"
	Delete  EventType = "delete"
	Command EventType = "command"
)

FIXME these constants must move to a single location

type FirmwareUpdate

type FirmwareUpdate struct {
	Kind string `json:"kind"`
	URL  string `json:"url"`
}

type Fru

type Fru struct {
	BoardPartNumber string `json:"board_part_number"`
}

type IPMI

type IPMI struct {
	// Address is host:port of the connection to the ipmi BMC, host can be either a ip address or a hostname
	Address  string `json:"address"`
	User     string `json:"user"`
	Password string `json:"password"`
	Fru      Fru    `json:"fru"`
}

type MachineCommand

type MachineCommand string
const (
	MachineOnCmd             MachineCommand = "ON"
	MachineOffCmd            MachineCommand = "OFF"
	MachineResetCmd          MachineCommand = "RESET"
	MachineCycleCmd          MachineCommand = "CYCLE"
	MachineBiosCmd           MachineCommand = "BIOS"
	MachineDiskCmd           MachineCommand = "DISK"
	MachinePxeCmd            MachineCommand = "PXE"
	MachineReinstallCmd      MachineCommand = "REINSTALL"
	ChassisIdentifyLEDOnCmd  MachineCommand = "LED-ON"
	ChassisIdentifyLEDOffCmd MachineCommand = "LED-OFF"
	UpdateFirmwareCmd        MachineCommand = "UPDATE-FIRMWARE"
)

FIXME these constants must move to a single location

type MachineEvent

type MachineEvent struct {
	Type         EventType           `json:"type,omitempty"`
	OldMachineID string              `json:"old,omitempty"`
	Cmd          *MachineExecCommand `json:"cmd,omitempty"`
}

type MachineExecCommand

type MachineExecCommand struct {
	TargetMachineID string          `json:"target,omitempty"`
	Command         MachineCommand  `json:"cmd,omitempty"`
	IPMI            *IPMI           `json:"ipmi,omitempty"`
	FirmwareUpdate  *FirmwareUpdate `json:"firmwareupdate,omitempty"`
}

Jump to

Keyboard shortcuts

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