Documentation ¶
Overview ¶
Package api provides metal machine management via API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDice = NewFailureDice(0, 0)
DefaultDice is used in the api.Client.
Default value is to have no failures.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides management over simple API.
func NewClient ¶
func NewClient(spec metalv1alpha1.ManagementAPI) (*Client, error)
NewClient returns new API client to manage metal machine.
func (*Client) IsPoweredOn ¶
IsPoweredOn checks current power state.
func (*Client) PowerCycle ¶
PowerCycle will power cycle a given machine.
type FailureDice ¶
type FailureDice struct {
// contains filtered or unexported fields
}
func NewFailureDice ¶
func NewFailureDice(explicitFailureProbability, silentFailureProbability float64) *FailureDice
NewFailureDice creates new failure dice with specified probabilities.
func (*FailureDice) Roll ¶
func (dice *FailureDice) Roll() SimulatedFailure
Roll the dice to get the expected failure mode.
type SimulatedFailure ¶
type SimulatedFailure int
SimulatedFailure modes.
const ( ExplicitFailure SimulatedFailure = iota SilentFailure NoFailure )
Simulated failure constants.
Click to show internal directories.
Click to hide internal directories.