oob

package
v0.0.0-...-67791ae Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBMCTimeout is the default value for how long a BMC call/interaction is allowed to run before it is cancelled.
	DefaultBMCTimeout = 120 * time.Second
)

Variables

This section is empty.

Functions

func BMCTimeoutFromCtx

func BMCTimeoutFromCtx(ctx context.Context) time.Duration

BMCTimeoutFromCtx returns the time remaining in the context deadline.

The returned value defaults to DefaultBMCTimeout.

func Close

func Close(ctx context.Context, conn Connection)

Close a BMC interface function.

func Connect

func Connect(ctx context.Context, conn Connection) error

Connect to a BMC interface function.

func EstablishConnections

func EstablishConnections(ctx context.Context, bmcs map[string]interface{}) (successfulConnections []string, err error)

EstablishConnections tries to connect to all BMCs. Successful connection names are returned in a slice of strings. If no connections were successful then an error is returned.

Types

type Accessory

type Accessory struct {
	Log            logr.Logger
	StatusMessages chan string
	// SkipRedfishVersions is a list of Redfish versions to be ignored,
	//
	// When running an action on a BMC, PBnJ will pass the value of the skipRedfishVersions to bmclib
	// which will then ignore the Redfish endpoint completely on BMCs running the given Redfish versions,
	// and will proceed to attempt other drivers like - IPMI/SSH/Vendor API instead.
	//
	// for more information see https://github.com/bmc-toolbox/bmclib#bmc-connections
	SkipRedfishVersions []string
}

Accessory for all BMC actions.

func (*Accessory) ParseAuth

func (a *Accessory) ParseAuth(auth *v1.Authn) (host string, username string, passwd string, err error)

ParseAuth will return host, user, passwd from auth struct.

func (*Accessory) SendStatusMessage

func (a *Accessory) SendStatusMessage(msg string)

SendStatusMessage will send a message to a string chan.

type Connection

type Connection interface {
	Connect(context.Context) error
	Close(context.Context)
}

Connection methods open/close.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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