Documentation
¶
Index ¶
- Constants
- func GetAnnotationsAnnotation(o Metadata) (map[string]string, error)
- func GetClassLabel(o Object) (string, bool)
- func GetLabelsAnnotation(o Metadata) (map[string]string, error)
- func GetObjectMetadata(o Metadata) (*irimeta.ObjectMetadata, error)
- func IsManagedBy(o Object, manager string) bool
- func SetAnnotationsAnnotation(o Object, annotations map[string]string) error
- func SetClassLabel(o Object, class string)
- func SetLabelsAnnotation(o Object, labels map[string]string) error
- func SetManagerLabel(o Object, manager string)
- func SetObjectMetadata(o Object, metadata *irimeta.ObjectMetadata) error
- type EmptyDiskSpec
- type GuestAgent
- type GuestAgentStatus
- type Machine
- type MachineSpec
- type MachineState
- type MachineStatus
- type Metadata
- func (m *Metadata) GetAnnotations() map[string]string
- func (m *Metadata) GetCreatedAt() time.Time
- func (m *Metadata) GetDeletedAt() *time.Time
- func (m *Metadata) GetFinalizers() []string
- func (m *Metadata) GetGeneration() int64
- func (m *Metadata) GetID() string
- func (m *Metadata) GetLabels() map[string]string
- func (m *Metadata) GetResourceVersion() uint64
- func (m *Metadata) IncrementResourceVersion()
- func (m *Metadata) SetAnnotations(annotations map[string]string)
- func (m *Metadata) SetCreatedAt(createdAt time.Time)
- func (m *Metadata) SetDeletedAt(deleted *time.Time)
- func (m *Metadata) SetFinalizers(finalizers []string)
- func (m *Metadata) SetGeneration(generation int64)
- func (m *Metadata) SetID(id string)
- func (m *Metadata) SetLabels(labels map[string]string)
- type NetworkInterfaceSpec
- type NetworkInterfaceState
- type NetworkInterfaceStatus
- type Object
- type PowerState
- type VolumeConnection
- type VolumeSpec
- type VolumeState
- type VolumeStatus
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"
)
Variables ¶
This section is empty.
Functions ¶
func GetClassLabel ¶
func GetObjectMetadata ¶
func GetObjectMetadata(o Metadata) (*irimeta.ObjectMetadata, error)
func IsManagedBy ¶
func SetClassLabel ¶
func SetManagerLabel ¶
func SetObjectMetadata ¶
func SetObjectMetadata(o Object, metadata *irimeta.ObjectMetadata) error
Types ¶
type EmptyDiskSpec ¶
type EmptyDiskSpec struct {
Size int64 `json:"size"`
}
type GuestAgent ¶
type GuestAgent string
const ( GuestAgentNone GuestAgent = "None" GuestAgentQemu GuestAgent = "Qemu" )
type GuestAgentStatus ¶
type GuestAgentStatus struct {
Addr string `json:"addr,omitempty"`
}
type Machine ¶
type Machine struct {
Metadata `json:"metadata,omitempty"`
Spec MachineSpec `json:"spec"`
Status MachineStatus `json:"status"`
}
type MachineSpec ¶
type MachineSpec struct {
Power PowerState `json:"power"`
CpuMillis 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"`
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 Metadata ¶
type Metadata struct {
ID string `json:"id"`
Annotations map[string]string `json:"annotations"`
Labels map[string]string `json:"labels"`
CreatedAt time.Time `json:"createdAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Generation int64 `json:"generation"`
ResourceVersion uint64 `json:"resourceVersion"`
Finalizers []string `json:"finalizers,omitempty"`
}
func (*Metadata) GetAnnotations ¶
func (*Metadata) GetCreatedAt ¶
func (*Metadata) GetDeletedAt ¶
func (*Metadata) GetFinalizers ¶
func (*Metadata) GetGeneration ¶
func (*Metadata) GetResourceVersion ¶
func (*Metadata) IncrementResourceVersion ¶
func (m *Metadata) IncrementResourceVersion()
func (*Metadata) SetAnnotations ¶
func (*Metadata) SetCreatedAt ¶
func (*Metadata) SetDeletedAt ¶
func (*Metadata) SetFinalizers ¶
func (*Metadata) SetGeneration ¶
type NetworkInterfaceSpec ¶
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 Object ¶
type Object interface {
GetID() string
GetAnnotations() map[string]string
GetLabels() map[string]string
GetCreatedAt() time.Time
GetDeletedAt() *time.Time
GetGeneration() int64
GetFinalizers() []string
GetResourceVersion() uint64
SetID(id string)
SetAnnotations(annotations map[string]string)
SetLabels(labels map[string]string)
SetCreatedAt(createdAt time.Time)
SetDeletedAt(deleted *time.Time)
SetGeneration(generation int64)
SetFinalizers(finalizers []string)
IncrementResourceVersion()
}
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"`
}
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"`
}
Click to show internal directories.
Click to hide internal directories.