api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

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

	AnnotationsAnnotation = "cloud-hypervisor-provider.ironcore.dev/annotations"
)
View Source
const (
	ManagerLabel = "cloud-hypervisor-provider.ironcore.dev/manager"
	ClassLabel   = "cloud-hypervisor-provider.ironcore.dev/class"
)
View Source
const (
	MachineManager = "cloud-hypervisor-provider"
)

Variables

This section is empty.

Functions

func GetAnnotationsAnnotation

func GetAnnotationsAnnotation(o apiutils.Metadata) (map[string]string, error)

func GetClassLabel

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

func GetLabelsAnnotation

func GetLabelsAnnotation(o apiutils.Metadata) (map[string]string, error)

func GetObjectMetadata

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

func IsManagedBy

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

func SetAnnotationsAnnotation

func SetAnnotationsAnnotation(o apiutils.Object, annotations map[string]string) error

func SetClassLabel

func SetClassLabel(o apiutils.Object, class string)

func SetLabelsAnnotation

func SetLabelsAnnotation(o apiutils.Object, labels map[string]string) error

func SetManagerLabel

func SetManagerLabel(o apiutils.Object, manager string)

func SetObjectMetadata

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

Types

type EmptyDiskSpec

type EmptyDiskSpec struct {
	Size int64 `json:"size"`
}

type Machine

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

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

type MachineSpec

type MachineSpec struct {
	ApiSocketPath *string `json:"api"`

	Power PowerState `json:"power"`

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

	Image    *string `json:"image"`
	Ignition []byte  `json:"ignition"`

	Volumes           []*VolumeSpec           `json:"volumes"`
	NetworkInterfaces []*NetworkInterfaceSpec `json:"networkInterfaces"`

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

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"`
}

type NetworkInterfaceSpec

type NetworkInterfaceSpec struct {
	Name       string            `json:"name"`
	NetworkId  string            `json:"networkId"`
	Ips        []string          `json:"ips"`
	Attributes map[string]string `json:"attributes"`
	DeletedAt  *time.Time        `json:"deletedAt,omitempty"`
}

type NetworkInterfaceState

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

type NetworkInterfaceStatus

type NetworkInterfaceStatus struct {
	Name   string                `json:"name"`
	Handle string                `json:"handle"`
	State  NetworkInterfaceState `json:"state"`
	Type   NetworkInterfaceType  `json:"type,omitempty"`
	Path   string                `json:"path,omitempty"`
}

type NetworkInterfaceType

type NetworkInterfaceType string
const (
	NetworkInterfacePCIType NetworkInterfaceType = "pci"
	NetworkInterfaceTAPType NetworkInterfaceType = "tap"
)

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"`
}

type VolumeSpec

type VolumeSpec struct {
	Name       string            `json:"name"`
	Device     string            `json:"device"`
	EmptyDisk  *EmptyDiskSpec    `json:"emptyDisk,omitempty"`
	Connection *VolumeConnection `json:"cephDisk,omitempty"`
	DeletedAt  *time.Time        `json:"deletedAt,omitempty"`
}

type VolumeState

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

type VolumeStatus

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

type VolumeType

type VolumeType string
const (
	VolumeSocketType VolumeType = "socket"
	VolumeFileType   VolumeType = "file"
)

Jump to

Keyboard shortcuts

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