management

package
v0.0.0-...-5174020 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package management provides a backend-agnostic interface for bare metal power control.

Index

Constants

This section is empty.

Variables

View Source
var ErrTransitioning = errors.New("power state transition already in progress")

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPowerState(ctx context.Context, hostID string) (*PowerStatus, error)
	SetPowerState(ctx context.Context, hostID string, target PowerState) error
}

func NewClient

func NewClient(ctx context.Context, cfg *Config) (Client, error)

func NewOpenStackClient

func NewOpenStackClient(ctx context.Context, cfg *Config) (Client, error)

type Config

type Config struct {
	Name    string         `json:"name"`
	Type    string         `json:"type"`
	Options map[string]any `json:"options"`
}

type NewClientFunc

type NewClientFunc func(ctx context.Context, cfg *Config) (Client, error)

type OpenStackClient

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

func (*OpenStackClient) GetPowerState

func (c *OpenStackClient) GetPowerState(ctx context.Context, hostID string) (*PowerStatus, error)

func (*OpenStackClient) SetPowerState

func (c *OpenStackClient) SetPowerState(ctx context.Context, hostID string, target PowerState) error

type PowerState

type PowerState string
const (
	PowerOn  PowerState = "power on"
	PowerOff PowerState = "power off"
)

type PowerStatus

type PowerStatus struct {
	State           PowerState
	IsTransitioning bool
}

Jump to

Keyboard shortcuts

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