vms

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MPL-2.0 Imports: 22 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StorageInterfaces = []string{"ide", "sata", "scsi", "virtio"}

StorageInterfaces is a list of supported storage interfaces.

Functions

This section is empty.

Types

type Client

type Client struct {
	api.Client
	VMID int
}

Client is an interface for accessing the Proxmox VM API.

func (*Client) CloneVM

func (c *Client) CloneVM(ctx context.Context, retries int, d *CloneRequestBody) error

CloneVM clones a virtual machine.

func (*Client) CreateVM

func (c *Client) CreateVM(ctx context.Context, d *CreateRequestBody) error

CreateVM creates a virtual machine.

func (*Client) CreateVMAsync

func (c *Client) CreateVMAsync(ctx context.Context, d *CreateRequestBody) (*string, error)

CreateVMAsync creates a virtual machine asynchronously. Returns ID of the started task.

func (*Client) DeleteVM

func (c *Client) DeleteVM(ctx context.Context) error

DeleteVM creates a virtual machine.

func (*Client) DeleteVMAsync added in v0.54.0

func (c *Client) DeleteVMAsync(ctx context.Context) (*string, error)

DeleteVMAsync deletes a virtual machine asynchronously. Returns ID of the started task.

func (*Client) ExpandPath

func (c *Client) ExpandPath(path string) string

ExpandPath expands a relative path to a full VM API path.

func (*Client) Firewall

func (c *Client) Firewall() firewall.API

Firewall returns a client for managing the VM firewall.

func (*Client) GetVM

func (c *Client) GetVM(ctx context.Context) (*GetResponseData, error)

GetVM retrieves a virtual machine.

func (*Client) GetVMNetworkInterfacesFromAgent

func (c *Client) GetVMNetworkInterfacesFromAgent(ctx context.Context) (*GetQEMUNetworkInterfacesResponseData, error)

GetVMNetworkInterfacesFromAgent retrieves the network interfaces reported by the QEMU agent.

func (*Client) GetVMStatus

func (c *Client) GetVMStatus(ctx context.Context) (*GetStatusResponseData, error)

GetVMStatus retrieves the status for a virtual machine.

func (*Client) ListVMs

func (c *Client) ListVMs(ctx context.Context) ([]*ListResponseData, error)

ListVMs retrieves a list of virtual machines.

func (*Client) MigrateVM

func (c *Client) MigrateVM(ctx context.Context, d *MigrateRequestBody) error

MigrateVM migrates a virtual machine.

func (*Client) MigrateVMAsync

func (c *Client) MigrateVMAsync(ctx context.Context, d *MigrateRequestBody) (*string, error)

MigrateVMAsync migrates a virtual machine asynchronously.

func (*Client) MoveVMDisk

func (c *Client) MoveVMDisk(ctx context.Context, d *MoveDiskRequestBody) error

MoveVMDisk moves a virtual machine disk.

func (*Client) MoveVMDiskAsync

func (c *Client) MoveVMDiskAsync(ctx context.Context, d *MoveDiskRequestBody) (*string, error)

MoveVMDiskAsync moves a virtual machine disk asynchronously.

func (*Client) RebootVM

func (c *Client) RebootVM(ctx context.Context, d *RebootRequestBody) error

RebootVM reboots a virtual machine.

func (*Client) RebootVMAsync

func (c *Client) RebootVMAsync(ctx context.Context, d *RebootRequestBody) (*string, error)

RebootVMAsync reboots a virtual machine asynchronously.

func (*Client) ResizeVMDisk

func (c *Client) ResizeVMDisk(ctx context.Context, d *ResizeDiskRequestBody) error

ResizeVMDisk resizes a virtual machine disk.

func (*Client) ResizeVMDiskAsync added in v0.46.5

func (c *Client) ResizeVMDiskAsync(ctx context.Context, d *ResizeDiskRequestBody) (*string, error)

ResizeVMDiskAsync resizes a virtual machine disk asynchronously.

func (*Client) ShutdownVM

func (c *Client) ShutdownVM(ctx context.Context, d *ShutdownRequestBody) error

ShutdownVM shuts down a virtual machine.

func (*Client) ShutdownVMAsync

func (c *Client) ShutdownVMAsync(ctx context.Context, d *ShutdownRequestBody) (*string, error)

ShutdownVMAsync shuts down a virtual machine asynchronously.

func (*Client) StartVM

func (c *Client) StartVM(ctx context.Context, timeoutSec int) ([]string, error)

StartVM starts a virtual machine. Returns the task log if the VM had warnings at startup, or fails to start.

func (*Client) StartVMAsync

func (c *Client) StartVMAsync(ctx context.Context, timeoutSec int) (*string, error)

StartVMAsync starts a virtual machine asynchronously.

func (*Client) StopVM

func (c *Client) StopVM(ctx context.Context) error

StopVM stops a virtual machine.

func (*Client) StopVMAsync

func (c *Client) StopVMAsync(ctx context.Context) (*string, error)

StopVMAsync stops a virtual machine asynchronously.

func (*Client) Tasks

func (c *Client) Tasks() *tasks.Client

Tasks returns a client for managing VM tasks.

func (*Client) UpdateVM

func (c *Client) UpdateVM(ctx context.Context, d *UpdateRequestBody) error

UpdateVM updates a virtual machine.

func (*Client) UpdateVMAsync

func (c *Client) UpdateVMAsync(ctx context.Context, d *UpdateRequestBody) (*string, error)

UpdateVMAsync updates a virtual machine asynchronously.

func (*Client) WaitForNetworkInterfacesFromVMAgent

func (c *Client) WaitForNetworkInterfacesFromVMAgent(
	ctx context.Context,
	timeout int,
	delay int,
	waitForIP bool,
) (*GetQEMUNetworkInterfacesResponseData, error)

WaitForNetworkInterfacesFromVMAgent waits for a virtual machine's QEMU agent to publish the network interfaces.

func (*Client) WaitForVMConfigUnlock

func (c *Client) WaitForVMConfigUnlock(ctx context.Context, ignoreErrorResponse bool) error

WaitForVMConfigUnlock waits for a virtual machine configuration to become unlocked.

func (*Client) WaitForVMStatus added in v0.46.5

func (c *Client) WaitForVMStatus(ctx context.Context, status string) error

WaitForVMStatus waits for a virtual machine to reach a specific status.

type CloneRequestBody

type CloneRequestBody struct {
	BandwidthLimit      *int              `json:"bwlimit,omitempty"     url:"bwlimit,omitempty"`
	Description         *string           `json:"description,omitempty" url:"description,omitempty"`
	FullCopy            *types.CustomBool `json:"full,omitempty"        url:"full,omitempty,int"`
	Name                *string           `json:"name,omitempty"        url:"name,omitempty"`
	PoolID              *string           `json:"pool,omitempty"        url:"pool,omitempty"`
	SnapshotName        *string           `json:"snapname,omitempty"    url:"snapname,omitempty"`
	TargetNodeName      *string           `json:"target,omitempty"      url:"target,omitempty"`
	TargetStorage       *string           `json:"storage,omitempty"     url:"storage,omitempty"`
	TargetStorageFormat *string           `json:"format,omitempty"      url:"format,omitempty"`
	VMIDNew             int               `json:"newid"                 url:"newid"`
}

CloneRequestBody contains the data for an virtual machine clone request.

type CreateRequestBody

type CreateRequestBody struct {
	ACPI                 *types.CustomBool              `json:"acpi,omitempty"               url:"acpi,omitempty,int"`
	Agent                *CustomAgent                   `json:"agent,omitempty"              url:"agent,omitempty"`
	AllowReboot          *types.CustomBool              `json:"reboot,omitempty"             url:"reboot,omitempty,int"`
	AudioDevices         CustomAudioDevices             `json:"audio,omitempty"              url:"audio,omitempty"`
	Autostart            *types.CustomBool              `json:"autostart,omitempty"          url:"autostart,omitempty,int"`
	BackupFile           *string                        `json:"archive,omitempty"            url:"archive,omitempty"`
	BandwidthLimit       *int                           `json:"bwlimit,omitempty"            url:"bwlimit,omitempty"`
	BIOS                 *string                        `json:"bios,omitempty"               url:"bios,omitempty"`
	Boot                 *CustomBoot                    `json:"boot,omitempty"               url:"boot,omitempty"`
	CDROM                *string                        `json:"cdrom,omitempty"              url:"cdrom,omitempty"`
	CloudInitConfig      *CustomCloudInitConfig         `json:"cloudinit,omitempty"          url:"cloudinit,omitempty"`
	CPUArchitecture      *string                        `json:"arch,omitempty"               url:"arch,omitempty"`
	CPUCores             *int64                         `json:"cores,omitempty"              url:"cores,omitempty"`
	CPUEmulation         *CustomCPUEmulation            `json:"cpu,omitempty"                url:"cpu,omitempty"`
	CPULimit             *int64                         `json:"cpulimit,omitempty"           url:"cpulimit,omitempty"`
	CPUSockets           *int64                         `json:"sockets,omitempty"            url:"sockets,omitempty"`
	CPUUnits             *int64                         `json:"cpuunits,omitempty"           url:"cpuunits,omitempty"`
	CPUAffinity          *string                        `json:"affinity,omitempty"           url:"affinity,omitempty"`
	DedicatedMemory      *int                           `json:"memory,omitempty"             url:"memory,omitempty"`
	Delete               []string                       `json:"delete,omitempty"             url:"delete,omitempty,comma"`
	DeletionProtection   *types.CustomBool              `json:"protection,omitempty"         url:"protection,omitempty,int"`
	Description          *string                        `json:"description,omitempty"        url:"description,omitempty"`
	EFIDisk              *CustomEFIDisk                 `json:"efidisk0,omitempty"           url:"efidisk0,omitempty"`
	FloatingMemory       *int                           `json:"balloon,omitempty"            url:"balloon,omitempty"`
	FloatingMemoryShares *int                           `json:"shares,omitempty"             url:"shares,omitempty"`
	Freeze               *types.CustomBool              `json:"freeze,omitempty"             url:"freeze,omitempty,int"`
	HookScript           *string                        `json:"hookscript,omitempty"         url:"hookscript,omitempty"`
	Hotplug              types.CustomCommaSeparatedList `json:"hotplug,omitempty"            url:"hotplug,omitempty,comma"`
	Hugepages            *string                        `json:"hugepages,omitempty"          url:"hugepages,omitempty"`
	KeepHugepages        *types.CustomBool              `json:"keephugepages,omitempty"      url:"keephugepages,omitempty,int"`
	KeyboardLayout       *string                        `json:"keyboard,omitempty"           url:"keyboard,omitempty"`
	KVMArguments         *string                        `json:"args,omitempty"               url:"args,omitempty,space"`
	KVMEnabled           *types.CustomBool              `json:"kvm,omitempty"                url:"kvm,omitempty,int"`
	LocalTime            *types.CustomBool              `json:"localtime,omitempty"          url:"localtime,omitempty,int"`
	Lock                 *string                        `json:"lock,omitempty"               url:"lock,omitempty"`
	Machine              *string                        `json:"machine,omitempty"            url:"machine,omitempty"`
	MigrateDowntime      *float64                       `json:"migrate_downtime,omitempty"   url:"migrate_downtime,omitempty"`
	MigrateSpeed         *int                           `json:"migrate_speed,omitempty"      url:"migrate_speed,omitempty"`
	Name                 *string                        `json:"name,omitempty"               url:"name,omitempty"`
	NetworkDevices       CustomNetworkDevices           `json:"net,omitempty"                url:"net,omitempty"`
	NUMADevices          CustomNUMADevices              `json:"numa_devices,omitempty"       url:"numa,omitempty"`
	NUMAEnabled          *types.CustomBool              `json:"numa,omitempty"               url:"numa,omitempty,int"`
	OSType               *string                        `json:"ostype,omitempty"             url:"ostype,omitempty"`
	Overwrite            *types.CustomBool              `json:"force,omitempty"              url:"force,omitempty,int"`
	PCIDevices           CustomPCIDevices               `json:"hostpci,omitempty"            url:"hostpci,omitempty"`
	PoolID               *string                        `json:"pool,omitempty"               url:"pool,omitempty"`
	Revert               *string                        `json:"revert,omitempty"             url:"revert,omitempty"`
	SCSIHardware         *string                        `json:"scsihw,omitempty"             url:"scsihw,omitempty"`
	SerialDevices        CustomSerialDevices            `json:"serial,omitempty"             url:"serial,omitempty"`
	SharedMemory         *CustomSharedMemory            `json:"ivshmem,omitempty"            url:"ivshmem,omitempty"`
	SkipLock             *types.CustomBool              `json:"skiplock,omitempty"           url:"skiplock,omitempty,int"`
	SMBIOS               *CustomSMBIOS                  `json:"smbios1,omitempty"            url:"smbios1,omitempty"`
	SpiceEnhancements    *CustomSpiceEnhancements       `json:"spice_enhancements,omitempty" url:"spice_enhancements,omitempty"`
	StartDate            *string                        `json:"startdate,omitempty"          url:"startdate,omitempty"`
	StartOnBoot          *types.CustomBool              `json:"onboot,omitempty"             url:"onboot,omitempty,int"`
	StartupOrder         *CustomStartupOrder            `json:"startup,omitempty"            url:"startup,omitempty"`
	TabletDeviceEnabled  *types.CustomBool              `json:"tablet,omitempty"             url:"tablet,omitempty,int"`
	Tags                 *string                        `json:"tags,omitempty"               url:"tags,omitempty"`
	Template             *types.CustomBool              `json:"template,omitempty"           url:"template,omitempty,int"`
	TimeDriftFixEnabled  *types.CustomBool              `json:"tdf,omitempty"                url:"tdf,omitempty,int"`
	TPMState             *CustomTPMState                `json:"tpmstate0,omitempty"          url:"tpmstate0,omitempty"`
	USBDevices           CustomUSBDevices               `json:"usb,omitempty"                url:"usb,omitempty"`
	VGADevice            *CustomVGADevice               `json:"vga,omitempty"                url:"vga,omitempty"`
	VirtualCPUCount      *int64                         `json:"vcpus,omitempty"              url:"vcpus,omitempty"`
	VMGenerationID       *string                        `json:"vmgenid,omitempty"            url:"vmgenid,omitempty"`
	VMID                 int                            `json:"vmid,omitempty"               url:"vmid,omitempty"`
	VMStateDatastoreID   *string                        `json:"vmstatestorage,omitempty"     url:"vmstatestorage,omitempty"`
	WatchdogDevice       *CustomWatchdogDevice          `json:"watchdog,omitempty"           url:"watchdog,omitempty"`
	CustomStorageDevices CustomStorageDevices           `json:"-"`
}

CreateRequestBody contains the data for a virtual machine create request.

func (*CreateRequestBody) AddCustomStorageDevice added in v0.59.1

func (b *CreateRequestBody) AddCustomStorageDevice(iface string, device CustomStorageDevice)

AddCustomStorageDevice adds a custom storage device to the create request body.

type CreateResponseBody

type CreateResponseBody struct {
	TaskID *string `json:"data,omitempty"`
}

CreateResponseBody contains the body from a create response.

type CustomAgent

type CustomAgent struct {
	Enabled         *types.CustomBool `json:"enabled,omitempty"   url:"enabled,int"`
	TrimClonedDisks *types.CustomBool `json:"fstrim_cloned_disks" url:"fstrim_cloned_disks,int"`
	Type            *string           `json:"type"                url:"type"`
}

CustomAgent handles QEMU agent parameters.

func (*CustomAgent) EncodeValues

func (r *CustomAgent) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomAgent struct to a URL value.

func (*CustomAgent) UnmarshalJSON

func (r *CustomAgent) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomAgent string to an object.

type CustomAudioDevice

type CustomAudioDevice struct {
	Device  string  `json:"device" url:"device"`
	Driver  *string `json:"driver" url:"driver"`
	Enabled bool    `json:"-"      url:"-"`
}

CustomAudioDevice handles QEMU audio parameters.

func (*CustomAudioDevice) EncodeValues

func (r *CustomAudioDevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomAudioDevice struct to a URL value.

func (*CustomAudioDevice) UnmarshalJSON

func (r *CustomAudioDevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomAudioDevice string to an object.

type CustomAudioDevices

type CustomAudioDevices []CustomAudioDevice

CustomAudioDevices handles QEMU audio device parameters.

func (CustomAudioDevices) EncodeValues

func (r CustomAudioDevices) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomAudioDevices array to multiple URL values.

type CustomBoot

type CustomBoot struct {
	Order *[]string `json:"order,omitempty" url:"order,omitempty,semicolon"`
}

CustomBoot handles QEMU boot parameters.

func (*CustomBoot) EncodeValues

func (r *CustomBoot) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomBoot struct to multiple URL values.

func (*CustomBoot) UnmarshalJSON

func (r *CustomBoot) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomBoot string to an object.

type CustomCPUEmulation

type CustomCPUEmulation struct {
	Flags      *[]string         `json:"flags,omitempty"        url:"flags,omitempty,semicolon"`
	Hidden     *types.CustomBool `json:"hidden,omitempty"       url:"hidden,omitempty,int"`
	HVVendorID *string           `json:"hv-vendor-id,omitempty" url:"hv-vendor-id,omitempty"`
	Type       string            `json:"cputype,omitempty"      url:"cputype,omitempty"`
}

CustomCPUEmulation handles QEMU CPU emulation parameters.

func (*CustomCPUEmulation) EncodeValues

func (r *CustomCPUEmulation) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomCPUEmulation struct to a URL value.

func (*CustomCPUEmulation) UnmarshalJSON

func (r *CustomCPUEmulation) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomCPUEmulation string to an object.

type CustomCloudInitConfig

type CustomCloudInitConfig struct {
	Files        *CustomCloudInitFiles     `json:"cicustom,omitempty"     url:"cicustom,omitempty"`
	IPConfig     []CustomCloudInitIPConfig `json:"ipconfig,omitempty"     url:"ipconfig,omitempty,numbered"`
	Nameserver   *string                   `json:"nameserver,omitempty"   url:"nameserver,omitempty"`
	Password     *string                   `json:"cipassword,omitempty"   url:"cipassword,omitempty"`
	SearchDomain *string                   `json:"searchdomain,omitempty" url:"searchdomain,omitempty"`
	SSHKeys      *CustomCloudInitSSHKeys   `json:"sshkeys,omitempty"      url:"sshkeys,omitempty"`
	Type         *string                   `json:"citype,omitempty"       url:"citype,omitempty"`
	// Can't be reliably set, it is TRUE by default in PVE
	// Upgrade      *types.CustomBool         `json:"ciupgrade,omitempty"    url:"ciupgrade,omitempty,int"`
	Username *string `json:"ciuser,omitempty" url:"ciuser,omitempty"`
}

CustomCloudInitConfig handles QEMU cloud-init parameters.

func (CustomCloudInitConfig) EncodeValues

func (r CustomCloudInitConfig) EncodeValues(_ string, v *url.Values) error

EncodeValues converts a CustomCloudInitConfig struct to multiple URL values.

type CustomCloudInitFiles

type CustomCloudInitFiles struct {
	MetaVolume    *string `json:"meta,omitempty"    url:"meta,omitempty"`
	NetworkVolume *string `json:"network,omitempty" url:"network,omitempty"`
	UserVolume    *string `json:"user,omitempty"    url:"user,omitempty"`
	VendorVolume  *string `json:"vendor,omitempty"  url:"vendor,omitempty"`
}

CustomCloudInitFiles handles QEMU cloud-init custom files parameters.

func (*CustomCloudInitFiles) UnmarshalJSON

func (r *CustomCloudInitFiles) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomCloudInitFiles string to an object.

type CustomCloudInitIPConfig

type CustomCloudInitIPConfig struct {
	GatewayIPv4 *string `json:"gw,omitempty"  url:"gw,omitempty"`
	GatewayIPv6 *string `json:"gw6,omitempty" url:"gw6,omitempty"`
	IPv4        *string `json:"ip,omitempty"  url:"ip,omitempty"`
	IPv6        *string `json:"ip6,omitempty" url:"ip6,omitempty"`
}

CustomCloudInitIPConfig handles QEMU cloud-init IP configuration parameters.

func (*CustomCloudInitIPConfig) UnmarshalJSON

func (r *CustomCloudInitIPConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomCloudInitIPConfig string to an object.

type CustomCloudInitSSHKeys

type CustomCloudInitSSHKeys []string

CustomCloudInitSSHKeys handles QEMU cloud-init SSH keys parameters.

func (*CustomCloudInitSSHKeys) UnmarshalJSON

func (r *CustomCloudInitSSHKeys) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomCloudInitFiles string to an object.

type CustomEFIDisk

type CustomEFIDisk struct {
	FileVolume      string            `json:"file"                        url:"file"`
	Format          *string           `json:"format,omitempty"            url:"format,omitempty"`
	Type            *string           `json:"efitype,omitempty"           url:"efitype,omitempty"`
	PreEnrolledKeys *types.CustomBool `json:"pre-enrolled-keys,omitempty" url:"pre-enrolled-keys,omitempty,int"`
}

CustomEFIDisk handles QEMU EFI disk parameters.

func (*CustomEFIDisk) EncodeValues

func (r *CustomEFIDisk) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomEFIDisk struct to a URL value.

func (*CustomEFIDisk) UnmarshalJSON

func (r *CustomEFIDisk) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomEFIDisk string to an object.

type CustomNUMADevice

type CustomNUMADevice struct {
	CPUIDs        []string  `json:"cpus"                url:"cpus,semicolon"`
	HostNodeNames *[]string `json:"hostnodes,omitempty" url:"hostnodes,omitempty,semicolon"`
	Memory        *int      `json:"memory,omitempty"    url:"memory,omitempty"`
	Policy        *string   `json:"policy,omitempty"    url:"policy,omitempty"`
}

CustomNUMADevice handles QEMU NUMA device parameters.

func (*CustomNUMADevice) EncodeValues

func (r *CustomNUMADevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomNUMADevice struct to a URL value.

func (*CustomNUMADevice) UnmarshalJSON added in v0.52.0

func (r *CustomNUMADevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomNUMADevice string to an object.

type CustomNUMADevices

type CustomNUMADevices []CustomNUMADevice

CustomNUMADevices handles QEMU NUMA device parameters.

func (CustomNUMADevices) EncodeValues

func (r CustomNUMADevices) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomNUMADevices array to multiple URL values.

type CustomNetworkDevice

type CustomNetworkDevice struct {
	Enabled    bool              `json:"-"                   url:"-"`
	Bridge     *string           `json:"bridge,omitempty"    url:"bridge,omitempty"`
	Firewall   *types.CustomBool `json:"firewall,omitempty"  url:"firewall,omitempty,int"`
	LinkDown   *types.CustomBool `json:"link_down,omitempty" url:"link_down,omitempty,int"`
	MACAddress *string           `json:"macaddr,omitempty"   url:"macaddr,omitempty"`
	MTU        *int              `json:"mtu,omitempty"       url:"mtu,omitempty"`
	Model      string            `json:"model"               url:"model"`
	Queues     *int              `json:"queues,omitempty"    url:"queues,omitempty"`
	RateLimit  *float64          `json:"rate,omitempty"      url:"rate,omitempty"`
	Tag        *int              `json:"tag,omitempty"       url:"tag,omitempty"`
	Trunks     []int             `json:"trunks,omitempty"    url:"trunks,omitempty"`
}

CustomNetworkDevice handles QEMU network device parameters.

func (*CustomNetworkDevice) EncodeValues

func (r *CustomNetworkDevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomNetworkDevice struct to a URL value.

func (*CustomNetworkDevice) UnmarshalJSON

func (r *CustomNetworkDevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomNetworkDevice string to an object.

type CustomNetworkDevices

type CustomNetworkDevices []CustomNetworkDevice

CustomNetworkDevices handles QEMU network device parameters.

func (CustomNetworkDevices) EncodeValues

func (r CustomNetworkDevices) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomNetworkDevices array to multiple URL values.

type CustomPCIDevice

type CustomPCIDevice struct {
	DeviceIDs  *[]string         `json:"host,omitempty"    url:"host,omitempty,semicolon"`
	Mapping    *string           `json:"mapping,omitempty" url:"mapping,omitempty"`
	MDev       *string           `json:"mdev,omitempty"    url:"mdev,omitempty"`
	PCIExpress *types.CustomBool `json:"pcie,omitempty"    url:"pcie,omitempty,int"`
	ROMBAR     *types.CustomBool `json:"rombar,omitempty"  url:"rombar,omitempty,int"`
	ROMFile    *string           `json:"romfile,omitempty" url:"romfile,omitempty"`
	XVGA       *types.CustomBool `json:"x-vga,omitempty"   url:"x-vga,omitempty,int"`
}

CustomPCIDevice handles QEMU host PCI device mapping parameters.

func (*CustomPCIDevice) EncodeValues

func (d *CustomPCIDevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomPCIDevice struct to a URL value.

func (*CustomPCIDevice) UnmarshalJSON

func (d *CustomPCIDevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomPCIDevice string to an object.

type CustomPCIDevices

type CustomPCIDevices map[string]*CustomPCIDevice

CustomPCIDevices handles QEMU host PCI device mapping parameters.

func (CustomPCIDevices) EncodeValues

func (r CustomPCIDevices) EncodeValues(_ string, v *url.Values) error

EncodeValues converts a CustomPCIDevices array to multiple URL values.

type CustomSMBIOS

type CustomSMBIOS struct {
	Base64       *types.CustomBool `json:"base64,omitempty"       url:"base64,omitempty,int"`
	Family       *string           `json:"family,omitempty"       url:"family,omitempty"`
	Manufacturer *string           `json:"manufacturer,omitempty" url:"manufacturer,omitempty"`
	Product      *string           `json:"product,omitempty"      url:"product,omitempty"`
	Serial       *string           `json:"serial,omitempty"       url:"serial,omitempty"`
	SKU          *string           `json:"sku,omitempty"          url:"sku,omitempty"`
	UUID         *string           `json:"uuid,omitempty"         url:"uuid,omitempty"`
	Version      *string           `json:"version,omitempty"      url:"version,omitempty"`
}

CustomSMBIOS handles QEMU SMBIOS parameters.

func (*CustomSMBIOS) EncodeValues

func (r *CustomSMBIOS) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomSMBIOS struct to a URL value.

func (*CustomSMBIOS) UnmarshalJSON

func (r *CustomSMBIOS) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomSMBIOS string to an object.

type CustomSerialDevices

type CustomSerialDevices []string

CustomSerialDevices handles QEMU serial device parameters.

func (CustomSerialDevices) EncodeValues

func (r CustomSerialDevices) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomSerialDevices array to multiple URL values.

type CustomSharedMemory

type CustomSharedMemory struct {
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	Size int     `json:"size"           url:"size"`
}

CustomSharedMemory handles QEMU Inter-VM shared memory parameters.

func (*CustomSharedMemory) EncodeValues

func (r *CustomSharedMemory) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomSharedMemory struct to a URL value.

func (*CustomSharedMemory) UnmarshalJSON

func (r *CustomSharedMemory) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomSharedMemory string to an object.

type CustomSpiceEnhancements

type CustomSpiceEnhancements struct {
	FolderSharing  *types.CustomBool `json:"foldersharing,omitempty"  url:"foldersharing,omitempty"`
	VideoStreaming *string           `json:"videostreaming,omitempty" url:"videostreaming,omitempty"`
}

CustomSpiceEnhancements handles QEMU spice enhancement parameters.

func (*CustomSpiceEnhancements) EncodeValues

func (r *CustomSpiceEnhancements) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomSpiceEnhancements struct to a URL value.

func (*CustomSpiceEnhancements) UnmarshalJSON added in v0.59.1

func (r *CustomSpiceEnhancements) UnmarshalJSON(b []byte) error

UnmarshalJSON converts JSON to a CustomSpiceEnhancements struct.

type CustomStartupOrder

type CustomStartupOrder struct {
	Down  *int `json:"down,omitempty"  url:"down,omitempty"`
	Order *int `json:"order,omitempty" url:"order,omitempty"`
	Up    *int `json:"up,omitempty"    url:"up,omitempty"`
}

CustomStartupOrder handles QEMU startup order parameters.

func (*CustomStartupOrder) EncodeValues

func (r *CustomStartupOrder) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomStartupOrder struct to a URL value.

func (*CustomStartupOrder) UnmarshalJSON added in v0.24.1

func (r *CustomStartupOrder) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomStartupOrder string to an object.

type CustomStorageDevice

type CustomStorageDevice struct {
	AIO                     *string           `json:"aio,omitempty"         url:"aio,omitempty"`
	Backup                  *types.CustomBool `json:"backup,omitempty"      url:"backup,omitempty,int"`
	BurstableReadSpeedMbps  *int              `json:"mbps_rd_max,omitempty" url:"mbps_rd_max,omitempty"`
	BurstableWriteSpeedMbps *int              `json:"mbps_wr_max,omitempty" url:"mbps_wr_max,omitempty"`
	Cache                   *string           `json:"cache,omitempty"       url:"cache,omitempty"`
	Discard                 *string           `json:"discard,omitempty"     url:"discard,omitempty"`
	FileVolume              string            `json:"file"                  url:"file"`
	Format                  *string           `json:"format,omitempty"      url:"format,omitempty"`
	IopsRead                *int              `json:"iops_rd,omitempty"     url:"iops_rd,omitempty"`
	IopsWrite               *int              `json:"iops_wr,omitempty"     url:"iops_wr,omitempty"`
	IOThread                *types.CustomBool `json:"iothread,omitempty"    url:"iothread,omitempty,int"`
	MaxIopsRead             *int              `json:"iops_rd_max,omitempty" url:"iops_rd_max,omitempty"`
	MaxIopsWrite            *int              `json:"iops_wr_max,omitempty" url:"iops_wr_max,omitempty"`
	MaxReadSpeedMbps        *int              `json:"mbps_rd,omitempty"     url:"mbps_rd,omitempty"`
	MaxWriteSpeedMbps       *int              `json:"mbps_wr,omitempty"     url:"mbps_wr,omitempty"`
	Media                   *string           `json:"media,omitempty"       url:"media,omitempty"`
	Replicate               *types.CustomBool `json:"replicate,omitempty"   url:"replicate,omitempty,int"`
	Serial                  *string           `json:"serial,omitempty"      url:"serial,omitempty"`
	Size                    *types.DiskSize   `json:"size,omitempty"        url:"size,omitempty"`
	SSD                     *types.CustomBool `json:"ssd,omitempty"         url:"ssd,omitempty,int"`
	DatastoreID             *string           `json:"-"                     url:"-"`
	Enabled                 bool              `json:"-"                     url:"-"`
	FileID                  *string           `json:"-"                     url:"-"`
}

CustomStorageDevice handles QEMU SATA device parameters.

func (*CustomStorageDevice) EncodeOptions added in v0.46.5

func (d *CustomStorageDevice) EncodeOptions() string

EncodeOptions converts a CustomStorageDevice's common options a URL value.

func (*CustomStorageDevice) EncodeValues

func (d *CustomStorageDevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomStorageDevice struct to a URL value.

func (*CustomStorageDevice) IsCloudInitDrive added in v0.41.0

func (d *CustomStorageDevice) IsCloudInitDrive(vmID int) bool

IsCloudInitDrive returns true, if CustomStorageDevice is a cloud-init drive.

func (*CustomStorageDevice) IsOwnedBy added in v0.35.0

func (d *CustomStorageDevice) IsOwnedBy(vmID int) bool

IsOwnedBy returns true, if CustomStorageDevice is owned by given VM. Not yet allocated volumes are not owned by any VM.

func (*CustomStorageDevice) PathInDatastore added in v0.35.0

func (d *CustomStorageDevice) PathInDatastore() *string

PathInDatastore returns path part of FileVolume or nil if it is not yet allocated.

func (*CustomStorageDevice) UnmarshalJSON

func (d *CustomStorageDevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomStorageDevice string to an object.

type CustomStorageDevices

type CustomStorageDevices map[string]*CustomStorageDevice

CustomStorageDevices handles map of QEMU storage device per disk interface.

func (CustomStorageDevices) EncodeValues

func (d CustomStorageDevices) EncodeValues(_ string, v *url.Values) error

EncodeValues converts a CustomStorageDevices array to multiple URL values.

func (CustomStorageDevices) Filter added in v0.59.1

Filter returns a map of CustomStorageDevices filtered by the given function.

type CustomTPMState added in v0.40.0

type CustomTPMState struct {
	FileVolume string  `json:"file"              url:"file"`
	Version    *string `json:"version,omitempty" url:"version,omitempty"`
}

CustomTPMState handles QEMU TPM state parameters.

func (*CustomTPMState) EncodeValues added in v0.40.0

func (r *CustomTPMState) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomTPMState struct to a URL value.

func (*CustomTPMState) UnmarshalJSON added in v0.40.0

func (r *CustomTPMState) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomTPMState string to an object.

type CustomUSBDevice

type CustomUSBDevice struct {
	HostDevice *string           `json:"host"              url:"host"`
	Mapping    *string           `json:"mapping,omitempty" url:"mapping,omitempty"`
	USB3       *types.CustomBool `json:"usb3,omitempty"    url:"usb3,omitempty,int"`
}

CustomUSBDevice handles QEMU USB device parameters.

func (*CustomUSBDevice) EncodeValues

func (r *CustomUSBDevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomUSBDevice struct to a URL value.

func (*CustomUSBDevice) UnmarshalJSON added in v0.37.0

func (r *CustomUSBDevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomUSBDevice string to an object.

type CustomUSBDevices

type CustomUSBDevices []CustomUSBDevice

CustomUSBDevices handles QEMU USB device parameters.

func (CustomUSBDevices) EncodeValues

func (r CustomUSBDevices) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomUSBDevices array to multiple URL values.

type CustomVGADevice

type CustomVGADevice struct {
	Clipboard *string `json:"clipboard,omitempty" url:"memory,omitempty"`
	Memory    *int64  `json:"memory,omitempty"    url:"memory,omitempty"`
	Type      *string `json:"type,omitempty"      url:"type,omitempty"`
}

CustomVGADevice handles QEMU VGA device parameters.

func (*CustomVGADevice) EncodeValues

func (r *CustomVGADevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomVGADevice struct to a URL value.

func (*CustomVGADevice) UnmarshalJSON

func (r *CustomVGADevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomVGADevice string to an object.

type CustomVirtualIODevice

type CustomVirtualIODevice struct {
	AIO           *string           `json:"aio,omitempty"    url:"aio,omitempty"`
	BackupEnabled *types.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"`
	Enabled       bool              `json:"-"                url:"-"`
	FileVolume    string            `json:"file"             url:"file"`
}

CustomVirtualIODevice handles QEMU VirtIO device parameters.

func (CustomVirtualIODevice) EncodeValues

func (r CustomVirtualIODevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomVirtualIODevice struct to a URL value.

type CustomVirtualIODevices

type CustomVirtualIODevices []CustomVirtualIODevice

CustomVirtualIODevices handles QEMU VirtIO device parameters.

func (CustomVirtualIODevices) EncodeValues

func (r CustomVirtualIODevices) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomVirtualIODevices array to multiple URL values.

type CustomWatchdogDevice

type CustomWatchdogDevice struct {
	Action *string `json:"action,omitempty" url:"action,omitempty"`
	Model  *string `json:"model"            url:"model"`
}

CustomWatchdogDevice handles QEMU watchdog device parameters.

func (*CustomWatchdogDevice) EncodeValues

func (r *CustomWatchdogDevice) EncodeValues(key string, v *url.Values) error

EncodeValues converts a CustomWatchdogDevice struct to a URL value.

func (*CustomWatchdogDevice) UnmarshalJSON

func (r *CustomWatchdogDevice) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a CustomWatchdogDevice string to an object.

type DeleteResponseBody added in v0.54.0

type DeleteResponseBody struct {
	TaskID *string `json:"data,omitempty"`
}

DeleteResponseBody contains the body from a delete response.

type GetQEMUNetworkInterfacesResponseBody

type GetQEMUNetworkInterfacesResponseBody struct {
	Data *GetQEMUNetworkInterfacesResponseData `json:"data,omitempty"`
}

GetQEMUNetworkInterfacesResponseBody contains the body from a QEMU get network interfaces response.

type GetQEMUNetworkInterfacesResponseData

type GetQEMUNetworkInterfacesResponseData struct {
	Result *[]GetQEMUNetworkInterfacesResponseResult `json:"result,omitempty"`
}

GetQEMUNetworkInterfacesResponseData contains the data from a QEMU get network interfaces response.

type GetQEMUNetworkInterfacesResponseResult

type GetQEMUNetworkInterfacesResponseResult struct {
	MACAddress  string                                             `json:"hardware-address"`
	Name        string                                             `json:"name"`
	Statistics  *GetQEMUNetworkInterfacesResponseResultStatistics  `json:"statistics,omitempty"`
	IPAddresses *[]GetQEMUNetworkInterfacesResponseResultIPAddress `json:"ip-addresses,omitempty"`
}

GetQEMUNetworkInterfacesResponseResult contains the result from a QEMU get network interfaces response.

type GetQEMUNetworkInterfacesResponseResultIPAddress

type GetQEMUNetworkInterfacesResponseResultIPAddress struct {
	Address string `json:"ip-address"`
	Prefix  int    `json:"prefix"`
	Type    string `json:"ip-address-type"`
}

GetQEMUNetworkInterfacesResponseResultIPAddress contains the IP address from a QEMU get network interfaces response.

type GetQEMUNetworkInterfacesResponseResultStatistics

type GetQEMUNetworkInterfacesResponseResultStatistics struct {
	RXBytes   int `json:"rx-bytes"`
	RXDropped int `json:"rx-dropped"`
	RXErrors  int `json:"rx-errs"`
	RXPackets int `json:"rx-packets"`
	TXBytes   int `json:"tx-bytes"`
	TXDropped int `json:"tx-dropped"`
	TXErrors  int `json:"tx-errs"`
	TXPackets int `json:"tx-packets"`
}

GetQEMUNetworkInterfacesResponseResultStatistics contains the statistics from a QEMU get network interfaces response.

type GetResponseBody

type GetResponseBody struct {
	Data *GetResponseData `json:"data,omitempty"`
}

GetResponseBody contains the body from a virtual machine get response.

type GetResponseData

type GetResponseData struct {
	ACPI                 *types.CustomBool               `json:"acpi,omitempty"`
	Agent                *CustomAgent                    `json:"agent,omitempty"`
	AllowReboot          *types.CustomBool               `json:"reboot,omitempty"`
	AudioDevice          *CustomAudioDevice              `json:"audio0,omitempty"`
	Autostart            *types.CustomBool               `json:"autostart,omitempty"`
	BackupFile           *string                         `json:"archive,omitempty"`
	BandwidthLimit       *int                            `json:"bwlimit,omitempty"`
	BIOS                 *string                         `json:"bios,omitempty"`
	BootDisk             *string                         `json:"bootdisk,omitempty"`
	BootOrder            *string                         `json:"boot,omitempty"`
	CDROM                *string                         `json:"cdrom,omitempty"`
	CloudInitDNSDomain   *string                         `json:"searchdomain,omitempty"`
	CloudInitDNSServer   *string                         `json:"nameserver,omitempty"`
	CloudInitFiles       *CustomCloudInitFiles           `json:"cicustom,omitempty"`
	CloudInitPassword    *string                         `json:"cipassword,omitempty"`
	CloudInitSSHKeys     *CustomCloudInitSSHKeys         `json:"sshkeys,omitempty"`
	CloudInitType        *string                         `json:"citype,omitempty"`
	CloudInitUsername    *string                         `json:"ciuser,omitempty"`
	CloudInitUpgrade     *types.CustomBool               `json:"ciupgrade,omitempty"`
	CPUArchitecture      *string                         `json:"arch,omitempty"`
	CPUCores             *int64                          `json:"cores,omitempty"`
	CPUEmulation         *CustomCPUEmulation             `json:"cpu,omitempty"`
	CPULimit             *types.CustomInt64              `json:"cpulimit,omitempty"`
	CPUSockets           *int64                          `json:"sockets,omitempty"`
	CPUUnits             *int64                          `json:"cpuunits,omitempty"`
	CPUAffinity          *string                         `json:"affinity,omitempty"`
	DedicatedMemory      *types.CustomInt64              `json:"memory,omitempty"`
	DeletionProtection   *types.CustomBool               `json:"protection,omitempty"`
	Description          *string                         `json:"description,omitempty"`
	EFIDisk              *CustomEFIDisk                  `json:"efidisk0,omitempty"`
	FloatingMemory       *types.CustomInt64              `json:"balloon,omitempty"`
	FloatingMemoryShares *int                            `json:"shares,omitempty"`
	Freeze               *types.CustomBool               `json:"freeze,omitempty"`
	HookScript           *string                         `json:"hookscript,omitempty"`
	Hotplug              *types.CustomCommaSeparatedList `json:"hotplug,omitempty"`
	Hugepages            *string                         `json:"hugepages,omitempty"`
	IPConfig0            *CustomCloudInitIPConfig        `json:"ipconfig0,omitempty"`
	IPConfig1            *CustomCloudInitIPConfig        `json:"ipconfig1,omitempty"`
	IPConfig2            *CustomCloudInitIPConfig        `json:"ipconfig2,omitempty"`
	IPConfig3            *CustomCloudInitIPConfig        `json:"ipconfig3,omitempty"`
	IPConfig4            *CustomCloudInitIPConfig        `json:"ipconfig4,omitempty"`
	IPConfig5            *CustomCloudInitIPConfig        `json:"ipconfig5,omitempty"`
	IPConfig6            *CustomCloudInitIPConfig        `json:"ipconfig6,omitempty"`
	IPConfig7            *CustomCloudInitIPConfig        `json:"ipconfig7,omitempty"`
	IPConfig8            *CustomCloudInitIPConfig        `json:"ipconfig8,omitempty"`
	IPConfig9            *CustomCloudInitIPConfig        `json:"ipconfig9,omitempty"`
	IPConfig10           *CustomCloudInitIPConfig        `json:"ipconfig10,omitempty"`
	IPConfig11           *CustomCloudInitIPConfig        `json:"ipconfig11,omitempty"`
	IPConfig12           *CustomCloudInitIPConfig        `json:"ipconfig12,omitempty"`
	IPConfig13           *CustomCloudInitIPConfig        `json:"ipconfig13,omitempty"`
	IPConfig14           *CustomCloudInitIPConfig        `json:"ipconfig14,omitempty"`
	IPConfig15           *CustomCloudInitIPConfig        `json:"ipconfig15,omitempty"`
	IPConfig16           *CustomCloudInitIPConfig        `json:"ipconfig16,omitempty"`
	IPConfig17           *CustomCloudInitIPConfig        `json:"ipconfig17,omitempty"`
	IPConfig18           *CustomCloudInitIPConfig        `json:"ipconfig18,omitempty"`
	IPConfig19           *CustomCloudInitIPConfig        `json:"ipconfig19,omitempty"`
	IPConfig20           *CustomCloudInitIPConfig        `json:"ipconfig20,omitempty"`
	IPConfig21           *CustomCloudInitIPConfig        `json:"ipconfig21,omitempty"`
	IPConfig22           *CustomCloudInitIPConfig        `json:"ipconfig22,omitempty"`
	IPConfig23           *CustomCloudInitIPConfig        `json:"ipconfig23,omitempty"`
	IPConfig24           *CustomCloudInitIPConfig        `json:"ipconfig24,omitempty"`
	IPConfig25           *CustomCloudInitIPConfig        `json:"ipconfig25,omitempty"`
	IPConfig26           *CustomCloudInitIPConfig        `json:"ipconfig26,omitempty"`
	IPConfig27           *CustomCloudInitIPConfig        `json:"ipconfig27,omitempty"`
	IPConfig28           *CustomCloudInitIPConfig        `json:"ipconfig28,omitempty"`
	IPConfig29           *CustomCloudInitIPConfig        `json:"ipconfig29,omitempty"`
	IPConfig30           *CustomCloudInitIPConfig        `json:"ipconfig30,omitempty"`
	IPConfig31           *CustomCloudInitIPConfig        `json:"ipconfig31,omitempty"`
	KeepHugepages        *types.CustomBool               `json:"keephugepages,omitempty"`
	KeyboardLayout       *string                         `json:"keyboard,omitempty"`
	KVMArguments         *string                         `json:"args,omitempty"`
	KVMEnabled           *types.CustomBool               `json:"kvm,omitempty"`
	LocalTime            *types.CustomBool               `json:"localtime,omitempty"`
	Lock                 *string                         `json:"lock,omitempty"`
	Machine              *string                         `json:"machine,omitempty"`
	MigrateDowntime      *float64                        `json:"migrate_downtime,omitempty"`
	MigrateSpeed         *int                            `json:"migrate_speed,omitempty"`
	Name                 *string                         `json:"name,omitempty"`
	NetworkDevice0       *CustomNetworkDevice            `json:"net0,omitempty"`
	NetworkDevice1       *CustomNetworkDevice            `json:"net1,omitempty"`
	NetworkDevice2       *CustomNetworkDevice            `json:"net2,omitempty"`
	NetworkDevice3       *CustomNetworkDevice            `json:"net3,omitempty"`
	NetworkDevice4       *CustomNetworkDevice            `json:"net4,omitempty"`
	NetworkDevice5       *CustomNetworkDevice            `json:"net5,omitempty"`
	NetworkDevice6       *CustomNetworkDevice            `json:"net6,omitempty"`
	NetworkDevice7       *CustomNetworkDevice            `json:"net7,omitempty"`
	NetworkDevice8       *CustomNetworkDevice            `json:"net8,omitempty"`
	NetworkDevice9       *CustomNetworkDevice            `json:"net9,omitempty"`
	NetworkDevice10      *CustomNetworkDevice            `json:"net10,omitempty"`
	NetworkDevice11      *CustomNetworkDevice            `json:"net11,omitempty"`
	NetworkDevice12      *CustomNetworkDevice            `json:"net12,omitempty"`
	NetworkDevice13      *CustomNetworkDevice            `json:"net13,omitempty"`
	NetworkDevice14      *CustomNetworkDevice            `json:"net14,omitempty"`
	NetworkDevice15      *CustomNetworkDevice            `json:"net15,omitempty"`
	NetworkDevice16      *CustomNetworkDevice            `json:"net16,omitempty"`
	NetworkDevice17      *CustomNetworkDevice            `json:"net17,omitempty"`
	NetworkDevice18      *CustomNetworkDevice            `json:"net18,omitempty"`
	NetworkDevice19      *CustomNetworkDevice            `json:"net19,omitempty"`
	NetworkDevice20      *CustomNetworkDevice            `json:"net20,omitempty"`
	NetworkDevice21      *CustomNetworkDevice            `json:"net21,omitempty"`
	NetworkDevice22      *CustomNetworkDevice            `json:"net22,omitempty"`
	NetworkDevice23      *CustomNetworkDevice            `json:"net23,omitempty"`
	NetworkDevice24      *CustomNetworkDevice            `json:"net24,omitempty"`
	NetworkDevice25      *CustomNetworkDevice            `json:"net25,omitempty"`
	NetworkDevice26      *CustomNetworkDevice            `json:"net26,omitempty"`
	NetworkDevice27      *CustomNetworkDevice            `json:"net27,omitempty"`
	NetworkDevice28      *CustomNetworkDevice            `json:"net28,omitempty"`
	NetworkDevice29      *CustomNetworkDevice            `json:"net29,omitempty"`
	NetworkDevice30      *CustomNetworkDevice            `json:"net30,omitempty"`
	NetworkDevice31      *CustomNetworkDevice            `json:"net31,omitempty"`
	NUMAEnabled          *types.CustomBool               `json:"numa,omitempty"`
	NUMADevices0         *CustomNUMADevice               `json:"numa0,omitempty"`
	NUMADevices1         *CustomNUMADevice               `json:"numa1,omitempty"`
	NUMADevices2         *CustomNUMADevice               `json:"numa2,omitempty"`
	NUMADevices3         *CustomNUMADevice               `json:"numa3,omitempty"`
	NUMADevices4         *CustomNUMADevice               `json:"numa4,omitempty"`
	NUMADevices5         *CustomNUMADevice               `json:"numa5,omitempty"`
	NUMADevices6         *CustomNUMADevice               `json:"numa6,omitempty"`
	NUMADevices7         *CustomNUMADevice               `json:"numa7,omitempty"`
	OSType               *string                         `json:"ostype,omitempty"`
	Overwrite            *types.CustomBool               `json:"force,omitempty"`
	PoolID               *string                         `json:"pool,omitempty"`
	Revert               *string                         `json:"revert,omitempty"`
	SCSIHardware         *string                         `json:"scsihw,omitempty"`
	SerialDevice0        *string                         `json:"serial0,omitempty"`
	SerialDevice1        *string                         `json:"serial1,omitempty"`
	SerialDevice2        *string                         `json:"serial2,omitempty"`
	SerialDevice3        *string                         `json:"serial3,omitempty"`
	SharedMemory         *CustomSharedMemory             `json:"ivshmem,omitempty"`
	SkipLock             *types.CustomBool               `json:"skiplock,omitempty"`
	SMBIOS               *CustomSMBIOS                   `json:"smbios1,omitempty"`
	SpiceEnhancements    *CustomSpiceEnhancements        `json:"spice_enhancements,omitempty"`
	StartDate            *string                         `json:"startdate,omitempty"`
	StartOnBoot          *types.CustomBool               `json:"onboot,omitempty"`
	StartupOrder         *CustomStartupOrder             `json:"startup,omitempty"`
	TabletDeviceEnabled  *types.CustomBool               `json:"tablet,omitempty"`
	Tags                 *string                         `json:"tags,omitempty"`
	Template             *types.CustomBool               `json:"template,omitempty"`
	TimeDriftFixEnabled  *types.CustomBool               `json:"tdf,omitempty"`
	TPMState             *CustomTPMState                 `json:"tpmstate0,omitempty"`
	USBDevice0           *CustomUSBDevice                `json:"usb0,omitempty"`
	USBDevice1           *CustomUSBDevice                `json:"usb1,omitempty"`
	USBDevice2           *CustomUSBDevice                `json:"usb2,omitempty"`
	USBDevice3           *CustomUSBDevice                `json:"usb3,omitempty"`
	VGADevice            *CustomVGADevice                `json:"vga,omitempty"`
	VirtualCPUCount      *int64                          `json:"vcpus,omitempty"`
	VMGenerationID       *string                         `json:"vmgenid,omitempty"`
	VMStateDatastoreID   *string                         `json:"vmstatestorage,omitempty"`
	WatchdogDevice       *CustomWatchdogDevice           `json:"watchdog,omitempty"`
	StorageDevices       CustomStorageDevices            `json:"-"`
	PCIDevices           CustomPCIDevices                `json:"-"`
}

GetResponseData contains the data from an virtual machine get response.

func (*GetResponseData) UnmarshalJSON added in v0.60.1

func (d *GetResponseData) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the data from the JSON response, populating the CustomStorageDevices field.

type GetStatusResponseBody

type GetStatusResponseBody struct {
	Data *GetStatusResponseData `json:"data,omitempty"`
}

GetStatusResponseBody contains the body from a VM get status response.

type GetStatusResponseData

type GetStatusResponseData struct {
	AgentEnabled     *types.CustomBool `json:"agent,omitempty"`
	CPUCount         *int64            `json:"cpus,omitempty"`
	Lock             *string           `json:"lock,omitempty"`
	MemoryAllocation *int64            `json:"maxmem,omitempty"`
	Name             *string           `json:"name,omitempty"`
	PID              *int              `json:"pid,omitempty"`
	QMPStatus        *string           `json:"qmpstatus,omitempty"`
	RootDiskSize     *int64            `json:"maxdisk,omitempty"`
	SpiceSupport     *types.CustomBool `json:"spice,omitempty"`
	Status           string            `json:"status,omitempty"`
	Tags             *string           `json:"tags,omitempty"`
	Uptime           *int              `json:"uptime,omitempty"`
	VMID             *int              `json:"vmid,omitempty"`
}

GetStatusResponseData contains the data from a VM get status response.

type ListResponseBody

type ListResponseBody struct {
	Data []*ListResponseData `json:"data,omitempty"`
}

ListResponseBody contains the body from a virtual machine list response.

type ListResponseData

type ListResponseData struct {
	Name     *string           `json:"name,omitempty"`
	Tags     *string           `json:"tags,omitempty"`
	Template *types.CustomBool `json:"template,omitempty"`
	Status   *string           `json:"status,omitempty"`
	VMID     int               `json:"vmid,omitempty"`
}

ListResponseData contains the data from an virtual machine list response.

type MigrateRequestBody

type MigrateRequestBody struct {
	OnlineMigration *types.CustomBool `json:"online,omitempty"           url:"online,omitempty,int"`
	TargetNode      string            `json:"target"                     url:"target"`
	TargetStorage   *string           `json:"targetstorage,omitempty"    url:"targetstorage,omitempty"`
	WithLocalDisks  *types.CustomBool `json:"with-local-disks,omitempty" url:"with-local-disks,omitempty,int"`
}

MigrateRequestBody contains the body for a VM migration request.

type MigrateResponseBody

type MigrateResponseBody struct {
	Data *string `json:"data,omitempty"`
}

MigrateResponseBody contains the body from a VM migrate response.

type MoveDiskRequestBody

type MoveDiskRequestBody struct {
	BandwidthLimit      *int              `json:"bwlimit,omitempty" url:"bwlimit,omitempty"`
	DeleteOriginalDisk  *types.CustomBool `json:"delete,omitempty"  url:"delete,omitempty,int"`
	Digest              *string           `json:"digest,omitempty"  url:"digest,omitempty"`
	Disk                string            `json:"disk"              url:"disk"`
	TargetStorage       string            `json:"storage"           url:"storage"`
	TargetStorageFormat *string           `json:"format,omitempty"  url:"format,omitempty"`
}

MoveDiskRequestBody contains the body for a VM move disk request.

type MoveDiskResponseBody

type MoveDiskResponseBody struct {
	Data *string `json:"data,omitempty"`
}

MoveDiskResponseBody contains the body from a VM move disk response.

type RebootRequestBody

type RebootRequestBody struct {
	Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"`
}

RebootRequestBody contains the body for a VM reboot request.

type RebootResponseBody

type RebootResponseBody struct {
	Data *string `json:"data,omitempty"`
}

RebootResponseBody contains the body from a VM reboot response.

type ResizeDiskRequestBody

type ResizeDiskRequestBody struct {
	Digest   *string           `json:"digest,omitempty"   url:"digest,omitempty"`
	Disk     string            `json:"disk"               url:"disk"`
	Size     types.DiskSize    `json:"size"               url:"size"`
	SkipLock *types.CustomBool `json:"skiplock,omitempty" url:"skiplock,omitempty,int"`
}

ResizeDiskRequestBody contains the body for a VM resize disk request.

type ShutdownRequestBody

type ShutdownRequestBody struct {
	ForceStop  *types.CustomBool `json:"forceStop,omitempty"  url:"forceStop,omitempty,int"`
	KeepActive *types.CustomBool `json:"keepActive,omitempty" url:"keepActive,omitempty,int"`
	SkipLock   *types.CustomBool `json:"skipLock,omitempty"   url:"skipLock,omitempty,int"`
	Timeout    *int              `json:"timeout,omitempty"    url:"timeout,omitempty"`
}

ShutdownRequestBody contains the body for a VM shutdown request.

type ShutdownResponseBody

type ShutdownResponseBody struct {
	Data *string `json:"data,omitempty"`
}

ShutdownResponseBody contains the body from a VM shutdown response.

type StartRequestBody added in v0.46.0

type StartRequestBody struct {
	ForceCPU         *string           `json:"force-cpu,omitempty"         url:"force-cpu,omitempty"`
	Machine          *string           `json:"machine,omitempty"           url:"machine,omitempty"`
	MigrateFrom      *string           `json:"migratefrom,omitempty"       url:"migratefrom,omitempty"`
	MigrationNetwork *string           `json:"migration_network,omitempty" url:"migration_network,omitempty"`
	MigrationType    *string           `json:"migration_type,omitempty"    url:"migration_type,omitempty"`
	SkipLock         *types.CustomBool `json:"skipLock,omitempty"          url:"skipLock,omitempty,int"`
	StateURI         *string           `json:"stateuri,omitempty"          url:"stateuri,omitempty"`
	TargetStorage    *string           `json:"targetstorage,omitempty"     url:"targetstorage,omitempty"`
	TimeoutSeconds   *int              `json:"timeout,omitempty"           url:"timeout,omitempty"`
}

StartRequestBody contains the body for a VM start request.

type StartResponseBody

type StartResponseBody struct {
	Data *string `json:"data,omitempty"`
}

StartResponseBody contains the body from a VM start response.

type StopResponseBody

type StopResponseBody struct {
	Data *string `json:"data,omitempty"`
}

StopResponseBody contains the body from a VM stop response.

type UpdateAsyncResponseBody

type UpdateAsyncResponseBody struct {
	Data *string `json:"data,omitempty"`
}

UpdateAsyncResponseBody contains the body from a VM async update response.

type UpdateRequestBody

type UpdateRequestBody = CreateRequestBody

UpdateRequestBody contains the data for an virtual machine update request.

func (*UpdateRequestBody) IsEmpty added in v0.57.1

func (b *UpdateRequestBody) IsEmpty() bool

IsEmpty checks if the update request body is empty.

func (*UpdateRequestBody) ToDelete added in v0.54.0

func (b *UpdateRequestBody) ToDelete(fieldName string) error

ToDelete adds a field to the delete list. The field name should be the **actual** field name in the struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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