Documentation
¶
Index ¶
Constants ¶
const ( // ProviderName is the unique identifier for the NICo provider. ProviderName = "nico" // DefaultTimeout is the default timeout for NICo gRPC calls. DefaultTimeout = time.Minute // DefaultComputePowerDelay is the default delay between sequential // power control calls for compute trays. A small stagger avoids // overwhelming the power delivery system. DefaultComputePowerDelay = 2 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ExtractPowerState ¶
func ExtractPowerState(report *pb.EndpointExplorationReport) operations.PowerStatus
ExtractPowerState derives an operations.PowerStatus from the first ComputerSystem in a site exploration report. Returns PowerStatusUnknown when the report is nil or contains no systems.
func MapFirmwareState ¶
func MapFirmwareState(state pb.FirmwareUpdateState) operations.FirmwareUpdateState
MapFirmwareState converts a NICo protobuf FirmwareUpdateState into the corresponding operations.FirmwareUpdateState.
Types ¶
type Config ¶
type Config struct {
// Timeout is the gRPC call timeout for NICo operations.
Timeout time.Duration
// ComputePowerDelay is the delay inserted between sequential power
// control calls when commanding multiple compute trays.
// 0 means no delay.
ComputePowerDelay time.Duration
}
Config holds configuration for the NICo provider.
func (*Config) NewProvider ¶
NewProvider creates a NICo provider from this config.
type ConfigDecoder ¶
type ConfigDecoder struct{}
ConfigDecoder owns NICo provider config defaults and YAML decoding.
func (ConfigDecoder) DecodeYAML ¶
func (d ConfigDecoder) DecodeYAML(raw yaml.Node) (providerapi.ProviderConfig, error)
DecodeYAML decodes NICo provider YAML into a typed config.
func (ConfigDecoder) DefaultConfig ¶
func (ConfigDecoder) DefaultConfig() providerapi.ProviderConfig
DefaultConfig returns the default NICo provider config.
func (ConfigDecoder) Name ¶
func (ConfigDecoder) Name() string
Name returns the provider name handled by this decoder.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider wraps a nicoapi.Client and provides it to component manager implementations.
func NewFromClient ¶
NewFromClient creates a Provider from an existing client. This is primarily useful for testing with mock clients.
func NewWithDefault ¶
NewWithDefault creates a new Provider with the default configuration.