nvswitch

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUUID

func NewUUID() uuid.UUID

NewUUID generates a new UUID for an NVSwitchTray.

Types

type Component

type Component string

Component represents the updatable components of an NV-Switch tray.

const (
	// BMC is the BMC firmware updated via Redfish
	BMC Component = "BMC"
	// CPLD is updated via NVOS SSH
	CPLD Component = "CPLD"
	// BIOS is the BIOS firmware updated via Redfish
	BIOS Component = "BIOS"
	// NVOS is the operating system updated via SSH
	NVOS Component = "NVOS"
)

func (Component) IsValid

func (c Component) IsValid() bool

IsValid returns true if the component is a known valid component.

type FirmwareState

type FirmwareState string

FirmwareState represents the overall state of a firmware operation.

const (
	FirmwareStateQueued        FirmwareState = "Queued"
	FirmwareStateInProgress    FirmwareState = "InProgress"
	FirmwareStateWaitingReboot FirmwareState = "WaitingReboot"
	FirmwareStateVerifying     FirmwareState = "Verifying"
	FirmwareStateCompleted     FirmwareState = "Completed"
	FirmwareStateFailed        FirmwareState = "Failed"
)

func (FirmwareState) IsTerminal

func (s FirmwareState) IsTerminal() bool

IsTerminal returns true if the state is a terminal state (completed or failed).

type FirmwareUpdate

type FirmwareUpdate struct {
	SwitchUUID      uuid.UUID     `json:"switch_uuid"` // NVSwitchTray UUID
	Component       Component     `json:"component"`
	VersionFrom     string        `json:"version_from"`
	VersionTo       string        `json:"version_to"`
	State           FirmwareState `json:"state"`
	PercentComplete int           `json:"percent_complete"`
	JobID           string        `json:"job_id"`
	ErrorMessage    string        `json:"error_message,omitempty"`
}

FirmwareUpdate tracks the state of a firmware update operation.

type NVSwitchTray

type NVSwitchTray struct {
	UUID   uuid.UUID     `json:"uuid"`    // Service-generated unique identifier
	Vendor vendor.Vendor `json:"vendor"`  // Hardware vendor (e.g., NVIDIA)
	RackID string        `json:"rack_id"` // Optional rack identifier for grouping switches

	// Subsystems
	BMC  *bmc.BMC   `json:"bmc"`  // Board Management Controller subsystem
	NVOS *nvos.NVOS `json:"nvos"` // NV-Switch Operating System subsystem

	// Enriched data from Redfish (populated during inventory queries)
	Chassis         *gofish.Chassis `json:"-"` // Redfish chassis info
	Manager         *gofish.Manager `json:"-"` // Redfish manager info
	SerialNumber    string          `json:"serial_number"`
	FirmwareVersion string          `json:"firmware_version"` // BMC firmware version
	NVOSVersion     string          `json:"nvos_version"`     // NVOS version
	CPLDVersion     string          `json:"cpld_version"`     // CPLD firmware version
}

NVSwitchTray represents a complete NV-Switch tray with its two subsystems: BMC and NVOS. The UUID is service-generated and serves as the primary identifier for all operations.

Jump to

Keyboard shortcuts

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