openbmc

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ProviderName for the OpenBMC provider implementation
	ProviderName = "openbmc"
	// ProviderProtocol for the OpenBMC provider implementation
	ProviderProtocol = "redfish"
)

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	HttpClient            *http.Client
	Port                  string
	VersionsNotCompatible []string
	RootCAs               *x509.CertPool
	UseBasicAuth          bool
}

type Conn

type Conn struct {
	Log logr.Logger
	// contains filtered or unexported fields
}

Conn details for redfish client

func New

func New(host, user, pass string, log logr.Logger, opts ...Option) *Conn

New returns connection with a redfish client initialized

func (*Conn) BmcReset

func (c *Conn) BmcReset(ctx context.Context, resetType string) (ok bool, err error)

BmcReset power cycles the BMC

func (*Conn) Close

func (c *Conn) Close(ctx context.Context) error

Close a connection to a BMC via redfish

func (*Conn) FirmwareInstallSteps

func (c *Conn) FirmwareInstallSteps(ctx context.Context, component string) ([]constants.FirmwareInstallStep, error)

bmc client interface implementations methods

func (*Conn) FirmwareInstallUploadAndInitiate

func (c *Conn) FirmwareInstallUploadAndInitiate(ctx context.Context, component string, file *os.File) (taskID string, err error)

func (*Conn) FirmwareTaskStatus

func (c *Conn) FirmwareTaskStatus(ctx context.Context, kind constants.FirmwareInstallStep, component, taskID, installVersion string) (state constants.TaskState, status string, err error)

FirmwareTaskStatus returns the status of a firmware related task queued on the BMC.

func (*Conn) Inventory

func (c *Conn) Inventory(ctx context.Context) (device *common.Device, err error)

Inventory collects hardware inventory and install firmware information

func (*Conn) Name

func (c *Conn) Name() string

Name returns the client provider name.

func (*Conn) Open

func (c *Conn) Open(ctx context.Context) (err error)

Open a connection to a BMC via redfish

func (*Conn) PowerSet

func (c *Conn) PowerSet(ctx context.Context, state string) (ok bool, err error)

PowerSet sets the power state of a server

func (*Conn) PowerStateGet

func (c *Conn) PowerStateGet(ctx context.Context) (state string, err error)

PowerStateGet gets the power state of a BMC machine

func (*Conn) SendNMI added in v2.2.3

func (c *Conn) SendNMI(ctx context.Context) error

SendNMI tells the BMC to issue an NMI to the device

type Option

type Option func(*Config)

Option for setting optional Client values

func WithHttpClient

func WithHttpClient(httpClient *http.Client) Option

func WithPort

func WithPort(port string) Option

func WithRootCAs

func WithRootCAs(rootCAs *x509.CertPool) Option

func WithUseBasicAuth

func WithUseBasicAuth(useBasicAuth bool) Option

Jump to

Keyboard shortcuts

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