bmc

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsole

func NewConsole(log *zap.SugaredLogger, client metalgo.Client, caCertFile, certFile, keyFile string, port int) (*console, error)

Types

type BMCService

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

func New

func New(c Config) *BMCService

func (*BMCService) InitConsumer

func (b *BMCService) InitConsumer() error

func (*BMCService) UpdateFirmware

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

type Config

type Config struct {
	Log              *zap.SugaredLogger
	MQAddress        string
	MQCACertFile     string
	MQClientCertFile string
	MQLogLevel       string
	MachineTopic     string
	MachineTopicTTL  time.Duration
}

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