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.
* 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.
Index ¶
- type Config
- type DataStoreType
- type PowershelfManager
- func (pm *PowershelfManager) GetAllPowershelves(ctx context.Context) ([]*powershelf.PowerShelf, error)
- func (pm *PowershelfManager) GetFirmwareUpdateStatus(ctx context.Context, mac net.HardwareAddr, component powershelf.Component) (*powershelf.FirmwareUpdate, error)
- func (pm *PowershelfManager) GetPmc(ctx context.Context, mac net.HardwareAddr) (*pmc.PMC, error)
- func (pm *PowershelfManager) GetPowershelves(ctx context.Context, macs []net.HardwareAddr) ([]*powershelf.PowerShelf, error)
- func (pm *PowershelfManager) ListAvailableFirmware(ctx context.Context, mac net.HardwareAddr) ([]firmwaremanager.FirmwareUpgrade, error)
- func (pm *PowershelfManager) PowerControlDirect(ctx context.Context, pmc *pmc.PMC, on bool) error
- func (pm *PowershelfManager) PowerOff(ctx context.Context, mac net.HardwareAddr) error
- func (pm *PowershelfManager) PowerOn(ctx context.Context, mac net.HardwareAddr) error
- func (pm *PowershelfManager) RegisterPmc(ctx context.Context, pmc *pmc.PMC) error
- func (pm *PowershelfManager) Start(ctx context.Context) error
- func (pm *PowershelfManager) Stop(ctx context.Context) error
- func (pm *PowershelfManager) UpgradeFirmware(ctx context.Context, mac net.HardwareAddr, component powershelf.Component, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DSType DataStoreType
PmcRegistryConf pmcregistry.Config
CredentialConf credentials.Config
FirmwareDir string
}
Config contains the orchestrator’s datastore mode and concrete backends for the PMC registry and the credential manager.
type DataStoreType ¶
type DataStoreType string
DataStoreType selects between Persistent (Postgres+Vault) and InMemory backends.
const ( DatastoreTypePersistent DataStoreType = "Persistent" DatastoreTypeInMemory DataStoreType = "InMemory" )
func StringToDSType ¶
func StringToDSType(s string) (DataStoreType, bool)
StringToDSType converts a string to a DataStoreType, returning false if unsupported.
type PowershelfManager ¶
type PowershelfManager struct {
DataStoreType DataStoreType
PmcManager *pmcmanager.PmcManager
FirmwareManager *firmwaremanager.Manager
}
PowershelfManager coordinates registry, credential manager, firmware manager, and Redfish sessions to implement service operations.
func New ¶
func New(ctx context.Context, c Config) (*PowershelfManager, error)
New creates a new instance of PowershelfManager with firmware, credential, and registry backends based on the given configuration.
func (*PowershelfManager) GetAllPowershelves ¶
func (pm *PowershelfManager) GetAllPowershelves(ctx context.Context) ([]*powershelf.PowerShelf, error)
GetAllPowershelves returns PowerShelf views for all registered PMCs.
func (*PowershelfManager) GetFirmwareUpdateStatus ¶
func (pm *PowershelfManager) GetFirmwareUpdateStatus(ctx context.Context, mac net.HardwareAddr, component powershelf.Component) (*powershelf.FirmwareUpdate, error)
GetFirmwareUpdateStatus returns the status of a firmware update for the specified PMC and component.
func (*PowershelfManager) GetPmc ¶
func (pm *PowershelfManager) GetPmc(ctx context.Context, mac net.HardwareAddr) (*pmc.PMC, error)
GetPmc resolves a PMC by MAC from the registry and attaches its credential from the credential manager.
func (*PowershelfManager) GetPowershelves ¶
func (pm *PowershelfManager) GetPowershelves(ctx context.Context, macs []net.HardwareAddr) ([]*powershelf.PowerShelf, error)
GetAllPowershelves returns PowerShelf views for all registered PMCs.
func (*PowershelfManager) ListAvailableFirmware ¶
func (pm *PowershelfManager) ListAvailableFirmware(ctx context.Context, mac net.HardwareAddr) ([]firmwaremanager.FirmwareUpgrade, error)
func (*PowershelfManager) PowerControlDirect ¶ added in v1.3.1
PowerControlDirect performs a power action using pre-built connection details, bypassing registry and credential manager lookups.
func (*PowershelfManager) PowerOff ¶
func (pm *PowershelfManager) PowerOff(ctx context.Context, mac net.HardwareAddr) error
Power OFF the rack
func (*PowershelfManager) PowerOn ¶
func (pm *PowershelfManager) PowerOn(ctx context.Context, mac net.HardwareAddr) error
Power ON the rack
func (*PowershelfManager) RegisterPmc ¶
RegisterPmc persists PMC identity in the registry and stores credentials keyed by MAC in the credential manager.
func (*PowershelfManager) Start ¶
func (pm *PowershelfManager) Start(ctx context.Context) error
Start initializes the registry and credential manager.
func (*PowershelfManager) Stop ¶
func (pm *PowershelfManager) Stop(ctx context.Context) error
Stop shuts down the registry and credential manager.
func (*PowershelfManager) UpgradeFirmware ¶
func (pm *PowershelfManager) UpgradeFirmware(ctx context.Context, mac net.HardwareAddr, component powershelf.Component, targetFwVersion string) error
UpgradeFirmware performs (or simulates) a firmware upgrade. Returns the underlying HTTP response from the device on success.