Documentation
¶
Index ¶
- Variables
- func CaptureFingerprint(ctx context.Context, url string) (string, error)
- type BootConfig
- type BootEnabled
- type BootTarget
- type Client
- func (c *Client) Close()
- func (c *Client) DisableBootOverride(ctx context.Context) error
- func (c *Client) GetBootConfig(ctx context.Context) (BootConfig, error)
- func (c *Client) PowerState(ctx context.Context) (PowerState, error)
- func (c *Client) Reset(ctx context.Context, resetType ResetType) error
- func (c *Client) SetBootOverride(ctx context.Context, target BootTarget, enabled BootEnabled) error
- type Pool
- type PowerState
- type Reconciler
- type ResetType
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("not supported by BMC")
ErrUnsupported indicates the BMC does not support the requested operation.
Functions ¶
Types ¶
type BootConfig ¶
type BootConfig struct {
Target BootTarget
Enabled BootEnabled
}
BootConfig holds the current boot source override configuration.
type BootEnabled ¶
type BootEnabled string
BootEnabled represents a Redfish boot source override enabled mode.
const ( BootContinuous BootEnabled = "Continuous" BootDisabled BootEnabled = "Disabled" )
type BootTarget ¶
type BootTarget string
BootTarget represents a Redfish boot source override target.
const ( BootTargetPxe BootTarget = "Pxe" BootTargetHdd BootTarget = "Hdd" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides Redfish operations against a single BMC. Created via Pool.Get or Dial. Must be closed when no longer needed.
func Dial ¶
Dial connects to a BMC and returns a ready-to-use Client. It creates a Redfish session (falling back to basic auth) and resolves the device ID. The caller must call Close when done.
func (*Client) DisableBootOverride ¶
DisableBootOverride disables the boot source override. If the BMC does not support disabling, it falls back to setting Hdd/Continuous. Returns ErrUnsupported if neither approach works.
func (*Client) GetBootConfig ¶
func (c *Client) GetBootConfig(ctx context.Context) (BootConfig, error)
GetBootConfig returns the current boot source override configuration.
func (*Client) PowerState ¶
func (c *Client) PowerState(ctx context.Context) (PowerState, error)
PowerState returns the current power state of the system.
func (*Client) SetBootOverride ¶
func (c *Client) SetBootOverride(ctx context.Context, target BootTarget, enabled BootEnabled) error
SetBootOverride sets the boot source override target and enabled mode. Returns ErrUnsupported if the BMC does not support the PATCH.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages Redfish clients for multiple BMCs. It reuses sessions to avoid creating and destroying a Redfish session on every reconcile. Safe for concurrent use.
func (*Pool) Get ¶
func (p *Pool) Get(ctx context.Context, url, certSHA256, user, pass, deviceID string) (*Client, error)
Get returns a Client for the given BMC. If a cached Client exists with matching credentials, it is returned. If credentials have changed or no cached Client exists, a new one is created (closing the old one).
type PowerState ¶
type PowerState string
PowerState represents the power state of a Redfish system.
const ( PowerOn PowerState = "On" PowerOff PowerState = "Off" )
type Reconciler ¶
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error