redfish

package
v1.19.2-redfish.preview.1 Latest Latest
Warning

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

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

Documentation

Overview

Package redfish provides entity definitions for Redfish computer systems.

Package redfish defines constants and types for Redfish v1 entities.

Index

Constants

View Source
const (
	// CIMPowerStateUnknown indicates the power state is unknown (0).
	CIMPowerStateUnknown = 0

	// CIMPowerStateOther indicates a power state not defined in the CIM spec (1).
	CIMPowerStateOther = 1

	// CIMPowerStateOn indicates the system is fully powered on (2).
	CIMPowerStateOn = 2

	// CIMPowerStateSleepLight indicates the system is in light sleep mode (3).
	CIMPowerStateSleepLight = 3

	// CIMPowerStateSleepDeep indicates the system is in deep sleep mode (4).
	CIMPowerStateSleepDeep = 4

	// CIMPowerStatePowerCycleOffSoft indicates soft power cycle off (5).
	CIMPowerStatePowerCycleOffSoft = 5

	// CIMPowerStateOffHard indicates hard power off (6).
	CIMPowerStateOffHard = 6

	// CIMPowerStateHibernate indicates the system is in hibernate state (7).
	CIMPowerStateHibernate = 7

	// CIMPowerStateOffSoft indicates soft power off (8).
	CIMPowerStateOffSoft = 8

	// CIMPowerStatePowerCycleOffHard indicates hard power cycle off (9).
	CIMPowerStatePowerCycleOffHard = 9

	// CIMPowerStateMasterBusReset indicates master bus reset (10).
	CIMPowerStateMasterBusReset = 10

	// CIMPowerStateDiagnosticInterrupt indicates diagnostic interrupt/NMI (11).
	CIMPowerStateDiagnosticInterrupt = 11

	// CIMPowerStateOffSoftGraceful indicates graceful soft power off (12).
	CIMPowerStateOffSoftGraceful = 12

	// CIMPowerStateOffHardGraceful indicates graceful hard power off (13).
	CIMPowerStateOffHardGraceful = 13

	// CIMPowerStateMasterBusResetGraceful indicates graceful master bus reset (14).
	CIMPowerStateMasterBusResetGraceful = 14

	// CIMPowerStatePowerCycleOffSoftGraceful indicates graceful soft power cycle (15).
	CIMPowerStatePowerCycleOffSoftGraceful = 15

	// CIMPowerStatePowerCycleOffHardGraceful indicates graceful hard power cycle (16).
	CIMPowerStatePowerCycleOffHardGraceful = 16
)

CIM (Common Information Model) Power State constants These constants are from the DMTF CIM_AssociatedPowerManagementService specification Reference: https://www.dmtf.org/sites/default/files/standards/documents/DSP0004_3.0.1.pdf

View Source
const (
	// CIMPowerActionOn powers on the system (same as CIMPowerStateOn).
	CIMPowerActionOn = CIMPowerStateOn

	// CIMPowerActionCycle performs a power cycle (soft).
	CIMPowerActionCycle = CIMPowerStatePowerCycleOffSoft

	// CIMPowerActionOffHard performs a hard power off.
	CIMPowerActionOffHard = CIMPowerStateOffHard

	// CIMPowerActionOffSoft performs a soft power off.
	CIMPowerActionOffSoft = CIMPowerStateOffSoft

	// CIMPowerActionReset performs a master bus reset/reboot.
	CIMPowerActionReset = CIMPowerStateMasterBusReset
)

CIM_PowerManagementService RequestPowerStateChange action values. These are the most commonly used power action constants from the CIM spec.

View Source
const (
	// ServiceUnavailableRetryAfterSeconds is the default retry-after duration in seconds
	// for 503 Service Unavailable responses.
	ServiceUnavailableRetryAfterSeconds = 60
)

Redfish service retry constants.

Variables

This section is empty.

Functions

func IsPowerOff

func IsPowerOff(state int) bool

IsPowerOff returns true if the power state indicates the system is powered off.

func IsPowerOn

func IsPowerOn(state int) bool

IsPowerOn returns true if the power state indicates the system is powered on.

func IsSleepState

func IsSleepState(state int) bool

IsSleepState returns true if the power state indicates a sleep/hibernate state.

Types

type ComputerSystem

type ComputerSystem struct {
	ID               string                          `json:"Id"`
	Name             string                          `json:"Name"`
	Description      string                          `json:"Description,omitempty"`
	BiosVersion      string                          `json:"BiosVersion,omitempty"`
	HostName         string                          `json:"HostName,omitempty"`
	SystemType       SystemType                      `json:"SystemType"`
	Manufacturer     string                          `json:"Manufacturer"`
	Model            string                          `json:"Model"`
	SerialNumber     string                          `json:"SerialNumber"`
	PowerState       PowerState                      `json:"PowerState"`
	Status           *Status                         `json:"Status,omitempty"`
	MemorySummary    *ComputerSystemMemorySummary    `json:"MemorySummary,omitempty"`
	ProcessorSummary *ComputerSystemProcessorSummary `json:"ProcessorSummary,omitempty"`
	ODataID          string                          `json:"@odata.id"`
	ODataType        string                          `json:"@odata.type"`
}

ComputerSystem represents a Redfish Computer System entity.

type ComputerSystemMemorySummary

type ComputerSystemMemorySummary struct {
	TotalSystemMemoryGiB *float32        `json:"TotalSystemMemoryGiB"`
	Status               *Status         `json:"Status,omitempty"`
	MemoryMirroring      MemoryMirroring `json:"MemoryMirroring,omitempty"`
}

ComputerSystemMemorySummary represents the memory summary of a computer system.

type ComputerSystemProcessorSummary

type ComputerSystemProcessorSummary struct {
	Count                   *int    `json:"Count,omitempty"`
	CoreCount               *int    `json:"CoreCount,omitempty"`
	LogicalProcessorCount   *int    `json:"LogicalProcessorCount,omitempty"`
	Metrics                 *string `json:"Metrics,omitempty"`
	Model                   *string `json:"Model,omitempty"`
	Status                  *Status `json:"Status,omitempty"`
	StatusRedfishDeprecated *string `json:"Status@Redfish.Deprecated,omitempty"`
	ThreadingEnabled        *bool   `json:"ThreadingEnabled,omitempty"`
}

ComputerSystemProcessorSummary represents the processor summary of a computer system.

type MemoryMirroring

type MemoryMirroring string

MemoryMirroring represents the type of memory mirroring supported by the system.

const (
	// MemoryMirroringSystem indicates system-level DIMM mirroring support.
	MemoryMirroringSystem MemoryMirroring = "System"
	// MemoryMirroringDIMM indicates DIMM-level mirroring support.
	MemoryMirroringDIMM MemoryMirroring = "DIMM"
	// MemoryMirroringHybrid indicates hybrid system and DIMM-level mirroring support.
	MemoryMirroringHybrid MemoryMirroring = "Hybrid"
	// MemoryMirroringNone indicates no DIMM mirroring support.
	MemoryMirroringNone MemoryMirroring = "None"
)

type PowerState

type PowerState string

PowerState represents the power state of a computer system.

const (
	// PowerStateOn indicates that the system is powered on.
	PowerStateOn PowerState = "On"
	// PowerStateOff indicates that the system is powered off.
	PowerStateOff PowerState = "Off"
	// ResetTypeOn indicates a power on reset.
	ResetTypeOn PowerState = "On"
	// ResetTypeForceOff indicates a forced power off.
	ResetTypeForceOff PowerState = "ForceOff"
	// ResetTypeForceRestart indicates a forced restart.
	ResetTypeForceRestart PowerState = "ForceRestart"
	// ResetTypePowerCycle indicates a power cycle.
	ResetTypePowerCycle PowerState = "PowerCycle"
)

type Status

type Status struct {
	State        string `json:"State,omitempty"`
	Health       string `json:"Health,omitempty"`
	HealthRollup string `json:"HealthRollup,omitempty"`
}

Status represents the status and health of a resource.

type SystemType

type SystemType string

SystemType represents the type of computer system.

const (
	// SystemTypePhysical indicates a physical computer system.
	SystemTypePhysical SystemType = "Physical"
	// SystemTypeVirtual indicates a virtual computer system.
	SystemTypeVirtual SystemType = "Virtual"
)

Jump to

Keyboard shortcuts

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