common

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpCodePowerControlPowerOn       = "power_on"
	OpCodePowerControlForcePowerOn  = "force_power_on"
	OpCodePowerControlPowerOff      = "power_off"
	OpCodePowerControlForcePowerOff = "force_power_off"
	OpCodePowerControlRestart       = "restart"
	OpCodePowerControlForceRestart  = "force_restart"
	OpCodePowerControlWarmReset     = "warm_reset"
	OpCodePowerControlColdReset     = "cold_reset"
)

Power control operation codes

View Source
const (
	OpCodeFirmwareControlUpgrade   = "upgrade"
	OpCodeFirmwareControlDowngrade = "downgrade"
	OpCodeFirmwareControlRollback  = "rollback"
)

Firmware control operation codes

View Source
const (
	OpCodeBringUp = "bring_up"
	OpCodeIngest  = "ingest"
)

Bring-up operation codes

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentInfo

type ComponentInfo struct {
	Type        devicetypes.ComponentType
	DeviceInfo  deviceinfo.DeviceInfo
	ComponentID string // Component ID from the component manager service
}

func (*ComponentInfo) Validate

func (ci *ComponentInfo) Validate() error

type ExecutorType

type ExecutorType string
const (
	ExecutorTypeUnknown  ExecutorType = "unknown"
	ExecutorTypeTemporal ExecutorType = "temporal"
)

func (ExecutorType) IsValid

func (et ExecutorType) IsValid() bool

type OperationRuleListOptions

type OperationRuleListOptions struct {
	OperationType TaskType
	IsDefault     *bool
}

type TaskAttributes added in v1.2.0

type TaskAttributes struct {
	// ComponentsByType maps each targeted component type to its UUIDs.
	// Nil means the task targets no specific components.
	ComponentsByType map[devicetypes.ComponentType][]uuid.UUID `json:"components_by_type,omitempty"` //nolint:lll
}

TaskAttributes holds flexible task metadata stored as a single jsonb column. New fields can be added here without requiring a DB migration.

func (TaskAttributes) AllComponentUUIDs added in v1.2.0

func (a TaskAttributes) AllComponentUUIDs() []uuid.UUID

AllComponentUUIDs returns a flat slice of all component UUIDs across every component type, in no guaranteed order.

type TaskListOptions

type TaskListOptions struct {
	TaskType   TaskType
	RackID     uuid.UUID
	ActiveOnly bool
}

type TaskStatus

type TaskStatus string
const (
	TaskStatusUnknown    TaskStatus = "unknown"
	TaskStatusPending    TaskStatus = "pending"
	TaskStatusRunning    TaskStatus = "running"
	TaskStatusCompleted  TaskStatus = "completed"
	TaskStatusFailed     TaskStatus = "failed"
	TaskStatusTerminated TaskStatus = "terminated"
	// TaskStatusWaiting means the task was queued due to a conflict and is
	// waiting for the rack to become available. It is NOT a finished state.
	TaskStatusWaiting TaskStatus = "waiting"
)

func (TaskStatus) IsFinished

func (s TaskStatus) IsFinished() bool

type TaskType

type TaskType string
const (
	TaskTypeUnknown           TaskType = "unknown"
	TaskTypeInjectExpectation TaskType = "inject_expectation"
	TaskTypePowerControl      TaskType = "power_control"
	TaskTypeFirmwareControl   TaskType = "firmware_control"
	TaskTypeBringUp           TaskType = "bring_up"
)

func TaskTypeFromString

func TaskTypeFromString(s string) TaskType

func (TaskType) IsValid

func (tt TaskType) IsValid() bool

func (TaskType) IsZero added in v1.4.0

func (tt TaskType) IsZero() bool

func (TaskType) String

func (tt TaskType) String() string

Jump to

Keyboard shortcuts

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