Documentation
¶
Index ¶
- type BMC
- type Client
- func (b *Client) Close(traceCtx context.Context) error
- func (b *Client) GetBootDevice(_ context.Context) (device string, persistent, efiBoot bool, err error)
- func (b *Client) GetPowerState(ctx context.Context) (string, error)
- func (b *Client) HostBooted(ctx context.Context) (bool, error)
- func (b *Client) Open(ctx context.Context) error
- func (b *Client) PowerCycleBMC(ctx context.Context) error
- func (b *Client) ResetBiosConfig(ctx context.Context) error
- func (b *Client) SetBiosConfigFromFile(ctx context.Context, cfg string) error
- func (b *Client) SetBootDevice(ctx context.Context, device string, persistent, efiBoot bool) error
- func (b *Client) SetPowerState(ctx context.Context, state string) error
- type DryRunBMCClient
- func (b *DryRunBMCClient) Close(_ context.Context) error
- func (b *DryRunBMCClient) GetBootDevice(_ context.Context) (device string, persistent, efiBoot bool, err error)
- func (b *DryRunBMCClient) GetPowerState(_ context.Context) (string, error)
- func (b *DryRunBMCClient) HostBooted(_ context.Context) (bool, error)
- func (b *DryRunBMCClient) Open(_ context.Context) error
- func (b *DryRunBMCClient) PowerCycleBMC(_ context.Context) error
- func (b *DryRunBMCClient) ResetBiosConfig(ctx context.Context) error
- func (b *DryRunBMCClient) SetBiosConfigFromFile(_ context.Context, _ string) error
- func (b *DryRunBMCClient) SetBootDevice(_ context.Context, device string, persistent, efiBoot bool) error
- func (b *DryRunBMCClient) SetPowerState(_ context.Context, state string) error
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 ¶
NewBMCClient creates a new Queryor interface for a 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 ¶
GetPowerState returns the device power status
func (*Client) PowerCycleBMC ¶
PowerCycleBMC sets a power cycle action on the BMC of the remote device
func (*Client) ResetBiosConfig ¶ added in v0.1.0
func (*Client) SetBiosConfigFromFile ¶ added in v0.1.0
func (*Client) SetBootDevice ¶
SetBootDevice sets the boot device of the remote device, and validates it was set
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