bmc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMC

type BMC interface {
	Open(ctx context.Context) error
	Close(ctx context.Context) error
	GetPowerState(ctx context.Context) (state string, err error)
	SetPowerState(ctx context.Context, state string) error
	SetBootDevice(ctx context.Context, device string, persistent, efiBoot bool) error
	GetBootDevice(ctx context.Context) (device string, persistent, efiBoot bool, err error)
	PowerCycleBMC(ctx context.Context) error
	HostBooted(ctx context.Context) (bool, error)
	ResetBiosConfig(ctx context.Context) error
	SetBiosConfigFromFile(ctx context.Context, cfg string) error
}

Queryor interface abstracts calls to remote devices

type Client

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

Bmc is an implementation of the Queryor interface

func NewBMCClient

func NewBMCClient(asset *model.Asset, logger *logrus.Entry) *Client

NewBMCClient creates a new Queryor interface for a BMC

func (*Client) Close

func (b *Client) Close(traceCtx context.Context) error

Close logs out of the BMC

func (*Client) GetBootDevice

func (b *Client) GetBootDevice(_ context.Context) (device string, persistent, efiBoot bool, err error)

GetBootDevice gets the boot device information of the remote device

func (*Client) GetPowerState

func (b *Client) GetPowerState(ctx context.Context) (string, error)

GetPowerState returns the device power status

func (*Client) HostBooted

func (b *Client) HostBooted(ctx context.Context) (bool, error)

func (*Client) Open

func (b *Client) Open(ctx context.Context) error

Open creates a BMC session

func (*Client) PowerCycleBMC

func (b *Client) PowerCycleBMC(ctx context.Context) error

PowerCycleBMC sets a power cycle action on the BMC of the remote device

func (*Client) ResetBiosConfig added in v0.1.0

func (b *Client) ResetBiosConfig(ctx context.Context) error

func (*Client) SetBiosConfigFromFile added in v0.1.0

func (b *Client) SetBiosConfigFromFile(ctx context.Context, cfg string) error

func (*Client) SetBootDevice

func (b *Client) SetBootDevice(ctx context.Context, device string, persistent, efiBoot bool) error

SetBootDevice sets the boot device of the remote device, and validates it was set

func (*Client) SetPowerState

func (b *Client) SetPowerState(ctx context.Context, state string) error

SetPowerState sets the given power state on the device

type DryRunBMCClient

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

DryRunBMC is an simulated implementation of the Queryor interface

func NewDryRunBMCClient

func NewDryRunBMCClient(asset *model.Asset) *DryRunBMCClient

NewDryRunBMCClient creates a new Queryor interface for a simulated BMC

func (*DryRunBMCClient) Close

func (b *DryRunBMCClient) Close(_ context.Context) error

Close simulates logging out of the BMC

func (*DryRunBMCClient) GetBootDevice

func (b *DryRunBMCClient) GetBootDevice(_ context.Context) (device string, persistent, efiBoot bool, err error)

GetBootDevice simulates getting the boot device information of the remote device

func (*DryRunBMCClient) GetPowerState

func (b *DryRunBMCClient) GetPowerState(_ context.Context) (string, error)

GetPowerState simulates returning the device power status

func (*DryRunBMCClient) HostBooted

func (b *DryRunBMCClient) HostBooted(_ context.Context) (bool, error)

HostBooted reports whether or not the device has booted the host OS

func (*DryRunBMCClient) Open

func (b *DryRunBMCClient) Open(_ context.Context) error

Open simulates creating a BMC session

func (*DryRunBMCClient) PowerCycleBMC

func (b *DryRunBMCClient) PowerCycleBMC(_ context.Context) error

PowerCycleBMC simulates a power cycle action on the BMC of the remote device

func (*DryRunBMCClient) ResetBiosConfig added in v0.1.0

func (b *DryRunBMCClient) ResetBiosConfig(ctx context.Context) error

func (*DryRunBMCClient) SetBiosConfigFromFile added in v0.1.0

func (b *DryRunBMCClient) SetBiosConfigFromFile(_ context.Context, _ string) error

func (*DryRunBMCClient) SetBootDevice

func (b *DryRunBMCClient) SetBootDevice(_ context.Context, device string, persistent, efiBoot bool) error

SetBootDevice simulates setting the boot device of the remote device

func (*DryRunBMCClient) SetPowerState

func (b *DryRunBMCClient) SetPowerState(_ context.Context, state string) error

SetPowerState simulates setting the given power state on the device

Jump to

Keyboard shortcuts

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