Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) AccountService() (*redfish.AccountService, error)
- func (c *Client) BMCReset(ctx context.Context, resetType string) (ok bool, err error)
- func (c *Client) Chassis(ctx context.Context) ([]*redfish.Chassis, error)
- func (c *Client) ClearSystemEventLog(ctx context.Context) (err error)
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) ConvertTaskState(state string) constants.TaskState
- func (c *Client) Delete(url string) (*http.Response, error)
- func (c *Client) DeviceVendorModel(ctx context.Context) (vendor, model string, err error)
- func (c *Client) FirmwareUpload(ctx context.Context, updateFile *os.File, ...) (taskID string, err error)
- func (c *Client) Get(url string) (*http.Response, error)
- func (c *Client) GetBiosConfiguration(ctx context.Context) (biosConfig map[string]string, err error)
- func (c *Client) GetBootDeviceOverride(_ context.Context) (override bmc.BootDeviceOverride, err error)
- func (c *Client) GetBootProgress() ([]*redfish.BootProgress, error)
- func (c *Client) GetSystemEventLog(ctx context.Context) (entries [][]string, err error)
- func (c *Client) GetSystemEventLogRaw(ctx context.Context) (eventlog string, err error)
- func (c *Client) HttpClientTimeout() time.Duration
- func (c *Client) InsertedVirtualMedia(ctx context.Context) ([]string, error)
- func (c *Client) Inventory(ctx context.Context, failOnError bool) (device *common.Device, err error)
- func (c *Client) ManagerOdataID(ctx context.Context) (string, error)
- func (c *Client) Managers(ctx context.Context) ([]*redfish.Manager, error)
- func (c *Client) Open(ctx context.Context) error
- func (c *Client) PatchWithHeaders(ctx context.Context, url string, payload interface{}, ...) (*http.Response, error)
- func (c *Client) PostWithHeaders(ctx context.Context, url string, payload interface{}, ...) (*http.Response, error)
- func (c *Client) PowerSet(ctx context.Context, state string) (ok bool, err error)
- func (c *Client) ResetBiosConfiguration(ctx context.Context) (err error)
- func (c *Client) RunRawRequestWithHeaders(method, url string, payloadBuffer io.ReadSeeker, contentType string, ...) (*http.Response, error)
- func (c *Client) SendNMI(_ context.Context) error
- func (c *Client) SessionActive() error
- func (c *Client) SetBiosConfiguration(ctx context.Context, biosConfig map[string]string) (err error)
- func (c *Client) SetHttpClientTimeout(t time.Duration)
- func (c *Client) SetVirtualMedia(ctx context.Context, kind string, mediaURL string) (ok bool, err error)
- func (c *Client) StartUpdateForUploadedFirmware(ctx context.Context) (taskID string, err error)
- func (c *Client) SystemBootDeviceSet(_ context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
- func (c *Client) SystemForceOff(ctx context.Context) (ok bool, err error)
- func (c *Client) SystemPowerCycle(ctx context.Context) (ok bool, err error)
- func (c *Client) SystemPowerOff(ctx context.Context) (ok bool, err error)
- func (c *Client) SystemPowerOn(ctx context.Context) (ok bool, err error)
- func (c *Client) SystemPowerStatus(ctx context.Context) (result string, err error)
- func (c *Client) SystemReset(ctx context.Context) (ok bool, err error)
- func (c *Client) Systems() ([]*redfish.ComputerSystem, error)
- func (c *Client) SystemsBIOSOdataID(ctx context.Context) (string, error)
- func (c *Client) Task(ctx context.Context, taskID string) (*redfish.Task, error)
- func (c *Client) TaskStateActive(state constants.TaskState) (bool, error)
- func (c *Client) TaskStatus(ctx context.Context, taskID string) (constants.TaskState, string, error)
- func (c *Client) Tasks(ctx context.Context) ([]*redfish.Task, error)
- func (c *Client) UpdateService() (*redfish.UpdateService, error)
- func (c *Client) VersionCompatible() bool
- type Option
- type RedfishUpdateServiceParameters
- type TaskAccepted
Constants ¶
This section is empty.
Variables ¶
var ( ErrManagerID = errors.New("error identifying Manager Odata ID") ErrBIOSID = errors.New("error identifying System BIOS Odata ID") )
var ( // Supported Chassis Odata IDs KnownChassisOdataIDs = []string{ "/redfish/v1/Chassis/Enclosure.Internal.0-1", "/redfish/v1/Chassis/System.Embedded.1", "/redfish/v1/Chassis/Enclosure.Internal.0-1:NonRAID.Integrated.1-1", "/redfish/v1/Chassis/1", "/redfish/v1/Chassis/Self", "/redfish/v1/Chassis/ASRock_ROMED8HM3", } )
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 (*Client) AccountService ¶
func (c *Client) AccountService() (*redfish.AccountService, error)
AccountService gets the Redfish AccountService.d
func (*Client) ClearSystemEventLog ¶
ClearSystemEventLog clears all of the LogServices logs
func (*Client) ConvertTaskState ¶ added in v2.2.0
func (*Client) DeviceVendorModel ¶ added in v2.2.0
DeviceVendorModel returns the device manufacturer and model attributes
func (*Client) FirmwareUpload ¶ added in v2.2.0
func (c *Client) FirmwareUpload(ctx context.Context, updateFile *os.File, params *RedfishUpdateServiceParameters) (taskID string, err error)
FirmwareUpload uploads and initiates the firmware install process
func (*Client) GetBiosConfiguration ¶ added in v2.2.0
func (*Client) GetBootDeviceOverride ¶ added in v2.2.0
func (c *Client) GetBootDeviceOverride(_ context.Context) (override bmc.BootDeviceOverride, err error)
GetBootDeviceOverride returns the current boot override settings
func (*Client) GetBootProgress ¶ added in v2.3.2
func (c *Client) GetBootProgress() ([]*redfish.BootProgress, error)
func (*Client) GetSystemEventLog ¶ added in v2.2.0
GetSystemEventLog returns the SystemEventLogEntries
func (*Client) GetSystemEventLogRaw ¶ added in v2.2.0
GetSystemEventLogRaw returns the raw SEL
func (*Client) HttpClientTimeout ¶
retrieve the current HTTP client timeout
func (*Client) InsertedVirtualMedia ¶ added in v2.2.0
func (*Client) ManagerOdataID ¶ added in v2.2.0
func (*Client) PatchWithHeaders ¶
func (*Client) PostWithHeaders ¶
func (*Client) ResetBiosConfiguration ¶ added in v2.2.4
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 ¶
SessionActive returns an error if a redfish session is not active.
func (*Client) SetBiosConfiguration ¶ added in v2.2.4
func (*Client) SetHttpClientTimeout ¶
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) StartUpdateForUploadedFirmware ¶ added in v2.2.0
StartUpdateForUploadedFirmware starts an update for a firmware file previously uploaded and returns the taskID
func (*Client) SystemBootDeviceSet ¶
func (c *Client) SystemBootDeviceSet(_ context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
SystemBootDeviceSet set the boot device for the system.
func (*Client) SystemForceOff ¶
SystemForceOff powers off the system, without waiting for the OS to shutdown.
func (*Client) SystemPowerCycle ¶
SystemPowerCycle power cycles the system.
func (*Client) SystemPowerOff ¶
SystemPowerOff powers off the system.
func (*Client) SystemPowerOn ¶
SystemPowerOn powers on the system.
func (*Client) SystemPowerStatus ¶
SystemPowerStatus returns the system power state.
func (*Client) SystemReset ¶
SystemReset power cycles the system.
func (*Client) Systems ¶
func (c *Client) Systems() ([]*redfish.ComputerSystem, error)
Systems get the system instances from the service.
func (*Client) SystemsBIOSOdataID ¶ added in v2.2.0
func (*Client) TaskStateActive ¶ added in v2.2.0
func (*Client) TaskStatus ¶ added in v2.2.0
func (*Client) UpdateService ¶
func (c *Client) UpdateService() (*redfish.UpdateService, error)
UpdateService gets the update service instance.
func (*Client) VersionCompatible ¶
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 ¶
WithBasicAuthEnabled sets Basic Auth on the Gofish driver.
func WithEtagMatchDisabled ¶
WithEtagMatchDisabled disables the If-Match Etag header from being included by the Gofish driver.
As of the current implementation this disables the header for POST/PATCH requests to the System entity endpoints.
func WithHTTPClient ¶
WithHTTPClient returns an option that sets an HTTP client for the connecion
func WithLogger ¶ added in v2.2.0
WithLogger sets the logger on the redfish wrapper client
func WithSecureTLS ¶
WithSecureTLS returns an option that enables secure TLS with an optional cert pool.
func WithVersionsNotCompatible ¶
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
type RedfishUpdateServiceParameters ¶ added in v2.2.0
type RedfishUpdateServiceParameters struct { Targets []string `json:"Targets"` OperationApplyTime constants.OperationApplyTime `json:"@Redfish.OperationApplyTime"` Oem json.RawMessage `json:"Oem"` }
type TaskAccepted ¶ added in v2.2.0
type TaskAccepted struct { Accepted struct { Code string `json:"code"` Message string `json:"Message"` MessageExtendedInfo []struct { MessageID string `json:"MessageId"` Severity string `json:"Severity"` Resolution string `json:"Resolution"` Message string `json:"Message"` MessageArgs []string `json:"MessageArgs"` RelatedProperties []string `json:"RelatedProperties"` } `json:"@Message.ExtendedInfo"` } `json:"Accepted"` }