Documentation
¶
Overview ¶
- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
- SPDX-License-Identifier: Apache-2.0 *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Package redfish wraps gofish to provide service-focused Redfish operations (inventory, power control, and firmware upload) with minimal coupling to underlying transport details.
Index ¶
- type RedfishClient
- func (c *RedfishClient) FactoryResetPmc() (*http.Response, error)
- func (c *RedfishClient) FirmwareInventories() ([]*redfish.SoftwareInventory, error)
- func (c *RedfishClient) PowerOff() (*http.Response, error)
- func (c *RedfishClient) PowerOn() (*http.Response, error)
- func (c *RedfishClient) QueryChassis() (*redfish.Chassis, error)
- func (c *RedfishClient) QueryManager() (*redfish.Manager, error)
- func (c *RedfishClient) QueryPowerShelf() (*powershelf.PowerShelf, error)
- func (c *RedfishClient) QueryPowerState() (redfish.PowerState, error)
- func (c *RedfishClient) QueryPowerSubsystem() (*redfish.PowerSubsystem, error)
- func (c *RedfishClient) QueryPowerSupplies() ([]*powersupply.PowerSupply, error)
- func (c *RedfishClient) QueryPowerSupply(uri string) (*powersupply.PowerSupply, error)
- func (c *RedfishClient) ResetChassis() (*http.Response, error)
- func (c *RedfishClient) ResetPmc(resetType ResetPmcType) (*http.Response, error)
- func (c *RedfishClient) SetHttpPushUriApplyTimeImmediate() (*http.Response, error)
- func (c *RedfishClient) UpdateFirmware(fw io.Reader) 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 ResetPmcType
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 PMC context to perform typed Redfish operations against a device.
func (*RedfishClient) FactoryResetPmc ¶
func (c *RedfishClient) FactoryResetPmc() (*http.Response, error)
FactoryResetPmc resets manager settings to defaults.
func (*RedfishClient) FirmwareInventories ¶
func (c *RedfishClient) FirmwareInventories() ([]*redfish.SoftwareInventory, error)
FirmwareInventories lists software/firmware inventories.
func (*RedfishClient) PowerOff ¶
func (c *RedfishClient) PowerOff() (*http.Response, error)
Power OFF the shelf
func (*RedfishClient) PowerOn ¶
func (c *RedfishClient) PowerOn() (*http.Response, error)
Power ON the shelf
func (*RedfishClient) QueryChassis ¶
func (c *RedfishClient) QueryChassis() (*redfish.Chassis, error)
QueryChassis fetches the powershelf chassis or returns an error if not found.
func (*RedfishClient) QueryManager ¶
func (c *RedfishClient) QueryManager() (*redfish.Manager, error)
QueryManager fetches the PMC manager or returns an error if not found.
func (*RedfishClient) QueryPowerShelf ¶
func (c *RedfishClient) QueryPowerShelf() (*powershelf.PowerShelf, error)
QueryPowerShelf aggregates the PMC, chassis, manager, and power supplies into a single view.
func (*RedfishClient) QueryPowerState ¶
func (c *RedfishClient) QueryPowerState() (redfish.PowerState, error)
QueryPowerState returns the power state of the shelf.
func (*RedfishClient) QueryPowerSubsystem ¶
func (c *RedfishClient) QueryPowerSubsystem() (*redfish.PowerSubsystem, error)
QueryPowerSubsystem returns the chassis PowerSubsystem resource.
func (*RedfishClient) QueryPowerSupplies ¶
func (c *RedfishClient) QueryPowerSupplies() ([]*powersupply.PowerSupply, error)
QueryPowerSupplies enumerates and hydrates all power supplies.
func (*RedfishClient) QueryPowerSupply ¶
func (c *RedfishClient) QueryPowerSupply(uri string) (*powersupply.PowerSupply, error)
QueryPowerSupply fetches and hydrates a PowerSupply by URI, including sensors.
func (*RedfishClient) ResetChassis ¶
func (c *RedfishClient) ResetChassis() (*http.Response, error)
ResetChassis resets the chassis
func (*RedfishClient) ResetPmc ¶
func (c *RedfishClient) ResetPmc(resetType ResetPmcType) (*http.Response, error)
ResetPmc resets the manager (PMC).
func (*RedfishClient) SetHttpPushUriApplyTimeImmediate ¶
func (c *RedfishClient) SetHttpPushUriApplyTimeImmediate() (*http.Response, error)
SetHttpPushUriApplyTimeImmediate configures firmware apply time to Immediate on UpdateService.
func (*RedfishClient) UpdateFirmware ¶
func (c *RedfishClient) UpdateFirmware(fw io.Reader) error
UpdateFirmware sets apply time to Immediate then uploads firmware from the reader.
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 via the Redfish UpdateService.
func (*RedfishClient) UploadFirmwareByPath ¶
func (c *RedfishClient) UploadFirmwareByPath(firmwarePath string) (*http.Response, error)
UploadFirmwareByPath opens a local file and uploads it via UpdateService.
type ResetPmcType ¶
type ResetPmcType string
const ( GracefulRestart ResetPmcType = "GracefulRestart" ForceRestart ResetPmcType = "ForceRestart" )