outofband

package
v0.0.0-...-dcf9213 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginError         model.CollectorError = "LoginError"
	InventoryError     model.CollectorError = "InventoryError"
	GetBiosConfigError model.CollectorError = "GetBiosConfigError"
)

Variables

View Source
var (
	ErrInventory  = errors.New("inventory collection error")
	ErrBiosConfig = errors.New("BIOS configuration collection error")
	ErrConnect    = errors.New("BMC connection error")
	ErrBMCSession = errors.New("BMC session error")
)

Functions

This section is empty.

Types

type BMCQueryor

type BMCQueryor interface {
	Open(ctx context.Context) error
	Close(ctx context.Context) error
	Inventory(ctx context.Context) (*common.Device, error)
	GetBiosConfiguration(ctx context.Context) (map[string]string, error)
	GetPowerState(ctx context.Context) (state string, err error)
}

BMCQueryor interface defines methods that the bmclib client exposes this is mainly to swap the bmclib instance for tests

type MockBmclib

type MockBmclib struct {
	// embed bmclib client to provide methods
	bmclibv2.Client
	// contains filtered or unexported fields
}

nolint:govet // fieldalignment, pointless in tests

func NewMockBmclib

func NewMockBmclib() *MockBmclib

func NewMockBmclibClient

func NewMockBmclibClient() *MockBmclib

func (*MockBmclib) Close

func (m *MockBmclib) Close(_ context.Context) error

func (*MockBmclib) GetBiosConfiguration

func (m *MockBmclib) GetBiosConfiguration(_ context.Context) (biosConfig map[string]string, err error)

func (*MockBmclib) Inventory

func (m *MockBmclib) Inventory(_ context.Context) (*common.Device, error)

func (*MockBmclib) Open

func (m *MockBmclib) Open(_ context.Context) error

func (*MockBmclib) SetMockDevice

func (m *MockBmclib) SetMockDevice(d *common.Device)

type Queryor

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

OutOfBand collector collects hardware, firmware inventory out of band

func NewQueryor

func NewQueryor(logger *logrus.Logger) *Queryor

NewQueryor returns a instance of the Queryor inventory collector

func (*Queryor) BiosConfiguration

func (o *Queryor) BiosConfiguration(ctx context.Context, asset *model.Asset) error

func (*Queryor) Inventory

func (o *Queryor) Inventory(ctx context.Context, asset *model.Asset) error

Inventory retrieves device component and firmware information and updates the given asset object with the inventory

func (*Queryor) SessionActive

func (o *Queryor) SessionActive(ctx context.Context, bmc BMCQueryor) bool

Jump to

Keyboard shortcuts

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