redfish

package
v0.0.0-...-b8e83fa Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClientType is used by other packages as the identifier of the Redfish client.
	ClientType string = "redfish"
)

Variables

View Source
var ClientFactory ifc.ClientFactory = func(nodeName string, redfishURL string,
	insecure bool,
	useProxy bool,
	username string,
	password string,
	systemActionRetries int,
	systemRebootDelay int) (ifc.Client, error) {
	return NewClient(nodeName, redfishURL, insecure, useProxy,
		username, password, systemActionRetries, systemRebootDelay)
}

ClientFactory is a constructor for redfish ifc.Client implementation

Functions

func DecodeRawError

func DecodeRawError(rawResponse []byte) (string, error)

DecodeRawError decodes a raw Redfish HTTP response and retrieves the extended information and available resolutions returned by the BMC.

func GetManagerID

func GetManagerID(ctx context.Context, api redfishAPI.RedfishAPI, systemID string) (string, error)

GetManagerID retrieves the manager ID for a redfish system.

func GetResourceIDFromURL

func GetResourceIDFromURL(refURL string) string

GetResourceIDFromURL returns a parsed Redfish resource ID from the Redfish URL

func GetVirtualMediaID

func GetVirtualMediaID(ctx context.Context, api redfishAPI.RedfishAPI, systemID string) (string, string, error)

GetVirtualMediaID retrieves the ID of a Redfish virtual media resource if it supports type "CD" or "DVD".

func IsIDInList

func IsIDInList(idRefList []redfishClient.IdRef, id string) bool

IsIDInList checks whether an ID exists in Redfish IDref collection

func RemoteDirect

func RemoteDirect(ctx context.Context, isoURL, redfishURL string, c ifc.Client) error

RemoteDirect allows to perform remotedirect

func ScreenRedfishError

func ScreenRedfishError(httpResp *http.Response, clientErr error) error

ScreenRedfishError provides a detailed error message for end user consumption by inspecting all Redfish client responses and errors.

func SetAuth

func SetAuth(ctx context.Context, username string, password string) context.Context

SetAuth allows to set username and password to given context so that redfish client can authenticate against redfish server

Types

type Client

type Client struct {
	RedfishAPI redfishAPI.RedfishAPI
	RedfishCFG *redfishClient.Configuration

	// Sleep is meant to be mocked out for tests
	Sleep func(d time.Duration)
	// contains filtered or unexported fields
}

Client holds details about a Redfish out-of-band system required for out-of-band management.

func NewClient

func NewClient(nodeName string, redfishURL string,
	insecure bool,
	useProxy bool,
	username string,
	password string,
	systemActionRetries int,
	systemRebootDelay int) (*Client, error)

NewClient returns a client with the capability to make Redfish requests.

func (*Client) EjectVirtualMedia

func (c *Client) EjectVirtualMedia(ctx context.Context) error

EjectVirtualMedia ejects a virtual media device attached to a host.

func (*Client) NodeID

func (c *Client) NodeID() string

NodeID retrieves the ephemeral node ID.

func (*Client) NodeName

func (c *Client) NodeName() string

NodeName retrieves the ephemeral node ID.

func (*Client) RebootSystem

func (c *Client) RebootSystem(ctx context.Context) error

RebootSystem power cycles a host by sending a shutdown signal followed by a power on signal.

func (*Client) RemoteDirect

func (c *Client) RemoteDirect(ctx context.Context, isoURL string) error

RemoteDirect implements remote direct interface

func (*Client) SetBootSourceByType

func (c *Client) SetBootSourceByType(ctx context.Context) error

SetBootSourceByType sets the boot source of the ephemeral node to one that's compatible with the boot source type.

func (*Client) SetVirtualMedia

func (c *Client) SetVirtualMedia(ctx context.Context, isoPath string) error

SetVirtualMedia injects a virtual media device to an established virtual media ID. This assumes that isoPath is accessible to the redfish server and virtualMedia device is either of type CD or DVD.

func (*Client) SystemActionRetries

func (c *Client) SystemActionRetries() int

SystemActionRetries returns number of attempts to reach host during reboot process and ejecting virtual media

func (*Client) SystemPowerOff

func (c *Client) SystemPowerOff(ctx context.Context) error

SystemPowerOff shuts down a host.

func (*Client) SystemPowerOn

func (c *Client) SystemPowerOn(ctx context.Context) error

SystemPowerOn powers on a host.

func (*Client) SystemPowerStatus

func (c *Client) SystemPowerStatus(ctx context.Context) (power.Status, error)

SystemPowerStatus retrieves the power status of a host as a human-readable string.

func (*Client) SystemRebootDelay

func (c *Client) SystemRebootDelay() int

SystemRebootDelay returns number of seconds to wait after reboot if host isn't available

type ErrOperationRetriesExceeded

type ErrOperationRetriesExceeded struct {
	What    string
	Retries int
}

ErrOperationRetriesExceeded raised if number of operation retries exceeded

func (ErrOperationRetriesExceeded) Error

type ErrRedfishClient

type ErrRedfishClient struct {
	Message string
}

ErrRedfishClient describes an error encountered by the go-redfish client.

func (ErrRedfishClient) Error

func (e ErrRedfishClient) Error() string

type ErrRedfishMissingConfig

type ErrRedfishMissingConfig struct {
	What string
}

ErrRedfishMissingConfig describes an error encountered due to a missing configuration option.

func (ErrRedfishMissingConfig) Error

func (e ErrRedfishMissingConfig) Error() string

type ErrUnrecognizedRedfishResponse

type ErrUnrecognizedRedfishResponse struct {
	Key string
}

ErrUnrecognizedRedfishResponse is a debug error that describes unexpected formats in a Redfish error response.

func (ErrUnrecognizedRedfishResponse) Error

Directories

Path Synopsis
vendors
dell
Package dell wraps the standard Redfish client in order to provide additional functionality required to perform actions on iDRAC servers.
Package dell wraps the standard Redfish client in order to provide additional functionality required to perform actions on iDRAC servers.

Jump to

Keyboard shortcuts

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