nico

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ImplementationName is the name used to identify this implementation.
	ImplementationName = "nico"
)

Variables

This section is empty.

Functions

func Descriptor

func Descriptor(powerDelay time.Duration) componentmanager.Descriptor

Descriptor returns the NICo compute manager descriptor. powerDelay is the inter-component stagger for power control calls.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages compute node components via the NICo API.

func New

func New(nicoClient nicoapi.Client, powerDelay time.Duration) *Manager

New creates a new NICo-based compute Manager instance.

func (*Manager) BringUpControl

func (m *Manager) BringUpControl(
	ctx context.Context,
	target common.Target,
) error

BringUpControl opens the NICo power-on gate for each compute component, allowing bring-up and power on.

func (*Manager) FirmwareControl

func (m *Manager) FirmwareControl(ctx context.Context, target common.Target, info operations.FirmwareControlTaskInfo) error

FirmwareControl schedules a firmware update via NICo's SetFirmwareUpdateTimeWindow API.

Before scheduling, it performs:

  1. Fail-fast: if targetVersion is provided, it must match one of the desired firmware entries configured in Core.
  2. Idempotent: queries the actual firmware versions from explored endpoints and compares them against the target (or desired) versions. If all machines are already at the desired firmware, returns early.

func (*Manager) GetBringUpStatus

func (m *Manager) GetBringUpStatus(
	ctx context.Context,
	target common.Target,
) (map[string]operations.MachineBringUpState, error)

GetBringUpStatus returns the bring-up state for each compute component via NICo.

func (*Manager) GetFirmwareStatus

func (m *Manager) GetFirmwareStatus(ctx context.Context, target common.Target) (map[string]operations.FirmwareUpdateStatus, error)

GetFirmwareStatus returns the current status of firmware updates for the target components. It compares the actual firmware versions (from explored endpoints) against Core's desired firmware entries. If the actual versions match the desired versions, the component is considered Completed. Falls back to Machine.UpdateComplete / Machine.State when version data is unavailable.

func (*Manager) GetPowerStatus

func (m *Manager) GetPowerStatus(
	ctx context.Context,
	target common.Target,
) (map[string]operations.PowerStatus, error)

GetPowerStatus retrieves the power status of compute nodes via NICo API.

func (*Manager) InjectExpectation

func (m *Manager) InjectExpectation(
	ctx context.Context,
	target common.Target,
	info operations.InjectExpectationTaskInfo,
) error

InjectExpectation registers an expected machine with NICo via AddExpectedMachine. The Info field should contain a JSON-encoded nicoapi.AddExpectedMachineRequest.

func (*Manager) PowerControl

func (m *Manager) PowerControl(
	ctx context.Context,
	target common.Target,
	info operations.PowerControlTaskInfo,
) error

PowerControl performs power operations on a compute node via NICo API.

func (*Manager) Type

func (m *Manager) Type() devicetypes.ComponentType

Type returns the component type this manager handles.

Jump to

Keyboard shortcuts

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