redfishwrapper

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a redfishwrapper client which wraps the gofish client.

func NewClient

func NewClient(host, port, user, pass string, opts ...Option) *Client

NewClient returns a redfishwrapper client

func (*Client) AccountService

func (c *Client) AccountService() (*gofishrf.AccountService, error)

AccountService gets the Redfish AccountService.d

func (*Client) BMCReset

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

BMCReset powercycles the BMC.

func (*Client) Chassis

func (c *Client) Chassis(ctx context.Context) ([]*gofishrf.Chassis, error)

Chassis gets the chassis instances managed by this service.

func (*Client) Close

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

Close closes the redfish session.

func (*Client) Delete

func (c *Client) Delete(url string) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(url string) (*http.Response, error)

func (*Client) HttpClientTimeout

func (c *Client) HttpClientTimeout() time.Duration

retrieve the current HTTP client timeout

func (*Client) Managers

func (c *Client) Managers(ctx context.Context) ([]*gofishrf.Manager, error)

Managers gets the manager instances of this service.

func (*Client) Open

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

Open sets up a new redfish session.

func (*Client) PatchWithHeaders

func (c *Client) PatchWithHeaders(ctx context.Context, url string, payload interface{}, headers map[string]string) (*http.Response, error)

func (*Client) PostWithHeaders

func (c *Client) PostWithHeaders(ctx context.Context, url string, payload interface{}, headers map[string]string) (*http.Response, error)

func (*Client) RunRawRequestWithHeaders

func (c *Client) RunRawRequestWithHeaders(method, url string, payloadBuffer io.ReadSeeker, contentType string, customHeaders map[string]string) (*http.Response, error)

RunRawRequestWithHeaders wraps the gofish client method RunRawRequestWithHeaders

func (*Client) SessionActive

func (c *Client) SessionActive() error

SessionActive returns an error if a redfish session is not active.

func (*Client) SetHttpClientTimeout

func (c *Client) SetHttpClientTimeout(t time.Duration)

Overrides the HTTP client timeout

func (*Client) SetVirtualMedia

func (c *Client) SetVirtualMedia(ctx context.Context, kind string, mediaURL string) (ok bool, err error)

Set the virtual media attached to the system, or just eject everything if mediaURL is empty.

func (*Client) SystemBootDeviceSet

func (c *Client) SystemBootDeviceSet(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)

Set the boot device for the system.

func (*Client) SystemForceOff

func (c *Client) SystemForceOff(ctx context.Context) (ok bool, err error)

SystemForceOff powers off the system, without waiting for the OS to shutdown.

func (*Client) SystemPowerCycle

func (c *Client) SystemPowerCycle(ctx context.Context) (ok bool, err error)

SystemPowerCycle power cycles the system.

func (*Client) SystemPowerOff

func (c *Client) SystemPowerOff(ctx context.Context) (ok bool, err error)

SystemPowerOff powers off the system.

func (*Client) SystemPowerOn

func (c *Client) SystemPowerOn(ctx context.Context) (ok bool, err error)

SystemPowerOn powers on the system.

func (*Client) SystemPowerStatus

func (c *Client) SystemPowerStatus(ctx context.Context) (result string, err error)

SystemPowerStatus returns the system power state.

func (*Client) SystemReset

func (c *Client) SystemReset(ctx context.Context) (ok bool, err error)

SystemReset power cycles the system.

func (*Client) Systems

func (c *Client) Systems() ([]*gofishrf.ComputerSystem, error)

Systems get the system instances from the service.

func (*Client) UpdateService

func (c *Client) UpdateService() (*gofishrf.UpdateService, error)

UpdateService gets the update service instance.

func (*Client) VersionCompatible

func (c *Client) VersionCompatible() bool

VersionCompatible compares the redfish version reported by the BMC with the blacklist if specified.

type Option

type Option func(*Client)

Option is a function applied to a *Conn

func WithBasicAuthEnabled

func WithBasicAuthEnabled(e bool) Option

WithBasicAuthEnabled sets Basic Auth on the Gofish driver.

func WithHTTPClient

func WithHTTPClient(cli *http.Client) Option

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

func WithSecureTLS

func WithSecureTLS(rootCAs *x509.CertPool) Option

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

func WithVersionsNotCompatible

func WithVersionsNotCompatible(versions []string) Option

WithVersionsNotCompatible returns an option that sets the redfish versions to ignore as incompatible.

The version string value must match the value returned by curl -k "https://10.247.133.39/redfish/v1" | jq .RedfishVersion

Jump to

Keyboard shortcuts

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