types

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: 3 Imported by: 0

Documentation

Overview

Package types provides public domain types for the RLA client. This package has minimal dependencies (only uuid) and can be imported by external modules for interface definitions and mocking without pulling in gRPC dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMC

type BMC struct {
	Type     BMCType
	MAC      net.HardwareAddr
	IP       net.IP
	User     string
	Password string
}

BMC represents BMC (Baseboard Management Controller) information.

type BMCType

type BMCType string

BMCType represents the type of BMC (Baseboard Management Controller).

const (
	BMCTypeUnknown BMCType = "UNKNOWN"
	BMCTypeHost    BMCType = "HOST"
	BMCTypeDPU     BMCType = "DPU"
)

type Component

type Component struct {
	Type            ComponentType
	Info            DeviceInfo
	FirmwareVersion string
	Position        InRackPosition
	BMCs            []BMC
	ComponentID     string // Component ID from the component manager service
	RackID          uuid.UUID
	PowerState      string
}

Component represents a rack component (compute node, switch, etc.).

type ComponentDiff

type ComponentDiff struct {
	Type        DiffType
	ComponentID string
	Expected    *Component
	Actual      *Component
	FieldDiffs  []FieldDiff
}

ComponentDiff represents a difference found during validation.

type ComponentType

type ComponentType string

ComponentType represents the type of a rack component.

const (
	ComponentTypeUnknown    ComponentType = "UNKNOWN"
	ComponentTypeCompute    ComponentType = "COMPUTE"
	ComponentTypeNVSwitch   ComponentType = "NVSWITCH"
	ComponentTypePowerShelf ComponentType = "POWERSHELF"
	ComponentTypeTORSwitch  ComponentType = "TORSWITCH"
	ComponentTypeUMS        ComponentType = "UMS"
	ComponentTypeCDU        ComponentType = "CDU"
)

type DeviceInfo

type DeviceInfo struct {
	ID           uuid.UUID
	Name         string
	Manufacturer string
	Model        string
	SerialNumber string
	Description  string
}

DeviceInfo contains device identification information.

type DiffType

type DiffType string

DiffType represents the type of difference in component validation.

const (
	DiffTypeUnknown        DiffType = "UNKNOWN"
	DiffTypeOnlyInExpected DiffType = "ONLY_IN_EXPECTED"
	DiffTypeOnlyInActual   DiffType = "ONLY_IN_ACTUAL"
	DiffTypeDrift          DiffType = "DRIFT"
)

type FieldDiff

type FieldDiff struct {
	FieldName     string
	ExpectedValue string
	ActualValue   string
}

FieldDiff represents a single field difference.

type Identifier

type Identifier struct {
	ID   uuid.UUID
	Name string
}

Identifier can identify a resource by ID or Name.

type InRackPosition

type InRackPosition struct {
	SlotID    int
	TrayIndex int
	HostID    int
}

InRackPosition represents a component's position within a rack.

type Location

type Location struct {
	Region     string
	Datacenter string
	Room       string
	Position   string
}

Location represents physical location of a rack.

type NVLDomain

type NVLDomain struct {
	ID   uuid.UUID
	Name string
}

NVLDomain represents an NVL domain (a group of related racks).

type OperationRule

type OperationRule struct {
	ID                 uuid.UUID
	Name               string
	Description        string
	OperationType      OperationType
	OperationCode      string // e.g., "power_on", "upgrade"
	RuleDefinitionJSON string // JSON-encoded rule definition
	IsDefault          bool
	CreatedAt          time.Time
	UpdatedAt          time.Time
}

OperationRule represents a configurable rule for executing operations.

type OperationType

type OperationType string

OperationType represents the type of operation (power control, firmware, etc.).

const (
	OperationTypeUnknown         OperationType = "UNKNOWN"
	OperationTypePowerControl    OperationType = "POWER_CONTROL"
	OperationTypeFirmwareControl OperationType = "FIRMWARE_CONTROL"
)

type Pagination

type Pagination struct {
	Offset int
	Limit  int
}

Pagination for list requests.

type PowerControlOp

type PowerControlOp string

PowerControlOp represents a power control operation.

const (
	PowerControlOpOn           PowerControlOp = "ON"
	PowerControlOpForceOn      PowerControlOp = "FORCE_ON"
	PowerControlOpOff          PowerControlOp = "OFF"
	PowerControlOpForceOff     PowerControlOp = "FORCE_OFF"
	PowerControlOpRestart      PowerControlOp = "RESTART"
	PowerControlOpForceRestart PowerControlOp = "FORCE_RESTART"
	PowerControlOpWarmReset    PowerControlOp = "WARM_RESET"
	PowerControlOpColdReset    PowerControlOp = "COLD_RESET"
)

type Rack

type Rack struct {
	Info       DeviceInfo
	Location   Location
	Components []Component
}

Rack represents a physical rack containing components.

type RackRuleAssociation

type RackRuleAssociation struct {
	RackID        uuid.UUID
	OperationType OperationType
	OperationCode string // e.g., "power_on", "upgrade"
	RuleID        uuid.UUID
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

RackRuleAssociation represents an association between a rack and an operation rule.

type StringQueryInfo

type StringQueryInfo struct {
	Patterns   []string
	IsWildcard bool
	UseOR      bool
}

StringQueryInfo for filtering list requests.

type Task

type Task struct {
	ID           uuid.UUID
	Operation    string
	RackID       uuid.UUID
	ComponentIDs []uuid.UUID
	Description  string
	ExecutorType TaskExecutorType
	ExecutionID  string
	Status       TaskStatus
	Message      string
}

Task represents an async operation task.

type TaskExecutorType

type TaskExecutorType string

TaskExecutorType represents the type of task executor.

const (
	TaskExecutorTypeUnknown  TaskExecutorType = "UNKNOWN"
	TaskExecutorTypeTemporal TaskExecutorType = "TEMPORAL"
)

type TaskStatus

type TaskStatus string

TaskStatus represents the status of an async task.

const (
	TaskStatusUnknown   TaskStatus = "UNKNOWN"
	TaskStatusPending   TaskStatus = "PENDING"
	TaskStatusRunning   TaskStatus = "RUNNING"
	TaskStatusCompleted TaskStatus = "COMPLETED"
	TaskStatusFailed    TaskStatus = "FAILED"
)

Jump to

Keyboard shortcuts

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