Documentation
¶
Overview ¶
Package redfish wraps gofish to provide service-focused Redfish operations (inventory, power control, and firmware upload) for NV-Switch trays with minimal coupling to underlying transport details.
Index ¶
- type RedfishClient
- func (c *RedfishClient) EnsureHttpPushUriApplyTimeImmediate() error
- func (c *RedfishClient) FirmwareInventories() ([]*redfish.SoftwareInventory, error)
- func (c *RedfishClient) GetHttpPushUriApplyTime() (string, error)
- func (c *RedfishClient) GetTaskStatus(taskURI string) (string, int, error)
- func (c *RedfishClient) GetTaskURI(resp *http.Response) (string, error)
- func (c *RedfishClient) PowerCycle() (*http.Response, error)
- func (c *RedfishClient) QueryChassis() (*redfish.Chassis, error)
- func (c *RedfishClient) QueryManager() (*redfish.Manager, error)
- func (c *RedfishClient) ResetBMC(resetType ResetBMCType) (*http.Response, error)
- func (c *RedfishClient) ResetSystem(resetType ResetType) (*http.Response, error)
- func (c *RedfishClient) SetHttpPushUriApplyTimeImmediate() (*http.Response, error)
- func (c *RedfishClient) UpdateFirmware(fw io.Reader) (*http.Response, error)
- func (c *RedfishClient) UpdateFirmwareByPath(firmwarePath string) (*http.Response, error)
- func (c *RedfishClient) UpdateService() (*redfish.UpdateService, error)
- func (c *RedfishClient) UploadFirmware(fw io.Reader) (*http.Response, error)
- func (c *RedfishClient) UploadFirmwareByPath(firmwarePath string) (*http.Response, error)
- type ResetBMCType
- type ResetType
- type TaskResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedfishClient ¶
type RedfishClient struct {
*gofish.APIClient
gofish.ClientConfig
// contains filtered or unexported fields
}
RedfishClient manages a gofish API client and BMC context to perform typed Redfish operations against a device.
func (*RedfishClient) EnsureHttpPushUriApplyTimeImmediate ¶
func (c *RedfishClient) EnsureHttpPushUriApplyTimeImmediate() error
EnsureHttpPushUriApplyTimeImmediate checks the current apply time and sets it to Immediate if needed. Returns nil if already Immediate or successfully set. Returns error only on real failures.
func (*RedfishClient) FirmwareInventories ¶
func (c *RedfishClient) FirmwareInventories() ([]*redfish.SoftwareInventory, error)
FirmwareInventories lists software/firmware inventories.
func (*RedfishClient) GetHttpPushUriApplyTime ¶
func (c *RedfishClient) GetHttpPushUriApplyTime() (string, error)
GetHttpPushUriApplyTime returns the current HttpPushUriApplyTime setting from UpdateService. Returns the ApplyTime string (e.g., "Immediate", "OnReset") or empty string if not found.
func (*RedfishClient) GetTaskStatus ¶
func (c *RedfishClient) GetTaskStatus(taskURI string) (string, int, error)
GetTaskStatus queries the status of a task
func (*RedfishClient) GetTaskURI ¶
func (c *RedfishClient) GetTaskURI(resp *http.Response) (string, error)
GetTaskURI extracts task URI from firmware update response
func (*RedfishClient) PowerCycle ¶
func (c *RedfishClient) PowerCycle() (*http.Response, error)
PowerCycle performs a power cycle on the NV-Switch tray via Redfish.
func (*RedfishClient) QueryChassis ¶
func (c *RedfishClient) QueryChassis() (*redfish.Chassis, error)
QueryChassis fetches the NV-Switch chassis or returns an error if not found.
func (*RedfishClient) QueryManager ¶
func (c *RedfishClient) QueryManager() (*redfish.Manager, error)
QueryManager fetches the BMC manager or returns an error if not found.
func (*RedfishClient) ResetBMC ¶
func (c *RedfishClient) ResetBMC(resetType ResetBMCType) (*http.Response, error)
ResetBMC resets the BMC manager.
func (*RedfishClient) ResetSystem ¶
func (c *RedfishClient) ResetSystem(resetType ResetType) (*http.Response, error)
ResetSystem performs a ComputerSystem.Reset action on the NV-Switch tray via Redfish.
func (*RedfishClient) SetHttpPushUriApplyTimeImmediate ¶
func (c *RedfishClient) SetHttpPushUriApplyTimeImmediate() (*http.Response, error)
SetHttpPushUriApplyTimeImmediate configures firmware apply time to Immediate on UpdateService.
func (*RedfishClient) UpdateFirmware ¶
UpdateFirmware ensures apply time is Immediate then uploads firmware from the reader. It first checks the current apply time setting and only attempts to change it if needed.
func (*RedfishClient) UpdateFirmwareByPath ¶
func (c *RedfishClient) UpdateFirmwareByPath(firmwarePath string) (*http.Response, error)
UpdateFirmwareByPath opens a local file and performs UpdateFirmware.
func (*RedfishClient) UpdateService ¶
func (c *RedfishClient) UpdateService() (*redfish.UpdateService, error)
UpdateService returns the Redfish UpdateService resource.
func (*RedfishClient) UploadFirmware ¶
UploadFirmware uploads firmware from an io.Reader using basic auth.
func (*RedfishClient) UploadFirmwareByPath ¶
func (c *RedfishClient) UploadFirmwareByPath(firmwarePath string) (*http.Response, error)
UploadFirmwareByPath opens a local file and uploads it via UpdateService.
type ResetBMCType ¶
type ResetBMCType string
const ( GracefulBMCRestart ResetBMCType = "GracefulRestart" ForceBMCRestart ResetBMCType = "ForceRestart" )
type TaskResponse ¶
type TaskResponse struct {
TaskURI string `json:"@odata.id"`
}
TaskResponse represents a Redfish task response