redfish

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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

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 New

func New(ctx context.Context, pmc *pmc.PMC, reuse_connections bool) (*RedfishClient, error)

New creates a RedfishClient for the given PMC and context.

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

func (c *RedfishClient) UploadFirmware(fw io.Reader) (*http.Response, error)

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"
)

Jump to

Keyboard shortcuts

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