api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LabelsAnnotation = "libvirt-provider.ironcore.dev/labels"

	AnnotationsAnnotation = "libvirt-provider.ironcore.dev/annotations"
)
View Source
const (
	ManagerLabel = "libvirt-provider.ironcore.dev/manager"
	ClassLabel   = "libvirt-provider.ironcore.dev/class"
)
View Source
const (
	MachineManager = "libvirt-provider"
)
View Source
const (
	// NvidiaGPUPlugin is the resource name for NVIDIA GPU devices to be claimed
	NvidiaGPUPlugin = "nvidia.com/gpu"
)

Variables

This section is empty.

Functions

func GetClassLabel

func GetClassLabel(o apiutils.Object) (string, bool)

func GetObjectMetadata

func GetObjectMetadata(o apiutils.Metadata) (*irimeta.ObjectMetadata, error)

func HasBootImage added in v0.3.0

func HasBootImage(machine *Machine) *string

func IsImageReferenced added in v0.3.0

func IsImageReferenced(machine *Machine, image string) bool

func IsManagedBy

func IsManagedBy(o apiutils.Object, manager string) bool

func SetClassLabel

func SetClassLabel(o apiutils.Object, class string)

func SetManagerLabel

func SetManagerLabel(o apiutils.Object, manager string)

func SetObjectMetadata

func SetObjectMetadata(o apiutils.Object, metadata *irimeta.ObjectMetadata) error

Types

type GuestAgent

type GuestAgent string
const (
	GuestAgentNone GuestAgent = "None"
	GuestAgentQemu GuestAgent = "Qemu"
)

type GuestAgentStatus

type GuestAgentStatus struct {
	Addr string `json:"addr,omitempty"`
}

type LocalDiskSpec added in v0.3.0

type LocalDiskSpec struct {
	Size  int64   `json:"size"`
	Image *string `json:"image"`
}

type Machine

type Machine struct {
	apiutils.Metadata `json:"metadata,omitempty"`

	Spec   MachineSpec   `json:"spec"`
	Status MachineStatus `json:"status"`
}

type MachineSpec

type MachineSpec struct {
	Power PowerState `json:"power"`

	Cpu         int64 `json:"cpu"`
	MemoryBytes int64 `json:"memoryBytes"`

	Ignition []byte `json:"ignition"`

	Volumes           []*VolumeSpec           `json:"volumes"`
	NetworkInterfaces []*NetworkInterfaceSpec `json:"networkInterfaces"`
	Gpu               []pci.Address           `json:"gpu"`

	ShutdownAt time.Time `json:"shutdownAt,omitempty"`

	GuestAgent GuestAgent `json:"guestAgent"`
}

type MachineState

type MachineState string
const (
	MachineStatePending     MachineState = "Pending"
	MachineStateRunning     MachineState = "Running"
	MachineStateSuspended   MachineState = "Suspended"
	MachineStateTerminating MachineState = "Terminating"
	MachineStateTerminated  MachineState = "Terminated"
)

type MachineStatus

type MachineStatus struct {
	VolumeStatus           []VolumeStatus           `json:"volumeStatus"`
	NetworkInterfaceStatus []NetworkInterfaceStatus `json:"networkInterfaceStatus"`
	State                  MachineState             `json:"state"`
	ImageRef               string                   `json:"imageRef"`
	GuestAgentStatus       *GuestAgentStatus        `json:"guestAgentStatus,omitempty"`
}

type NetworkInterfaceSpec

type NetworkInterfaceSpec struct {
	Name       string            `json:"name"`
	NetworkId  string            `json:"networkId"`
	Ips        []string          `json:"ips"`
	Attributes map[string]string `json:"attributes"`
}

type NetworkInterfaceState

type NetworkInterfaceState string
const (
	NetworkInterfaceStatePending  NetworkInterfaceState = "Pending"
	NetworkInterfaceStateAttached NetworkInterfaceState = "Attached"
)

type NetworkInterfaceStatus

type NetworkInterfaceStatus struct {
	Name   string                `json:"name"`
	Handle string                `json:"handle"`
	State  NetworkInterfaceState `json:"state"`
}

type PowerState

type PowerState int32
const (
	PowerStatePowerOn  PowerState = 0
	PowerStatePowerOff PowerState = 1
)

type VolumeConnection

type VolumeConnection struct {
	Driver                string            `json:"driver,omitempty"`
	Handle                string            `json:"handle,omitempty"`
	Attributes            map[string]string `json:"attributes,omitempty"`
	SecretData            map[string][]byte `json:"secret_data,omitempty"`
	EncryptionData        map[string][]byte `json:"encryption_data,omitempty"`
	EffectiveStorageBytes int64             `json:"effective_storage_bytes,omitempty"`
}

type VolumeSpec

type VolumeSpec struct {
	Name       string            `json:"name"`
	Device     string            `json:"device"`
	LocalDisk  *LocalDiskSpec    `json:"localDisk,omitempty"`
	Connection *VolumeConnection `json:"cephDisk,omitempty"`
}

type VolumeState

type VolumeState string
const (
	VolumeStatePending  VolumeState = "Pending"
	VolumeStateAttached VolumeState = "Attached"
)

type VolumeStatus

type VolumeStatus struct {
	Name   string      `json:"name,omitempty"`
	Handle string      `json:"handle,omitempty"`
	State  VolumeState `json:"state,omitempty"`
	Size   int64       `json:"size,omitempty"`
}

Jump to

Keyboard shortcuts

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