redfish

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrNoUserSlotsAvailable = errors.New("no user account slots available")
	ErrUserNotPresent       = errors.New("account with username was not found")
	ErrUserPassParams       = errors.New("user and pass parameters required")
	ErrUserExists           = errors.New("user exists")
	ErrInvalidUserRole      = errors.New("invalid user role")
	ValidRoles              = []string{"Administrator", "Operator", "ReadOnly", "None"}
)

Functions

func SupportedFirmwareApplyAtValues added in v0.5.3

func SupportedFirmwareApplyAtValues() []string

SupportedFirmwareApplyAtValues returns the supported redfish firmware applyAt values

Types

type Conn

type Conn struct {
	Host string
	Port string
	User string
	Pass string

	Log logr.Logger
	// contains filtered or unexported fields
}

Conn details for redfish client

func New added in v0.5.3

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

New returns a redfish *Conn

func (*Conn) BmcReset added in v0.5.3

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

BmcReset powercycles the BMC

func (*Conn) Close

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

Close a connection to a BMC via redfish

func (*Conn) Compatible

func (c *Conn) Compatible(ctx context.Context) bool

Compatible tests whether a BMC is compatible with the gofish provider

func (*Conn) DeviceVendorModel added in v0.5.3

func (c *Conn) DeviceVendorModel(ctx context.Context) (vendor, model string, err error)

DeviceVendorModel returns the device vendor and model attributes

func (*Conn) FirmwareInstall added in v0.5.3

func (c *Conn) FirmwareInstall(ctx context.Context, component, applyAt string, forceInstall bool, reader io.Reader) (taskID string, err error)

FirmwareInstall uploads and initiates the firmware install process

func (*Conn) FirmwareInstallStatus added in v0.5.3

func (c *Conn) FirmwareInstallStatus(ctx context.Context, installVersion, component, taskID string) (state string, err error)

FirmwareInstallStatus returns the status of the firmware install task queued

func (*Conn) GetFirmwareInstallTaskQueued added in v0.5.3

func (c *Conn) GetFirmwareInstallTaskQueued(ctx context.Context, component string) (*rf.Task, error)

GetFirmwareInstallTaskQueued returns the redfish task object for a queued update task

func (*Conn) Inventory added in v0.5.3

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

func (*Conn) Name

func (c *Conn) Name() string

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 BMC via redfish

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) UserCreate added in v0.4.14

func (c *Conn) UserCreate(ctx context.Context, user, pass, role string) (ok bool, err error)

UserCreate adds a new user account

func (*Conn) UserDelete added in v0.5.3

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

UserDelete deletes a user account

func (*Conn) UserRead added in v0.4.14

func (c *Conn) UserRead(ctx context.Context) (users []map[string]string, err error)

UserRead returns a list of enabled user accounts

func (*Conn) UserUpdate added in v0.4.14

func (c *Conn) UserUpdate(ctx context.Context, user, pass, role string) (ok bool, err error)

UserUpdate updates a user password and role

type Option added in v0.5.3

type Option func(*Conn)

Option is a function applied to a *Conn

func WithHTTPClient added in v0.5.3

func WithHTTPClient(cli *http.Client) Option

WithHTTPClient returns an option that sets an HTTP client for the connecion

func WithSecureTLS added in v0.5.3

func WithSecureTLS(rootCAs *x509.CertPool) Option

WithSecureTLS returns an option that enables secure TLS with an optional cert pool.

Jump to

Keyboard shortcuts

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