vm

package
v0.0.0-...-1729eaa Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: AGPL-3.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

View Source
const (
	StateStopped VMState = "STOPPED"
	StateRunning VMState = "RUNNING"

	NicUser NicType = "user"
	NicNone NicType = "none"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NicType

type NicType string // see nicXXX below

type VMAttachCredentialsSerialized

type VMAttachCredentialsSerialized struct {
	ID   uuid.UUID `json:"id"         validate:"required" ts_type:"string"`
	Name string    `json:"name"       validate:"required,min=1,max=256"`
	Pwd  string    `json:"pwd"        validate:"required,min=8,max=64"`
}

type VMDiskSerialized

type VMDiskSerialized struct {
	ID           uuid.UUID                            `json:"id"         validate:"required" ts_type:"string"`
	Owner        string                               `json:"owner"      validate:"required,email"`
	Name         string                               `json:"name"       validate:"required,min=1,max=256"`
	Cpus         int                                  `json:"cpus"       validate:"required,gte=1,lte=32"`
	Ram          int                                  `json:"ram"        validate:"required,gte=128,lte=32768"` // in MB
	Nic          NicType                              `json:"nic"        validate:"required"`
	UsbDevs      []string                             `json:"usbDevs"    validate:"required"`
	TemplateID   uuid.UUID                            `json:"templateID" validate:"required" ts_type:"string"`
	Access       map[string]caps.VMAccessCapabilities `json:"access"`
	CreationTime time.Time                            `json:"creationTime" validate:"required" ts_type:"Date" ts_transform:"new Date(__VALUE__)"`
}

VM fields to be serialized to disk.

type VMNetworkSerialized

type VMNetworkSerialized struct {
	ID           uuid.UUID                            `json:"id"         validate:"required" ts_type:"string"`
	Owner        string                               `json:"owner"      validate:"required,email"`
	Name         string                               `json:"name"       validate:"required,min=1,max=256"`
	Cpus         int                                  `json:"cpus"       validate:"required,gte=1,lte=32"`
	Ram          int                                  `json:"ram"        validate:"required,gte=128,lte=32768"` // in MB
	Nic          NicType                              `json:"nic"        validate:"required"`
	UsbDevs      []string                             `json:"usbDevs"    validate:"required"`
	TemplateID   uuid.UUID                            `json:"templateID" validate:"required" ts_type:"string"`
	Access       map[string]caps.VMAccessCapabilities `json:"access"`
	CreationTime time.Time                            `json:"creationTime" validate:"required" ts_type:"Date" ts_transform:"new Date(__VALUE__)"`

	State     VMState   `json:"state"`
	DiskBusy  bool      `json:"diskBusy"` // When true, the disk image must not be modified
	StartTime time.Time `json:"startTime" type:"Date" ts_transform:"new Date(__VALUE__)"`
}

VM fields to be serialized over the network.

func (*VMNetworkSerialized) String

func (v *VMNetworkSerialized) String() (string, error)

Converts a VMNetworkSerialized structure into a pretty string.

type VMSpiceCredentialsSerialized

type VMSpiceCredentialsSerialized struct {
	Name      string `json:"name"       validate:"required,min=1,max=256"`
	SpicePort int    `json:"spicePort"  validate:"required,gte=1025,lte=65535"`
	SpicePwd  string `json:"spicePwd"   validate:"required,min=16,max=64"`
}

type VMState

type VMState string // see stateXXX below

Source Files

  • vm.go

Jump to

Keyboard shortcuts

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