proxmox

package
v0.0.0-...-fe036ac Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 31 Imported by: 179

Documentation

Index

Constants

View Source
const (
	Client_Error_Nil            = "client may not be nil"
	Client_Error_NotInitialized = "client not initialized"
	Client_Error_UnableVersion  = "unable to get version"
)
View Source
const (
	GroupName_Error_Invalid   string = "" /* 136-byte string literal not displayed */
	GroupName_Error_Empty     string = "variable of type (GroupName) may not be empty"
	GroupName_Error_MaxLength string = "variable of type (GroupName) may not be more tha 1000 characters long"
)
View Source
const (
	GuestNameErrorEmpty   = `name cannot be empty`
	GuestNameErrorInvalid = `` /* 153-byte string literal not displayed */
	GuestNameErrorLength  = `name has a maximum length of 128`
	GuestNameErrorStart   = `name cannot start with a hyphen (-) or dot (.)`
	GuestNameErrorEnd     = `name cannot end with a hyphen (-) or dot (.)`
)
View Source
const (
	GuestNetworkRate_Error_Invalid = "network rate must be in the range 0 to 10240000"
	GuestNetworkRateMaximum        = 10240000
	GuestNetworkRateUnlimited      = GuestNetworkRate(0)
)
View Source
const (
	GuestID_Error_Maximum = "guestID should be less than 1000000000"
	GuestID_Error_Minimum = "guestID should be greater than 99"
	GuestIdMaximum        = 999999999
	GuestIdMinimum        = 100
)
View Source
const (
	HaNodeAffinityRule_Error_GuestsEmpty    = "guests must not be empty"
	HaNodeAffinityRule_Error_GuestsRequired = "guests must be specified during creation"
	HaNodeAffinityRule_Error_Kind           = "rule is not a node affinity rule"
	HaNodeAffinityRule_Error_NodesEmpty     = "nodes must not be empty"
	HaNodeAffinityRule_Error_NodesRequired  = "nodes must be specified during creation"
)
View Source
const (
	HaResourceAffinityRule_Error_AffinityRequired = "affinity must be specified during creation"
	HaResourceAffinityRule_Error_GuestsEmpty      = "guests must not be empty"
	HaResourceAffinityRule_Error_GuestsRequired   = "guests must be specified during creation"
	HaResourceAffinityRule_Error_Kind             = "rule is not a resource affinity rule"
)
View Source
const (
	HaRuleID_Error_MinLength = `ha rule ID must at least be 2 characters`
	HaRuleID_Error_MaxLength = `ha rule ID has a maximum of 128 characters`
	HaRuleID_Error_Invalid   = `ha rule ID did not match the following regex '^[a-zA-Z][a-zA-Z0-9\-_]{2,127}$'`
	HaRuleID_Error_Start     = `ha rule ID can only start with a lower or upper case letter`
	HaRuleIDMin              = 2
	HaRuleIDMax              = 128
)
View Source
const (
	HaPriority_Error_Invalid = "priority must be between 0 and 1000"
	HaPriorityMax            = 1000
)
View Source
const (
	LxcCpuCoresMaximum        = 8192
	LxcCpuCores_Error_Invalid = "cpu cores should be in the range 0-8192"
)
View Source
const (
	LxcCpuLimitMaximum        = 8192
	LxcCpuLimit_Error_Invalid = "cpu limit should be in the range 0-8192"
)
View Source
const (
	LxcCpuUnitsDefault        = 0 // uses the PVE default
	LxcCpuUnitsMaximum        = 100000
	LxcCpuUnits_Error_Minimum = "cpu units has a minimum of 8"
	LxcCpuUnits_Error_Maximum = "cpu units has a maximum of 100000"
)
View Source
const (
	LxcFeatures_Error_MutuallyExclusive        = "privileged and unprivileged features are mutually exclusive"
	LxcFeatures_Error_PrivilegedInUnprivileged = "privileged features cannot be set in unprivileged containers"
	LxcFeatures_Error_UnprivilegedInPrivileged = "unprivileged features cannot be set in privileged containers"
)
View Source
const (
	LxcBootMount_Error_NoSizeDuringCreation    = "size must be set during creation"
	LxcBootMount_Error_NoStorageDuringCreation = "storage must be set during creation"
	LxcBootMount_Error_QuotaNotPrivileged      = "quota can only be set for privileged guest"
)
View Source
const (
	LxcBindMountErrorHostPathRequired  = "host path is required for creation"
	LxcBindMountErrorGuestPathRequired = "guest path is required for creation"
)
View Source
const (
	LxcDataMountErrorPathRequired      = "path is required for creation"
	LxcDataMountErrorQuotaUnprivileged = "quota can only be set for privileged containers"
	LxcDataMountErrorSizeRequired      = "size is required for creation"
	LxcDataMountErrorStorageRequired   = "storage is required for creation"
)
View Source
const (
	LxcHostPathErrorInvalid          = "host path must not be empty"
	LxcHostPathErrorRelative         = "host path must be absolute"
	LxcHostPathErrorInvalidCharacter = "host path must not contain ',' character"
)
View Source
const (
	LxcMountPathErrorInvalid          = "mount point path must not be empty"
	LxcMountPathErrorRelative         = "mount point path must be absolute"
	LxcMountPathErrorInvalidCharacter = "mount point path must not contain ',' character"
)
View Source
const (
	LxcNetwork_Error_BridgeRequired = "lxc network bridge is required for creation"
	LxcNetwork_Error_NameRequired   = "lxc network name is required for creation"
)
View Source
const (
	LxcNetworksAmount               = 16
	LxcNetworks_Error_Amount        = ""
	LxcNetworks_Error_DuplicateName = "lxc network name must be unique across all networks"
)
View Source
const (
	LxcNetworkIdMaximum        = 15
	LxcNetworkID_Error_Invalid = "lxc network id must be between 0 and 15"
)
View Source
const (
	LxcNetworkName_Error_Invalid       = `lxc network name must match regex: ^(?!\.\.)[a-zA-Z0-9_.-]{2,16}$`
	LxcNetworkName_Error_LengthMinimum = "lxc network name must be at least 2 characters long"
	LxcNetworkName_Error_LengthMaximum = "lxc network name must be at most 16 characters long"
)
View Source
const (
	LxcIPv4_Error_MutuallyExclusive        = "lxc IPv4 Manual and DHCP are mutually exclusive"
	LxcIPv4_Error_MutuallyExclusiveAddress = "lxc IPv4 Address and DHCP/Manual are mutually exclusive"
	LxcIPv4_Error_MutuallyExclusiveGateway = "lxc IPv4 Gateway and DHCP/Manual are mutually exclusive"
)
View Source
const (
	LxcIPv6_Error_MutuallyExclusive        = "lxc IPv6 DHCP/Manual/SLAAC are mutually exclusive"
	LxcIPv6_Error_MutuallyExclusiveAddress = "lxc IPv6 Address and DHCP/SLAAC/Manual are mutually exclusive"
	LxcIPv6_Error_MutuallyExclusiveGateway = "lxc IPv6 Gateway and DHCP/SLAAC/Manual are mutually exclusive"
)
View Source
const (
	ConfigLXC_Error_BootMountMissing     = "boot mount is required during creation"
	ConfigLXC_Error_CreateOptionsMissing = "create options are required during creation"
)
View Source
const (
	LxcMemoryMinimum        = 16
	LxcMemory_Error_Minimum = "memory has a minimum of 16"
)
View Source
const (
	LxcTemplate_Error_StorageMissing = "storage is required"
	LxcTemplate_Error_FileMissing    = "file is required"
)
View Source
const (
	PoolName_Error_Characters        string = "PoolName may only contain the following characters: a-z, A-Z, 0-9, hyphen (-), and underscore (_)"
	PoolName_Error_Empty             string = "PoolName cannot be empty"
	PoolName_Error_Length            string = "PoolName may not be longer than 1024 characters" // proxmox does not seem to have a max length, so we artificially cap it at 1024
	PoolName_Error_NotExists         string = "Pool doesn't exist"
	PoolName_Error_Exists            string = "Pool already exists"
	PoolName_Error_NoGuestsSpecified string = "no guests specified"
)
View Source
const (
	ConfigQemu_Error_UnableToUpdateWithoutReboot string = "unable to update vm without rebooting"
	ConfigQemu_Error_CpuRequired                 string = "cpu is required during creation"
	ConfigQemu_Error_MemoryRequired              string = "memory is required during creation"
	ConfigQemu_Error_NodeRequired                string = "node is required during creation"
)
View Source
const (
	CloudInitSnippetPath_Error_Empty             = "cloudInitSnippetPath may not be empty"
	CloudInitSnippetPath_Error_InvalidCharacters = "cloudInitSnippetPath may ony contain the following characters: [a-zA-Z0-9_ -/.]"
	CloudInitSnippetPath_Error_InvalidPath       = "cloudInitSnippetPath must be a valid unix path"
	CloudInitSnippetPath_Error_MaxLength         = "cloudInitSnippetPath may not be longer than 256 characters"
	CloudInitSnippetPath_Error_Relative          = "cloudInitSnippetPath must be an relative path"
)
View Source
const (
	QemuCpuCores_Error_LowerBound string = "minimum value of QemuCpuCores is 1"
	QemuCpuCores_Error_UpperBound string = "maximum value of QemuCpuCores is 128"
)
View Source
const (
	QemuCpuSockets_Error_LowerBound string = "minimum value of QemuCpuSockets is 1"
	QemuCpuSockets_Error_UpperBound string = "maximum value of QemuCpuSockets is 4"
)
View Source
const (
	Error_IsoFile_File    string = "file may not be empty"
	Error_IsoFile_Storage string = "storage may not be empty"
)
View Source
const (
	Error_QemuCloudInitDisk_Storage string = "storage should not be empty"
	Error_QemuCloudInitDisk_OnlyOne string = "only one cloud init disk may exist"
)
View Source
const (
	Error_QemuDisk_File              string = "file may not be empty"
	Error_QemuDisk_MutuallyExclusive string = "settings cdrom,cloudinit,disk,passthrough are mutually exclusive"
	Error_QemuDisk_Storage           string = "storage may not be empty"
)
View Source
const (
	Error_QemuDiskSerial_IllegalCharacter string = "serial may only contain the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_"
	Error_QemuDiskSerial_IllegalLength    string = "serial may only be 60 characters long"
)
View Source
const (
	QemuGuestAgentType_Isa           QemuGuestAgentType = "isa"
	QemuGuestAgentType_VirtIO        QemuGuestAgentType = "virtio"
	QemuGuestAgentType_None          QemuGuestAgentType = "" // Used to unset the value. Proxmox enforces the default.
	QemuGuestAgentType_Error_Invalid string             = `invalid qemu guest agent type, should one of [` + string(QemuGuestAgentType_Isa) + `, ` + string(QemuGuestAgentType_VirtIO) + `, ""]`
)
View Source
const (
	QemuMemory_Error_MinimumCapacityMiB_GreaterThan_CapacityMiB string = "minimum capacity MiB cannot be greater than capacity MiB"
	QemuMemory_Error_NoMemoryCapacity                           string = "no memory capacity specified"
	QemuMemory_Error_SharesHasNoEffectWithoutBallooning         string = "shares has no effect when capacity equals minimum capacity"
)
View Source
const (
	QemuMemoryCapacity_Error_Maximum string = "memory capacity has a maximum of 4178944"
	QemuMemoryCapacity_Error_Minimum string = "memory capacity has a minimum of 1"
)
View Source
const (
	QemuNetworkInterface_Error_BridgeRequired string = "bridge is required during creation"
	QemuNetworkInterface_Error_ModelRequired  string = "model is required during creation"
	QemuNetworkInterface_Error_MtuNoEffect    string = "mtu has no effect when model is not virtio"
)
View Source
const (
	QemuNetworkInterfaceID_Error_Invalid string = "network interface ID must be in the range 0-31"

	QemuNetworkInterfaceID0  QemuNetworkInterfaceID = 0
	QemuNetworkInterfaceID1  QemuNetworkInterfaceID = 1
	QemuNetworkInterfaceID2  QemuNetworkInterfaceID = 2
	QemuNetworkInterfaceID3  QemuNetworkInterfaceID = 3
	QemuNetworkInterfaceID4  QemuNetworkInterfaceID = 4
	QemuNetworkInterfaceID5  QemuNetworkInterfaceID = 5
	QemuNetworkInterfaceID6  QemuNetworkInterfaceID = 6
	QemuNetworkInterfaceID7  QemuNetworkInterfaceID = 7
	QemuNetworkInterfaceID8  QemuNetworkInterfaceID = 8
	QemuNetworkInterfaceID9  QemuNetworkInterfaceID = 9
	QemuNetworkInterfaceID10 QemuNetworkInterfaceID = 10
	QemuNetworkInterfaceID11 QemuNetworkInterfaceID = 11
	QemuNetworkInterfaceID12 QemuNetworkInterfaceID = 12
	QemuNetworkInterfaceID13 QemuNetworkInterfaceID = 13
	QemuNetworkInterfaceID14 QemuNetworkInterfaceID = 14
	QemuNetworkInterfaceID15 QemuNetworkInterfaceID = 15
	QemuNetworkInterfaceID16 QemuNetworkInterfaceID = 16
	QemuNetworkInterfaceID17 QemuNetworkInterfaceID = 17
	QemuNetworkInterfaceID18 QemuNetworkInterfaceID = 18
	QemuNetworkInterfaceID19 QemuNetworkInterfaceID = 19
	QemuNetworkInterfaceID20 QemuNetworkInterfaceID = 20
	QemuNetworkInterfaceID21 QemuNetworkInterfaceID = 21
	QemuNetworkInterfaceID22 QemuNetworkInterfaceID = 22
	QemuNetworkInterfaceID23 QemuNetworkInterfaceID = 23
	QemuNetworkInterfaceID24 QemuNetworkInterfaceID = 24
	QemuNetworkInterfaceID25 QemuNetworkInterfaceID = 25
	QemuNetworkInterfaceID26 QemuNetworkInterfaceID = 26
	QemuNetworkInterfaceID27 QemuNetworkInterfaceID = 27
	QemuNetworkInterfaceID28 QemuNetworkInterfaceID = 28
	QemuNetworkInterfaceID29 QemuNetworkInterfaceID = 29
	QemuNetworkInterfaceID30 QemuNetworkInterfaceID = 30
	QemuNetworkInterfaceID31 QemuNetworkInterfaceID = 31

	QemuNetworkInterfaceIDMaximum QemuNetworkInterfaceID = QemuNetworkInterfaceID31
)
View Source
const (
	QemuNetworkQueueMaximum        QemuNetworkQueue = 64
	QemuNetworkQueue_Error_Invalid string           = "network queue must be in the range 0-64"
)
View Source
const (
	QemuPciID_Error_Invalid string = "pci id must be in the range 0-15"

	QemuPciIDMaximum = QemuPciID15

	QemuPciID0  QemuPciID = 0
	QemuPciID1  QemuPciID = 1
	QemuPciID2  QemuPciID = 2
	QemuPciID3  QemuPciID = 3
	QemuPciID4  QemuPciID = 4
	QemuPciID5  QemuPciID = 5
	QemuPciID6  QemuPciID = 6
	QemuPciID7  QemuPciID = 7
	QemuPciID8  QemuPciID = 8
	QemuPciID9  QemuPciID = 9
	QemuPciID10 QemuPciID = 10
	QemuPciID11 QemuPciID = 11
	QemuPciID12 QemuPciID = 12
	QemuPciID13 QemuPciID = 13
	QemuPciID14 QemuPciID = 14
	QemuPciID15 QemuPciID = 15
)
View Source
const (
	PciID_Error_InvalidBus      string = "pci id invalid bus identifier"
	PciID_Error_InvalidDomain   string = "pci id invalid domain identifier"
	PciID_Error_LengthBus       string = "pci id bus identifier should be 2 characters long"
	PciID_Error_LengthDomain    string = "pci id domain identifier should be 4 characters long"
	PciID_Error_MissingBus      string = "pci id missing bus identifier"
	PciID_Error_MissingDevice   string = "pci id missing device identifier"
	PciID_Error_LengthDevice    string = "pci id device identifier should be 2 characters long"
	PciID_Error_InvalidDevice   string = "pci id invalid device identifier"
	PciID_Error_InvalidFunction string = "pci id invalid function identifier"
	PciID_Error_MaximumFunction string = "pci id function identifier should be in the range 0-7"
)
View Source
const (
	EntropySourceRawRandom  = "/dev/random"
	EntropySourceRawURandom = "/dev/urandom"
	EntropySourceRawHwRNG   = "/dev/hwrng"
)
View Source
const (
	SerialID0               SerialID = 0
	SerialID1               SerialID = 1
	SerialID2               SerialID = 2
	SerialID3               SerialID = 3
	SerialID_Errors_Invalid string   = "serial id must be one of 0,1,2,3"
)
View Source
const (
	SerialInterface_Errors_MutualExclusive string = "path and socket are mutually exclusive"
	SerialInterface_Errors_Empty           string = "path or socket must be set"
)
View Source
const (
	TpmVersion_1_2           TpmVersion = "v1.2"
	TpmVersion_2_0           TpmVersion = "v2.0"
	TpmVersion_Error_Invalid string     = "enum TmpVersion should be one of: " + string(TpmVersion_1_2) + ", " + string(TpmVersion_2_0)
)
View Source
const (
	QemuUsbID_Error_Invalid string = "usb id must be in the range 0-4"

	QemuUsbIDMaximum = QemuUsbID4

	QemuUsbID0 QemuUsbID = 0
	QemuUsbID1 QemuUsbID = 1
	QemuUsbID2 QemuUsbID = 2
	QemuUsbID3 QemuUsbID = 3
	QemuUsbID4 QemuUsbID = 4
)
View Source
const (
	QemuUSB_Error_MutualExclusive string = "usb device, usb mapped, usb port, and usb spice are mutually exclusive"
	QemuUSB_Error_DeviceID        string = "usb device id is required during creation"
	QemuUSB_Error_MappingID       string = "usb mapping id is required during creation"
	QemuUSB_Error_PortID          string = "usb port id is required during creation"
)
View Source
const (
	UsbDeviceID_Error_Invalid   string = "invalid usb device-id"
	UsbDeviceID_Error_VendorID  string = "usb vendor-id isn't valid hexadecimal"
	UsbDeviceID_Error_ProductID string = "usb product-id isn't valid hexadecimal"
)
View Source
const (
	NodeName_Error_Alphabetical string = "Node name must contain at least one alphabetical character"
	NodeName_Error_Empty        string = "Node name cannot be empty"
	NodeName_Error_HyphenEnd    string = "Node name cannot end with a hyphen"
	NodeName_Error_HyphenStart  string = "Node name cannot start with a hyphen"
	NodeName_Error_Illegal      string = "Node name may only contain the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"
	NodeName_Error_Length       string = "Node name must be less than 64 characters"
)
View Source
const (
	ResourceMappingUsbID_Error_MaxLength string = resourceMappingUsbKey + mappingID_Error_MaxLength
	ResourceMappingUsbID_Error_MinLength string = resourceMappingUsbKey + mappingID_Error_MinLength
	ResourceMappingUsbID_Error_Start     string = resourceMappingUsbKey + mappingID_Error_Start
	ResourceMappingUsbID_Error_Invalid   string = resourceMappingUsbKey + mappingID_Error_Invalid
)
View Source
const (
	ResourceMappingPciID_Error_MaxLength string = resourceMappingPciKey + mappingID_Error_MaxLength
	ResourceMappingPciID_Error_MinLength string = resourceMappingPciKey + mappingID_Error_MinLength
	ResourceMappingPciID_Error_Start     string = resourceMappingPciKey + mappingID_Error_Start
	ResourceMappingPciID_Error_Invalid   string = resourceMappingPciKey + mappingID_Error_Invalid
)
View Source
const (
	SnapshotName_Error_IllegalCharacters string = "SnapshotName must only contain the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
	SnapshotName_Error_MaxLength         string = "SnapshotName must be at most 40 characters long"
	SnapshotName_Error_MinLength         string = "SnapshotName must be at least 3 characters long"
	SnapshotName_Error_StartNoLetter     string = "SnapshotName must start with a letter"
)
View Source
const (
	AuthorizedKey_Error_NilPointer = "authorizedKey pointer is nil"
	AuthorizedKey_Error_Invalid    = "invalid value for AuthorizedKey"
)
View Source
const (
	Tag_Error_Invalid   string = "" /* 138-byte string literal not displayed */
	Tag_Error_MaxLength string = "tag may only be 124 characters"
	Tag_Error_Empty     string = "tag may not be empty"
)
View Source
const (
	TriBoolFalse          TriBool = -1
	TriBoolNone           TriBool = 0
	TriBoolTrue           TriBool = 1
	TriBool_Error_Invalid string  = "invalid value for TriBool"
)
View Source
const (
	VlanMaximum        Vlan   = 4095
	Vlan_Error_Invalid string = "vlan tag must be in the range 0-4095"
)
View Source
const (
	CloneLxcTarget_Error_MutualExclusivity = clone_Error_MutuallyExclusive
	CloneLxcTarget_Error_NoneSet           = clone_Error_NoneSet
)
View Source
const (
	CloneQemuTarget_Error_MutualExclusivity = clone_Error_MutuallyExclusive
	CloneQemuTarget_Error_NoneSet           = clone_Error_NoneSet
)
View Source
const CloudInitIPv4Config_Error_DhcpAddressMutuallyExclusive string = "ipv4 dhcp is mutually exclusive with address"
View Source
const CloudInitIPv4Config_Error_DhcpGatewayMutuallyExclusive string = "ipv4 dhcp is mutually exclusive with gateway"
View Source
const CloudInitIPv6Config_Error_DhcpAddressMutuallyExclusive string = "ipv6 dhcp is mutually exclusive with address"
View Source
const CloudInitIPv6Config_Error_DhcpGatewayMutuallyExclusive string = "ipv6 dhcp is mutually exclusive with gateway"
View Source
const CloudInitIPv6Config_Error_DhcpSlaacMutuallyExclusive string = "ipv6 dhcp is mutually exclusive with slaac"
View Source
const CloudInitIPv6Config_Error_SlaacAddressMutuallyExclusive string = "ipv6 slaac is mutually exclusive with address"
View Source
const CloudInitIPv6Config_Error_SlaacGatewayMutuallyExclusive string = "ipv6 slaac is mutually exclusive with gateway"
View Source
const CloudInit_Error_UpgradePackagesPre8 = "upgradePackages is only available in version 8 and above"
View Source
const CpuLimit_Error_Maximum string = "maximum value of CpuLimit is 128"
View Source
const CpuUnits_Error_Maximum string = "maximum value of CpuUnits is 262144"
View Source
const (
	ERROR_QemuDiskId_Invalid string = "invalid Disk ID"
)
View Source
const (
	EntropySourceErrorInvalid = "invalid value for EntropySource"
)
View Source
const Error_NewUserID string = "no username or realm specified, syntax is \"username@realm\""
View Source
const (
	Error_QemuCdRom_MutuallyExclusive string = "iso and passthrough are mutually exclusive"
)
View Source
const (
	Error_QemuDiskBandwidthIopsLimitBurst string = "burst may not be lower then 10 except for 0"
)
View Source
const (
	Error_QemuDiskBandwidthIopsLimitConcurrent string = "concurrent may not be lower then 10 except for 0"
)
View Source
const (
	Error_QemuDiskBandwidthMBpsLimitBurst string = "burst may not be lower then 1 except for 0"
)
View Source
const (
	Error_QemuDiskBandwidthMBpsLimitConcurrent string = "concurrent may not be lower then 1 except for 0"
)
View Source
const Error_QemuWorldWideName_Invalid string = "world wide name should be prefixed with 0x followed by 8 hexadecimal values"
View Source
const GuestType_Error_Invalid = "guest type should be one of (lxc, qemu)"
View Source
const HaAffinity_Error_Invalid = "affinity must be either positive or negative"
View Source
const HaRule_Error_VersionTooLow = "HA rules require Proxmox VE 9.0 or higher"
View Source
const IPv4Address_Error_Invalid = "ipv4Address is not a valid ipv4 address"
View Source
const IPv4CIDR_Error_Invalid = "ipv4CIDR is not a valid ipv4 address"
View Source
const IPv6Address_Error_Invalid = "ipv6Address is not a valid ipv6 address"
View Source
const IPv6CIDR_Error_Invalid = "ipv6CIDR is not a valid ipv6 address"
View Source
const (
	LxcCreateOptions_Error_TemplateMissing = "os template is required during creation"
)
View Source
const LxcMountErrorMutuallyExclusive = "bindMount and dataMount are mutually exclusive"
View Source
const LxcMountIDMaximum = 255
View Source
const (
	LxcMountSizeErrorMinimum = "mount point size must be greater than 131071"
)
View Source
const LxcMountsAmount = 256
View Source
const (
	MTU_Error_Invalid = "mtu must be in the range 576-65520"
)
View Source
const PciDeviceID_Error_Invalid string = "device id" + qemuPci_Error_Maximum
View Source
const (
	PciMediatedDevice_Error_Invalid string = "mediated device may not include " + pciMediatedDevice_Filter
)
View Source
const PciSubDeviceID_Error_Invalid string = "sub device id" + qemuPci_Error_Maximum
View Source
const PciSubVendorID_Error_Invalid string = "sub vendor id" + qemuPci_Error_Maximum
View Source
const PciVendorID_Error_Invalid string = "vendor id" + qemuPci_Error_Maximum
View Source
const (
	PermissionErrorPrefix string = "permission error:" // Check if an error starts with this to see if it's a permission error.
)
View Source
const (
	QemuCPU_Error_CoresRequired string = "cores is required"
)
View Source
const (
	QemuDiskSize_Error_Minimum string = "disk size must be greater then 4096"
)
View Source
const QemuMTU_Error_Invalid string = "inherit and value are mutually exclusive"
View Source
const (
	QemuMemoryBalloonCapacity_Error_Invalid string = "memory balloon capacity has a maximum of 4178944"
)
View Source
const (
	QemuMemoryShares_Error_Invalid string = "memory shares has a maximum of 50000"
)
View Source
const QemuNetworkInterfacesAmount = uint8(QemuNetworkInterfaceIDMaximum) + 1
View Source
const QemuPciDevicesAmount = uint8(QemuPciIDMaximum) + 1
View Source
const QemuPciMapping_Error_RequiredID string = "mapped id is required during creation"
View Source
const QemuPciRaw_Error_RequiredID string = "raw id is required during creation"
View Source
const QemuPci_Error_MutualExclusive string = "mapping and raw are mutually exclusive"
View Source
const QemuUSBsAmount = uint8(QemuUsbIDMaximum) + 1
View Source
const SerialPath_Errors_Invalid string = "path must start with /dev/"
View Source
const (
	Tags_Error_Duplicate string = "duplicate tag found"
)
View Source
const TaskStatusCheckInterval = 2

TaskStatusCheckInterval - time between async checks in seconds

View Source
const TmpState_Error_VersionRequired string = "version is required"
View Source
const (
	UsbPortID_Error_Invalid string = "invalid usb port id. Expected expression of the form '<bus>-<port>(.<port>)*' where bus and port are integers"
)
View Source
const (
	VirtIoRNGErrorSourceNotSet = "source must be set on creation"
)
View Source
const (
	VmRef_Error_IDnotSet = "vm reference id not set"
)
View Source
const (
	VmRef_Error_Nil string = "vm reference may not be nil"
)

Variables

View Source
var Debug = new(bool)
View Source
var Error = errorMsg{}

Error serves as a pseudo-namespace for error message generators.

Functions

func AddToList

func AddToList(list, newItem string) string

func ArrayToCSV

func ArrayToCSV(array interface{}) (csv string)

Convert Array to a comma (,) delimited list

func ArrayToStringType

func ArrayToStringType(inputarray []interface{}) (array []string)

Convert Array of type []interface{} to array of type []string

func BoolInvert

func BoolInvert(b bool) bool

func Btoi

func Btoi(b bool) int

func CSVtoArray

func CSVtoArray(csv string) []string

func CheckFileExistence

func CheckFileExistence(fileName string, files *[]Content_FileProperties) bool

Check if a file with the specific name exists in the list of files.

func CheckUserExistence

func CheckUserExistence(ctx context.Context, userId UserID, client *Client) (existence bool, err error)

Check if the user already exists in proxmox.

func DeleteFile

func DeleteFile(ctx context.Context, client *Client, node string, content Content_File) (err error)

Deletes te specified file from the specified storage.

func DeleteSnapshot

func DeleteSnapshot(ctx context.Context, c *Client, vmr *VmRef, snapshot SnapshotName) (exitStatus string, err error)

Deletes a snapshot, same as SnapshotName.Delete()

func DiskSizeGB

func DiskSizeGB(dcSize interface{}) float64

Convert a disk-size string to a GB float

func DownloadIsoFromUrl

func DownloadIsoFromUrl(ctx context.Context, client *Client, content ConfigContent_Iso) (err error)

Download an Iso file from a given URL. https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/storage/{storage}/download-url

func DownloadLxcTemplate

func DownloadLxcTemplate(ctx context.Context, client *Client, content ConfigContent_Template) (err error)

Download an LXC template.

func ErrorItemExists

func ErrorItemExists(item, text string) error

func ErrorItemNotExists

func ErrorItemNotExists(item, text string) error

func ErrorKeyEmpty

func ErrorKeyEmpty(text string) error

func ErrorKeyNotSet

func ErrorKeyNotSet(text string) error

func FormatDiskParam

func FormatDiskParam(disk QemuDevice) string

Given a QemuDevice (representing a disk), return a param string to give to ProxMox

func GuestHasFeature

func GuestHasFeature(ctx context.Context, vmr *VmRef, client *Client, feature GuestFeature) (bool, error)

check if the guest has the specified feature.

func GuestHasPendingChanges

func GuestHasPendingChanges(ctx context.Context, vmr *VmRef, client *Client) (bool, error)

Check if there are any pending changes that require a reboot to be applied. Same as VmRef.PendingChanges.

func GuestReboot

func GuestReboot(ctx context.Context, vmr *VmRef, client *Client) (err error)

Reboot the specified guest

func GuestShutdown

func GuestShutdown(ctx context.Context, vmr *VmRef, client *Client, force bool) (err error)

func GuestStart

func GuestStart(ctx context.Context, vmr *VmRef, client *Client) (err error)

func ItemInKeyOfArray

func ItemInKeyOfArray(array []interface{}, key, value string) (existance bool)

Check the value of a key in a nested array of map[string]interface{}

func Itob

func Itob(i int) bool

func ListFiles

func ListFiles(ctx context.Context, client *Client, node, storage string, content ContentType) (files *[]Content_FileProperties, err error)

List all files of the given type in the the specified storage

func ListGroups

func ListGroups(ctx context.Context, client *Client) (*[]ConfigGroup, error)

Returns a list of all existing groups

func ListPoolsWithComments

func ListPoolsWithComments(ctx context.Context, c *Client) (map[PoolName]string, error)

func ListSnapshots

func ListSnapshots(ctx context.Context, c *Client, vmr *VmRef) (rawSnapshots, error)

func ListTemplates

func ListTemplates(ctx context.Context, client *Client, node string) (templateList *[]TemplateItem, err error)

List all LXC templates available for download.

func ListUsers

func ListUsers(ctx context.Context, client *Client, full bool) (*[]ConfigUser, error)

List all users that exist in proxmox Setting full to TRUE the output wil include group information. Depending on the number of existing groups it take substantially longer to parse

func MaxVmId

func MaxVmId(ctx context.Context, client *Client) (max int, err error)

func MoveQemuDisk

func MoveQemuDisk(ctx context.Context, format *QemuDiskFormat, diskId QemuDiskId, storage string, deleteAfterMove bool, vmr *VmRef, client *Client) (err error)

func NewUserIDs

func NewUserIDs(userIds string) (*[]UserID, error)

Converts an comma separated list of "username@realm" to a array of UserID objects

func ParseSubConf

func ParseSubConf(
	element string,
	separator string,
) (key string, value interface{})

ParseSubConf - Parse standard sub-conf strings `key=value`.

func RemoveSshForwardUsernet

func RemoveSshForwardUsernet(ctx context.Context, vmr *VmRef, client *Client) (err error)

device_del net1 netdev_del net1

func RollbackSnapshot

func RollbackSnapshot(ctx context.Context, c *Client, vmr *VmRef, snapshot SnapshotName) (exitStatus string, err error)

Rollback to a snapshot, same as SnapshotName.Rollback()

func SendKeysString

func SendKeysString(ctx context.Context, vmr *VmRef, client *Client, keys string) (err error)

func SshForwardUsernet

func SshForwardUsernet(ctx context.Context, vmr *VmRef, client *Client) (sshPort string, err error)

This is because proxmox create/config API won't let us make usernet devices

func UpdateSnapshotDescription

func UpdateSnapshotDescription(ctx context.Context, c *Client, vmr *VmRef, snapshot SnapshotName, description string) (err error)

Updates the description of the specified snapshot, same as SnapshotName.UpdateDescription()

func ValidateArrayEven

func ValidateArrayEven(array interface{}, text string) error

func ValidateArrayNotEmpty

func ValidateArrayNotEmpty(array interface{}, text string) error

func ValidateFilePath

func ValidateFilePath(path, text string) error

func ValidateIntGreater

func ValidateIntGreater(min, value int, text string) error

func ValidateIntGreaterOrEquals

func ValidateIntGreaterOrEquals(min, value int, text string) error

func ValidateIntInRange

func ValidateIntInRange(min, max, value int, text string) error

func ValidateStringInArray

func ValidateStringInArray(array []string, value, text string) error

func ValidateStringNotEmpty

func ValidateStringNotEmpty(value, text string) error

func ValidateStringsEqual

func ValidateStringsEqual(value1, value2, text string) error

check if a key is allowed to be changed after creation.

func WaitForShutdown

func WaitForShutdown(ctx context.Context, vmr *VmRef, client *Client) (err error)

Useful waiting for ISO install to complete

func X_SuppressStaticCheck_DoNotUse

func X_SuppressStaticCheck_DoNotUse()

X_SuppressStaticCheck only exists to suppress warnings for unused functions

Types

type AgentInterfaceStatistics

type AgentInterfaceStatistics struct {
	RxBytes   uint
	RxDropped uint
	RxErrors  uint
	RxPackets uint
	TxBytes   uint
	TxDropped uint
	TxErrors  uint
	TxPackets uint
}

type AgentNetworkInterface

type AgentNetworkInterface struct {
	MacAddress  net.HardwareAddr
	IpAddresses []net.IP
	Name        string
	Statistics  *AgentInterfaceStatistics
}

type ApiToken

type ApiToken struct {
	TokenId string `json:"tokenid"`
	Comment string `json:"comment,omitempty"`
	Expire  int64  `json:"expire"`
	Privsep bool   `json:"privsep"`
}

type ApiTokenCreateResult

type ApiTokenCreateResult struct {
	Info  map[string]interface{} `json:"info"`
	Value string                 `json:"value"`
}

type ApiTokenCreateResultWrapper

type ApiTokenCreateResultWrapper struct {
	Data ApiTokenCreateResult `json:"data"`
}

type AuthorizedKey

type AuthorizedKey struct {
	Options   []string
	PublicKey ssh.PublicKey
	Comment   string
}

func (AuthorizedKey) MarshalJSON

func (key AuthorizedKey) MarshalJSON() ([]byte, error)

Custom MarshalJSON for AuthorizedKey

func (*AuthorizedKey) Parse

func (key *AuthorizedKey) Parse(rawKey []byte) error

Parse parses a public key from an authorized_keys file used in OpenSSH according to the sshd(8) manual page.

func (AuthorizedKey) String

func (key AuthorizedKey) String() string

func (*AuthorizedKey) UnmarshalJSON

func (key *AuthorizedKey) UnmarshalJSON(data []byte) error

Custom UnmarshalJSON for AuthorizedKey

type Client

type Client struct {
	ApiUrl      string
	Username    string
	Password    string
	Otp         string
	TaskTimeout int
	// contains filtered or unexported fields
}

Client - URL, user and password to specific Proxmox node

func NewClient

func NewClient(apiUrl string, hclient *http.Client, http_headers string, tls *tls.Config, proxyString string, taskTimeout int) (client *Client, err error)

func (*Client) AddQemuIPSet

func (c *Client) AddQemuIPSet(ctx context.Context, vmr *VmRef, name string, params map[string]interface{}) (exitStatus interface{}, err error)

AddQemuIPSet - Add IP or Network to IPSet.

func (*Client) ApplyNetwork

func (c *Client) ApplyNetwork(ctx context.Context, node string) (exitStatus string, err error)

ApplyNetwork applies the pending network configuration on the passed in node. It returns the body from the API response and any HTTP error the API returns.

func (*Client) ApplySDN

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

func (*Client) CheckAcmePluginExistence

func (c *Client) CheckAcmePluginExistence(ctx context.Context, id string) (existance bool, err error)

func (*Client) CheckMetricServerExistence

func (c *Client) CheckMetricServerExistence(ctx context.Context, id string) (existance bool, err error)

func (*Client) CheckPermissions

func (c *Client) CheckPermissions(ctx context.Context, perms []Permission) error

Returns an error if the user does not have the required permissions on the given category and itme.

func (*Client) CheckSDNDNSExistance

func (c *Client) CheckSDNDNSExistance(ctx context.Context, id string) (existance bool, err error)

CheckSDNDNSExistance returns true if a DNS entry with the provided ID exists, false otherwise.

func (*Client) CheckSDNSubnetExistance

func (c *Client) CheckSDNSubnetExistance(ctx context.Context, vnet, id string) (existance bool, err error)

CheckSDNSubnetExistance returns true if a DNS entry with the provided ID exists, false otherwise.

func (*Client) CheckSDNVNetExistance

func (c *Client) CheckSDNVNetExistance(ctx context.Context, id string) (existance bool, err error)

CheckSDNVNetExistance returns true if a DNS entry with the provided ID exists, false otherwise.

func (*Client) CheckSDNZoneExistance

func (c *Client) CheckSDNZoneExistance(ctx context.Context, id string) (existance bool, err error)

CheckSDNZoneExistance returns true if a zone with the provided ID exists, false otherwise.

func (*Client) CheckStorageExistance

func (c *Client) CheckStorageExistance(ctx context.Context, id string) (existance bool, err error)

func (*Client) CheckTask

func (c *Client) CheckTask(ctx context.Context, resp *http.Response) (exitStatus string, err error)

CheckTask polls the API to check if the Proxmox task has been completed. It returns the body of the HTTP response and any HTTP error occurred during the request.

func (*Client) CheckVmRef

func (c *Client) CheckVmRef(ctx context.Context, vmr *VmRef) (err error)

func (*Client) CloneLxcContainer deprecated

func (c *Client) CloneLxcContainer(ctx context.Context, vmr *VmRef, vmParams map[string]interface{}) (exitStatus string, err error)

Deprecated: use VmRef.CloneLxc() instead

func (*Client) CloneQemuVm deprecated

func (c *Client) CloneQemuVm(ctx context.Context, vmr *VmRef, vmParams map[string]interface{}) (exitStatus string, err error)

Deprecated: use VmRef.CloneQemu() instead

func (*Client) CreateAcmeAccount

func (c *Client) CreateAcmeAccount(ctx context.Context, params map[string]interface{}) (exitStatus string, err error)

func (*Client) CreateAcmePlugin

func (c *Client) CreateAcmePlugin(ctx context.Context, params map[string]interface{}) error

func (*Client) CreateItemReturnStatus

func (c *Client) CreateItemReturnStatus(ctx context.Context, params map[string]interface{}, url string) (exitStatus string, err error)

CreateItemReturnStatus creates an item on the Proxmox API. It returns the body of the HTTP response and any HTTP error occurred during the request.

func (*Client) CreateLxcContainer

func (c *Client) CreateLxcContainer(ctx context.Context, node string, vmParams map[string]interface{}) (exitStatus string, err error)

func (*Client) CreateMetricServer

func (c *Client) CreateMetricServer(ctx context.Context, id string, params map[string]interface{}) error

func (*Client) CreateNetwork

func (c *Client) CreateNetwork(ctx context.Context, node string, params map[string]interface{}) (exitStatus string, err error)

CreateNetwork creates a network with the configuration of the passed in parameters on the passed in node. It returns the body from the API response and any HTTP error the API returns.

func (*Client) CreateNewDisk

func (c *Client) CreateNewDisk(ctx context.Context, vmr *VmRef, disk string, volume string) (exitStatus interface{}, err error)

CreateNewDisk - This method allows simpler disk creation for direct client users It should work for any existing container and virtual machine

func (*Client) CreatePool deprecated

func (c *Client) CreatePool(poolid string, comment string) error

Deprecated: use ConfigPool.Create() instead

func (*Client) CreateQemuIPSet

func (c *Client) CreateQemuIPSet(ctx context.Context, vmr *VmRef, params map[string]interface{}) (exitStatus interface{}, err error)

CreateQemuIPSet - Create new IPSet

func (*Client) CreateQemuSnapshot

func (c *Client) CreateQemuSnapshot(vmr *VmRef, snapshotName string) (exitStatus string, err error)

DEPRECATED superseded by CreateSnapshot()

func (*Client) CreateQemuVm

func (c *Client) CreateQemuVm(ctx context.Context, node NodeName, vmParams map[string]interface{}) (exitStatus string, err error)

Deprecated use ConfigQemu.Create() instead

func (*Client) CreateSDNDNS

func (c *Client) CreateSDNDNS(ctx context.Context, params map[string]interface{}) error

CreateSDNDNS creates a new SDN DNS in the cluster

func (*Client) CreateSDNSubnet

func (c *Client) CreateSDNSubnet(ctx context.Context, vnet string, params map[string]interface{}) error

CreateSDNSubnet creates a new SDN DNS in the cluster

func (*Client) CreateSDNVNet

func (c *Client) CreateSDNVNet(ctx context.Context, params map[string]interface{}) error

CreateSDNVNet creates a new SDN DNS in the cluster

func (*Client) CreateSDNZone

func (c *Client) CreateSDNZone(ctx context.Context, params map[string]interface{}) error

CreateSDNZone creates a new SDN zone in the cluster

func (*Client) CreateStorage

func (c *Client) CreateStorage(ctx context.Context, params map[string]interface{}) error

func (*Client) CreateTemplate

func (c *Client) CreateTemplate(ctx context.Context, vmr *VmRef) error

func (*Client) CreateVMDisk

func (c *Client) CreateVMDisk(
	ctx context.Context,
	nodeName NodeName,
	storageName string,
	fullDiskName string,
	diskParams map[string]interface{},
) error

CreateVMDisk - Create single disk for VM on host node.

func (*Client) CreateVNCProxy

func (c *Client) CreateVNCProxy(ctx context.Context, vmr *VmRef, params map[string]interface{}) (vncProxyRes map[string]interface{}, err error)

CreateVNCProxy - Creates a TCP VNC proxy connections

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, url string) (err error)

Makes a DELETE request without waiting on proxmox for the task to complete. It returns the HTTP error as 'err'.

func (*Client) DeleteAcmeAccount

func (c *Client) DeleteAcmeAccount(ctx context.Context, id string) (exitStatus string, err error)

func (*Client) DeleteAcmePlugin

func (c *Client) DeleteAcmePlugin(ctx context.Context, id string) (err error)

func (*Client) DeleteMetricServer

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

func (*Client) DeleteNetwork

func (c *Client) DeleteNetwork(ctx context.Context, node string, iface string) (exitStatus string, err error)

DeleteNetwork deletes the network with the passed in iface name on the passed in node. It returns the body from the API response and any HTTP error the API returns.

func (*Client) DeletePool deprecated

func (c *Client) DeletePool(poolid string) error

Deprecated: use PoolName.Delete() instead

func (*Client) DeleteQemuIPSet

func (c *Client) DeleteQemuIPSet(ctx context.Context, vmr *VmRef, IPSetName string) (exitStatus interface{}, err error)

DeleteQemuIPSet - Delete IPSet

func (*Client) DeleteQemuIPSetNetwork

func (c *Client) DeleteQemuIPSetNetwork(ctx context.Context, vmr *VmRef, IPSetName string, network string, params map[string]interface{}) (exitStatus interface{}, err error)

DeleteQemuIPSetNetwork - Remove IP or Network from IPSet.

func (*Client) DeleteQemuSnapshot

func (c *Client) DeleteQemuSnapshot(vmr *VmRef, snapshotName string) (exitStatus string, err error)

DEPRECATED superseded by DeleteSnapshot()

func (*Client) DeleteSDNDNS

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

DeleteSDNDNS deletes an existing SDN DNS in the cluster

func (*Client) DeleteSDNSubnet

func (c *Client) DeleteSDNSubnet(ctx context.Context, vnet, name string) error

DeleteSDNSubnet deletes an existing SDN DNS in the cluster

func (*Client) DeleteSDNVNet

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

DeleteSDNVNet deletes an existing SDN DNS in the cluster

func (*Client) DeleteSDNZone

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

DeleteSDNZone deletes an existing SDN zone in the cluster

func (*Client) DeleteStorage

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

func (*Client) DeleteVMDisks

func (c *Client) DeleteVMDisks(
	ctx context.Context,
	node NodeName,
	disks []string,
) error

DeleteVMDisks - Delete VM disks from host node. By default the VM disks are deleted when the VM is deleted, so mainly this is used to delete the disks in case VM creation didn't complete.

func (*Client) DeleteVm deprecated

func (c *Client) DeleteVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

Deprecated: use VmRef.Delete() instead.

func (*Client) DeleteVmParams

func (c *Client) DeleteVmParams(ctx context.Context, vmr *VmRef, params map[string]interface{}) (exitStatus string, err error)

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(ctx context.Context, vmr *VmRef, storageName string, volumeName string) (exitStatus interface{}, err error)

DeleteVolume - Delete volume

func (*Client) DeleteWithTask

func (c *Client) DeleteWithTask(ctx context.Context, url string) (exitStatus string, err error)

Makes a DELETE request and waits on proxmox for the task to complete. It returns the status of the test as 'exitStatus' and the HTTP error as 'err'.

func (*Client) EnableStorage

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

storage

func (*Client) GetAcmeAccountConfig

func (c *Client) GetAcmeAccountConfig(ctx context.Context, id string) (config map[string]interface{}, err error)

func (*Client) GetAcmeAccountList

func (c *Client) GetAcmeAccountList(ctx context.Context) (accounts map[string]interface{}, err error)

ACME Account

func (*Client) GetAcmeDirectoriesUrl

func (c *Client) GetAcmeDirectoriesUrl(ctx context.Context) (url []string, err error)

ACME

func (*Client) GetAcmePluginConfig

func (c *Client) GetAcmePluginConfig(ctx context.Context, id string) (config map[string]interface{}, err error)

func (*Client) GetAcmePluginList

func (c *Client) GetAcmePluginList(ctx context.Context) (accounts map[string]interface{}, err error)

ACME Plugin

func (*Client) GetAcmeTosUrl

func (c *Client) GetAcmeTosUrl(ctx context.Context) (url string, err error)

func (*Client) GetExecStatus

func (c *Client) GetExecStatus(ctx context.Context, vmr *VmRef, pid string) (status map[string]interface{}, err error)

GetExecStatus - Gets the status of the given pid started by the guest-agent

func (*Client) GetHAGroupByName

func (c *Client) GetHAGroupByName(ctx context.Context, GroupName string) (*HAGroup, error)

func (*Client) GetHAGroupList

func (c *Client) GetHAGroupList(ctx context.Context) (haGroups []HAGroup, err error)

func (*Client) GetItemConfig

func (c *Client) GetItemConfig(ctx context.Context, url, text, message string, ignore ...errorIgnore) (config map[string]any, err error)

func (*Client) GetItemConfigInterfaceArray

func (c *Client) GetItemConfigInterfaceArray(ctx context.Context, url, text, message string) ([]interface{}, error)

func (*Client) GetItemConfigMapStringInterface

func (c *Client) GetItemConfigMapStringInterface(ctx context.Context, url, text, message string, ignore ...errorIgnore) (map[string]any, error)

Shared

func (*Client) GetItemConfigString

func (c *Client) GetItemConfigString(ctx context.Context, url, text, message string, ignore ...errorIgnore) (string, error)

func (*Client) GetItemList

func (c *Client) GetItemList(ctx context.Context, url string) (list map[string]interface{}, err error)

func (*Client) GetItemListInterfaceArray

func (c *Client) GetItemListInterfaceArray(ctx context.Context, url string) ([]interface{}, error)

func (*Client) GetJsonRetryable

func (c *Client) GetJsonRetryable(ctx context.Context, url string, data *map[string]any, tries int, ignore ...errorIgnore) error

func (*Client) GetMetricServerConfig

func (c *Client) GetMetricServerConfig(ctx context.Context, id string) (config map[string]interface{}, err error)

Metrics

func (*Client) GetMetricsServerList

func (c *Client) GetMetricsServerList(ctx context.Context) (metricServers map[string]interface{}, err error)

func (*Client) GetNetworkInterface

func (c *Client) GetNetworkInterface(ctx context.Context, node string, iface string) (exitStatus string, err error)

GetNetworkInterface gets a json encoded object containing the configuration of the network interface with the name passed in as iface from the passed in node. It returns the body from the API response and any HTTP error the API returns.

func (*Client) GetNetworkList

func (c *Client) GetNetworkList(ctx context.Context, node string, typeFilter string) (exitStatus string, err error)

GetNetworkList gets a json encoded list of currently configured network interfaces on the passed in node. The typeFilter parameter can be used to filter by interface type. Pass in the empty string "" for typeFilter to list all network interfaces on the node. It returns the body from the API response and any HTTP error the API returns.

func (*Client) GetNextID

func (c *Client) GetNextID(ctx context.Context, startID *GuestID) (GuestID, error)

GetNextID - get next free GuestID

func (*Client) GetNextIdNoCheck

func (c *Client) GetNextIdNoCheck(ctx context.Context, startID *GuestID) (GuestID, error)

GetNextIdNoCheck - get next free GuestID without validating the input

func (*Client) GetNodeList

func (c *Client) GetNodeList(ctx context.Context) (list map[string]interface{}, err error)

func (*Client) GetPoolInfo deprecated

func (c *Client) GetPoolInfo(ctx context.Context, poolid string) (poolInfo map[string]interface{}, err error)

Deprecated: use PoolName.Get() instead

func (*Client) GetPoolList

func (c *Client) GetPoolList(ctx context.Context) (pools map[string]interface{}, err error)

Still used by Terraform. Deprecated: use ListPoolsWithComments() instead

func (*Client) GetQemuFirewallOptions

func (c *Client) GetQemuFirewallOptions(ctx context.Context, vmr *VmRef) (firewallOptions map[string]interface{}, err error)

GetQemuFirewallOptions - get VM firewall options.

func (*Client) GetQemuIPSet

func (c *Client) GetQemuIPSet(ctx context.Context, vmr *VmRef) (ipsets map[string]interface{}, err error)

GetQemuIPSet - List IPSets

func (*Client) GetResourceList

func (c *Client) GetResourceList(ctx context.Context, resourceType string) (list []interface{}, err error)

TODO this func should not be exported

func (*Client) GetSDNDNS

func (c *Client) GetSDNDNS(ctx context.Context, name string) (dns map[string]interface{}, err error)

GetSDNDNS returns details about the DNS entry whose name was provided. An error is returned if the zone doesn't exist. The returned zone can be unmarshalled into a ConfigSDNDNS struct.

func (*Client) GetSDNDNSs

func (c *Client) GetSDNDNSs(ctx context.Context, typeFilter string) (list map[string]interface{}, err error)

GetSDNDNSs returns a list of all DNS definitions in the "data" element of the returned map.

func (*Client) GetSDNSubnet

func (c *Client) GetSDNSubnet(ctx context.Context, vnet, name string) (subnet map[string]interface{}, err error)

GetSDNSubnet returns details about the Subnet entry whose name was provided. An error is returned if the zone doesn't exist. The returned map["data"] section can be unmarshalled into a ConfigSDNSubnet struct.

func (*Client) GetSDNSubnets

func (c *Client) GetSDNSubnets(ctx context.Context, vnet string) (list map[string]interface{}, err error)

GetSDNSubnets returns a list of all Subnet definitions in the "data" element of the returned map.

func (*Client) GetSDNVNet

func (c *Client) GetSDNVNet(ctx context.Context, name string) (dns map[string]interface{}, err error)

GetSDNVNet returns details about the DNS entry whose name was provided. An error is returned if the zone doesn't exist. The returned zone can be unmarshalled into a ConfigSDNVNet struct.

func (*Client) GetSDNVNets

func (c *Client) GetSDNVNets(ctx context.Context, pending bool) (list map[string]interface{}, err error)

GetSDNVNets returns a list of all VNet definitions in the "data" element of the returned map.

func (*Client) GetSDNZone

func (c *Client) GetSDNZone(ctx context.Context, zoneName string) (zone map[string]interface{}, err error)

GetSDNZone returns details about the zone whose name was provided. An error is returned if the zone doesn't exist. The returned zone can be unmarshalled into a ConfigSDNZone struct.

func (*Client) GetSDNZones

func (c *Client) GetSDNZones(ctx context.Context, pending bool, typeFilter string) (list map[string]interface{}, err error)

GetSDNZones returns a list of all the SDN zones defined in the cluster.

func (*Client) GetStorageConfig

func (c *Client) GetStorageConfig(ctx context.Context, id string) (config map[string]interface{}, err error)

func (*Client) GetStorageContent

func (c *Client) GetStorageContent(ctx context.Context, storageName string, node NodeName) (data map[string]interface{}, err error)

func (*Client) GetStorageList

func (c *Client) GetStorageList(ctx context.Context) (metricServers map[string]interface{}, err error)

func (*Client) GetStorageStatus

func (c *Client) GetStorageStatus(ctx context.Context, vmr *VmRef, storageName string) (storageStatus map[string]interface{}, err error)

func (*Client) GetTaskExitstatus

func (c *Client) GetTaskExitstatus(ctx context.Context, taskUpid string) (exitStatus interface{}, err error)

func (*Client) GetUserPermissions

func (c *Client) GetUserPermissions(ctx context.Context, id UserID, path string) (permissions []string, err error)

permissions check

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context) (Version, error)

Updates the client's cached version information and returns it.

func (*Client) GetVmAgentNetworkInterfaces

func (c *Client) GetVmAgentNetworkInterfaces(ctx context.Context, vmr *VmRef) ([]AgentNetworkInterface, error)

deprecated use *VmRef.GetAgentInformation() instead

func (*Client) GetVmConfig

func (c *Client) GetVmConfig(ctx context.Context, vmr *VmRef) (vmConfig map[string]interface{}, err error)

TODO will be deprecated: use NewRawConfigQemuFromApi() or NewRawConfigLXCFromAPI() instead

func (*Client) GetVmInfo

func (c *Client) GetVmInfo(ctx context.Context, vmr *VmRef) (vmInfo map[string]interface{}, err error)

func (*Client) GetVmList

func (c *Client) GetVmList(ctx context.Context) (map[string]interface{}, error)

TODO deprecate once nothing uses this anymore, use ListGuests() instead

func (*Client) GetVmRefById

func (c *Client) GetVmRefById(ctx context.Context, ID GuestID) (vmr *VmRef, err error)

func (*Client) GetVmRefByName

func (c *Client) GetVmRefByName(ctx context.Context, name GuestName) (vmr *VmRef, err error)

func (*Client) GetVmRefsByName

func (c *Client) GetVmRefsByName(ctx context.Context, name GuestName) (vmrs []*VmRef, err error)

func (*Client) GetVmSpiceProxy

func (c *Client) GetVmSpiceProxy(ctx context.Context, vmr *VmRef) (vmSpiceProxy map[string]interface{}, err error)

func (*Client) GetVmState deprecated

func (c *Client) GetVmState(ctx context.Context, vmr *VmRef) (vmState map[string]interface{}, err error)

Deprecated: *VmRef.GetRawGuestStatus() instead

func (*Client) HandleTaskError

func (c *Client) HandleTaskError(resp *http.Response) (exitStatus string)

HandleTaskError reads the body from the passed in HTTP response and closes it. It returns the body of the passed in HTTP response.

func (*Client) HibernateVm

func (c *Client) HibernateVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) ListQemuSnapshot

func (c *Client) ListQemuSnapshot(vmr *VmRef) (taskResponse map[string]interface{}, exitStatus string, err error)

DEPRECATED superseded by ListSnapshots()

func (*Client) Login

func (c *Client) Login(ctx context.Context, username string, password string, otp string) (err error)

func (*Client) MigrateNode

func (c *Client) MigrateNode(ctx context.Context, vmr *VmRef, newTargetNode NodeName, online bool) (exitStatus interface{}, err error)

MigrateNode - Migrate a VM Deprecated: use VmRef.Migrate() instead

func (*Client) MonitorCmd

func (c *Client) MonitorCmd(ctx context.Context, vmr *VmRef, command string) (monitorRes map[string]interface{}, err error)

func (*Client) MoveLxcDisk

func (c *Client) MoveLxcDisk(ctx context.Context, vmr *VmRef, disk string, storage string) (exitStatus interface{}, err error)

func (*Client) MoveQemuDisk

func (c *Client) MoveQemuDisk(vmr *VmRef, disk string, storage string) (exitStatus interface{}, err error)

DEPRECATED use MoveQemuDisk() instead. MoveQemuDisk - Move a disk from one storage to another

func (*Client) MoveQemuDiskToVM

func (c *Client) MoveQemuDiskToVM(ctx context.Context, vmrSource *VmRef, disk string, vmrTarget *VmRef) (exitStatus interface{}, err error)

MoveQemuDiskToVM - Move a disk to a different VM, using the same storage

func (*Client) PauseVm

func (c *Client) PauseVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) Post

func (c *Client) Post(ctx context.Context, Params map[string]interface{}, url string) (err error)

Makes a POST request without waiting on proxmox for the task to complete. It returns the HTTP error as 'err'.

func (*Client) PostWithTask

func (c *Client) PostWithTask(ctx context.Context, Params map[string]interface{}, url string) (exitStatus string, err error)

Makes a POST request and waits on proxmox for the task to complete. It returns the status of the test as 'exitStatus' and the HTTP error as 'err'.

func (*Client) Put

func (c *Client) Put(ctx context.Context, Params map[string]interface{}, url string) (err error)

Makes a PUT request without waiting on proxmox for the task to complete. It returns the HTTP error as 'err'.

func (*Client) PutWithTask

func (c *Client) PutWithTask(ctx context.Context, Params map[string]interface{}, url string) (exitStatus string, err error)

Makes a PUT request and waits on proxmox for the task to complete. It returns the status of the test as 'exitStatus' and the HTTP error as 'err'.

func (*Client) QemuAgentExec

func (c *Client) QemuAgentExec(ctx context.Context, vmr *VmRef, params map[string]interface{}) (result map[string]interface{}, err error)

QemuAgentExec - Executes the given command in the vm via the guest-agent and returns an object with the pid.

func (*Client) QemuAgentFileWrite

func (c *Client) QemuAgentFileWrite(ctx context.Context, vmr *VmRef, params map[string]interface{}) (err error)

QemuAgentFileWrite - Writes the given file via guest agent.

func (*Client) QemuAgentPing

func (c *Client) QemuAgentPing(ctx context.Context, vmr *VmRef) (pingRes map[string]interface{}, err error)

QemuAgentPing - Execute ping.

func (*Client) QemuAgentSetUserPassword

func (c *Client) QemuAgentSetUserPassword(ctx context.Context, vmr *VmRef, params map[string]interface{}) (result map[string]interface{}, err error)

QemuAgentSetUserPassword - Sets the password for the given user to the given password.

func (*Client) ReadVMHA

func (c *Client) ReadVMHA(ctx context.Context, vmr *VmRef) (err error)

func (*Client) RebootNode

func (c *Client) RebootNode(ctx context.Context, node string) (exitStatus string, err error)

func (*Client) RebootVm

func (c *Client) RebootVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) RefreshPermissions

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

RefreshPermissions fetches the permissions from the API and updates the cache.

func (*Client) ResetVm

func (c *Client) ResetVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) ResizeQemuDisk

func (c *Client) ResizeQemuDisk(ctx context.Context, vmr *VmRef, disk string, moreSizeGB int) (exitStatus interface{}, err error)

ResizeQemuDisk allows the caller to increase the size of a disk by the indicated number of gigabytes TODO Deprecate once LXC is able to resize disk by itself (qemu can already do this)

func (*Client) ResizeQemuDiskRaw

func (c *Client) ResizeQemuDiskRaw(ctx context.Context, vmr *VmRef, disk string, size string) (exitStatus interface{}, err error)

ResizeQemuDiskRaw allows the caller to provide the raw resize string to be send to proxmox. See the proxmox API documentation for full information, but the short version is if you prefix your desired size with a '+' character it will ADD size to the disk. If you just specify the size by itself it will do an absolute resizing to the specified size. Permitted suffixes are K, M, G, T to indicate order of magnitude (kilobyte, megabyte, etc). Decrease of disk size is not permitted. TODO Deprecate once LXC is able to resize disk by itself (qemu can already do this)

func (*Client) ResumeVm

func (c *Client) ResumeVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) RevertNetwork

func (c *Client) RevertNetwork(ctx context.Context, node string) (exitStatus string, err error)

RevertNetwork reverts the pending network configuration on the passed in node. It returns the body from the API response and any HTTP error the API returns.

func (*Client) RollbackQemuVm

func (c *Client) RollbackQemuVm(vmr *VmRef, snapshot string) (exitStatus string, err error)

DEPRECATED superseded by RollbackSnapshot()

func (*Client) Sendkey

func (c *Client) Sendkey(ctx context.Context, vmr *VmRef, qmKey string) error

func (*Client) SetAPIToken

func (c *Client) SetAPIToken(userID, token string)

SetAPIToken specifies a pair of user identifier and token UUID to use for authenticating API calls. If this is set, a ticket from calling `login` will not be used.

- `userID` is expected to be in the form `USER@REALM!TOKENID` - `token` is just the UUID you get when initially creating the token

See https://pve.proxmox.com/wiki/User_Management#pveum_tokens

func (*Client) SetLxcConfig

func (c *Client) SetLxcConfig(ctx context.Context, vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error)

SetLxcConfig - send config options

func (*Client) SetQemuFirewallOptions

func (c *Client) SetQemuFirewallOptions(ctx context.Context, vmr *VmRef, fwOptions map[string]interface{}) (exitStatus interface{}, err error)

SetQemuFirewallOptions - Set Firewall options.

func (*Client) SetTicket

func (c *Client) SetTicket(ticket, csrfPreventionToken string)

SetTicket let's set directly ticket and csrfPreventionToken obtained in a different way, for example using OIDC identity provider

Parameters: - `ticket` - `csrfPreventionToken`

Docs: https://pve.proxmox.com/wiki/Proxmox_VE_API#Authentication

func (*Client) SetVmConfig

func (c *Client) SetVmConfig(vmr *VmRef, params map[string]interface{}) (exitStatus interface{}, err error)

DEPRECATED SetVmConfig - send config options

func (*Client) ShutdownNode

func (c *Client) ShutdownNode(ctx context.Context, node string) (exitStatus string, err error)

func (*Client) ShutdownVm

func (c *Client) ShutdownVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) StartVm

func (c *Client) StartVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

func (*Client) StatusChangeVm

func (c *Client) StatusChangeVm(ctx context.Context, vmr *VmRef, params map[string]interface{}, setStatus string) (exitStatus string, err error)

func (*Client) StopVm deprecated

func (c *Client) StopVm(ctx context.Context, vmr *VmRef) (exitStatus string, err error)

Deprecated: use VmRef.Stop() instead.

func (c *Client) Unlink(ctx context.Context, node string, ID GuestID, diskIds string, forceRemoval bool) (exitStatus string, err error)

Unlink - Unlink (detach) a set of disks from a VM. Reference: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/unlink

func (*Client) UpdateAcmeAccountEmails

func (c *Client) UpdateAcmeAccountEmails(ctx context.Context, id, emails string) (exitStatus string, err error)

func (*Client) UpdateAcmePlugin

func (c *Client) UpdateAcmePlugin(ctx context.Context, id string, params map[string]interface{}) error

func (*Client) UpdateItemReturnStatus

func (c *Client) UpdateItemReturnStatus(ctx context.Context, params map[string]interface{}, url string) (exitStatus string, err error)

UpdateItemReturnStatus updates an item on the Proxmox API. It returns the body of the HTTP response and any HTTP error occurred during the request.

func (*Client) UpdateMetricServer

func (c *Client) UpdateMetricServer(ctx context.Context, id string, params map[string]interface{}) error

func (*Client) UpdateNetwork

func (c *Client) UpdateNetwork(ctx context.Context, node string, iface string, params map[string]interface{}) (exitStatus string, err error)

UpdateNetwork updates the network corresponding to the passed in interface name on the passed in node with the configuration in the passed in parameters. It returns the body from the API response and any HTTP error the API returns.

func (*Client) UpdatePoolComment deprecated

func (c *Client) UpdatePoolComment(poolid string, comment string) error

Deprecated: use ConfigPool.Update() instead

func (*Client) UpdateSDNDNS

func (c *Client) UpdateSDNDNS(ctx context.Context, id string, params map[string]interface{}) error

UpdateSDNDNS updates the given DNS with the provided parameters

func (*Client) UpdateSDNSubnet

func (c *Client) UpdateSDNSubnet(ctx context.Context, vnet, id string, params map[string]interface{}) error

UpdateSDNSubnet updates the given DNS with the provided parameters

func (*Client) UpdateSDNVNet

func (c *Client) UpdateSDNVNet(ctx context.Context, id string, params map[string]interface{}) error

UpdateSDNVNet updates the given DNS with the provided parameters

func (*Client) UpdateSDNZone

func (c *Client) UpdateSDNZone(ctx context.Context, id string, params map[string]interface{}) error

UpdateSDNZone updates the given zone with the provided parameters

func (*Client) UpdateStorage

func (c *Client) UpdateStorage(ctx context.Context, id string, params map[string]interface{}) error

func (*Client) UpdateVMHA

func (c *Client) UpdateVMHA(ctx context.Context, vmr *VmRef, haState string, haGroup string) (exitStatus interface{}, err error)

func (*Client) UpdateVMPool

func (c *Client) UpdateVMPool(ctx context.Context, vmr *VmRef, pool string) (exitStatus interface{}, err error)

Still used by Terraform. Deprecated: use ConfigQemu.Update() instead

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, node string, storage string, contentType string, filename string, file io.Reader) error

func (*Client) UploadLargeFile

func (c *Client) UploadLargeFile(ctx context.Context, node string, storage string, contentType string, filename string, filesize int64, file io.Reader) error

func (*Client) VMIdExists deprecated

func (c *Client) VMIdExists(ctx context.Context, guestID GuestID) (exists bool, err error)

VMIdExists - If you pass an VMID that exists it will return true, otherwise it wil return false.

Deprecated: use GuestID.Exists() instead.

func (*Client) Version

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

Returns the Client's cached version if it exists, otherwise fetches the version from the API.

func (*Client) VzDump

func (c *Client) VzDump(ctx context.Context, vmr *VmRef, params map[string]interface{}) (exitStatus interface{}, err error)

VzDump - Create backup

func (*Client) WaitForCompletion

func (c *Client) WaitForCompletion(ctx context.Context, taskResponse map[string]interface{}) (waitExitStatus string, err error)

WaitForCompletion - poll the API for task completion

type ClientNew

type ClientNew interface {
	// contains filtered or unexported methods
}

type CloneLinked

type CloneLinked struct {
	Node NodeName   `json:"node"`
	ID   *GuestID   `json:"id,omitempty"`   // Optional
	Name *GuestName `json:"name,omitempty"` // Optional
	Pool *PoolName  `json:"pool,omitempty"` // Optional
}

Linked Clone in the same for both LXC and QEMU

func (CloneLinked) Validate

func (linked CloneLinked) Validate() (err error)

type CloneLxcFull

type CloneLxcFull struct {
	Node    NodeName   `json:"node"`
	ID      *GuestID   `json:"id,omitempty"`      // Optional
	Name    *GuestName `json:"name,omitempty"`    // Optional
	Pool    *PoolName  `json:"pool,omitempty"`    // Optional
	Storage *string    `json:"storage,omitempty"` // Optional // TODO replace one we have a type for it
}

func (CloneLxcFull) Validate

func (full CloneLxcFull) Validate() (err error)

type CloneLxcTarget

type CloneLxcTarget struct {
	Full   *CloneLxcFull
	Linked *CloneLinked
}

func (CloneLxcTarget) Validate

func (target CloneLxcTarget) Validate() error

type CloneQemuFull

type CloneQemuFull struct {
	Node          NodeName        `json:"node"`
	ID            *GuestID        `json:"id,omitempty"`      // Optional
	Name          *GuestName      `json:"name,omitempty"`    // Optional
	Pool          *PoolName       `json:"pool,omitempty"`    // Optional
	Storage       *string         `json:"storage,omitempty"` // Optional // TODO replace one we have a type for it
	StorageFormat *QemuDiskFormat `json:"format,omitempty"`  // Optional
}

func (CloneQemuFull) Validate

func (full CloneQemuFull) Validate() (err error)

type CloneQemuTarget

type CloneQemuTarget struct {
	Full   *CloneQemuFull `json:"full,omitempty"`
	Linked *CloneLinked   `json:"linked,omitempty"`
}

func (CloneQemuTarget) Validate

func (target CloneQemuTarget) Validate() error

type CloudInit

type CloudInit struct {
	Custom            *CloudInitCustom           `json:"cicustom,omitempty"`
	DNS               *GuestDNS                  `json:"dns,omitempty"`
	NetworkInterfaces CloudInitNetworkInterfaces `json:"ipconfig,omitempty"`
	PublicSSHkeys     *[]AuthorizedKey           `json:"sshkeys,omitempty"`
	UpgradePackages   *bool                      `json:"ciupgrade,omitempty"`
	UserPassword      *string                    `json:"userpassword,omitempty"` // TODO custom type
	Username          *string                    `json:"username,omitempty"`     // TODO custom type
}

func (CloudInit) Validate

func (ci CloudInit) Validate(version Version) error

type CloudInitCustom

type CloudInitCustom struct {
	Meta    *CloudInitSnippet `json:"meta,omitempty"`
	Network *CloudInitSnippet `json:"network,omitempty"`
	User    *CloudInitSnippet `json:"user,omitempty"`
	Vendor  *CloudInitSnippet `json:"vendor,omitempty"`
}

func (CloudInitCustom) String

func (ci CloudInitCustom) String() string

func (CloudInitCustom) Validate

func (ci CloudInitCustom) Validate() (err error)

type CloudInitIPv4Config

type CloudInitIPv4Config struct {
	Address *IPv4CIDR    `json:"address,omitempty"`
	DHCP    bool         `json:"dhcp,omitempty"`
	Gateway *IPv4Address `json:"gateway,omitempty"`
}

func (CloudInitIPv4Config) String

func (config CloudInitIPv4Config) String() string

func (CloudInitIPv4Config) Validate

func (config CloudInitIPv4Config) Validate() error

type CloudInitIPv6Config

type CloudInitIPv6Config struct {
	Address *IPv6CIDR    `json:"address,omitempty"`
	Gateway *IPv6Address `json:"gateway,omitempty"`
	DHCP    bool         `json:"dhcp,omitempty"`
	SLAAC   bool         `json:"slaac,omitempty"`
}

func (CloudInitIPv6Config) String

func (config CloudInitIPv6Config) String() string

func (CloudInitIPv6Config) Validate

func (config CloudInitIPv6Config) Validate() error

type CloudInitNetworkConfig

type CloudInitNetworkConfig struct {
	IPv4 *CloudInitIPv4Config `json:"ip4,omitempty"`
	IPv6 *CloudInitIPv6Config `json:"ip6,omitempty"`
}

func (CloudInitNetworkConfig) Validate

func (config CloudInitNetworkConfig) Validate() (err error)

type CloudInitNetworkInterfaces

type CloudInitNetworkInterfaces map[QemuNetworkInterfaceID]CloudInitNetworkConfig

func (CloudInitNetworkInterfaces) Validate

func (interfaces CloudInitNetworkInterfaces) Validate() (err error)

type CloudInitSnippet

type CloudInitSnippet struct {
	FilePath CloudInitSnippetPath `json:"path,omitempty"`
	Storage  string               `json:"storage,omitempty"` // TODO custom type (storage)
}

If either Storage or FilePath is empty, the snippet will be removed

func (CloudInitSnippet) String

func (config CloudInitSnippet) String() string

func (CloudInitSnippet) Validate

func (ci CloudInitSnippet) Validate() error

type CloudInitSnippetPath

type CloudInitSnippetPath string

func (CloudInitSnippetPath) Validate

func (path CloudInitSnippetPath) Validate() error

type ConfigAcmeAccount

type ConfigAcmeAccount struct {
	Name      string   `json:"name"`
	Contact   []string `json:"contact"`
	Directory string   `json:"directory"`
	Tos       bool     `json:"tos,omitempty"`
}

Acme Account options for the Proxmox API

func NewConfigAcmeAccountFromApi

func NewConfigAcmeAccountFromApi(ctx context.Context, id string, client *Client) (config *ConfigAcmeAccount, err error)

func NewConfigAcmeAccountFromJson

func NewConfigAcmeAccountFromJson(input []byte) (config *ConfigAcmeAccount, err error)

func (ConfigAcmeAccount) CreateAcmeAccount

func (config ConfigAcmeAccount) CreateAcmeAccount(ctx context.Context, acmeId string, client *Client) (err error)

type ConfigAcmePlugin

type ConfigAcmePlugin struct {
	ID              string   `json:"pluginid"`
	API             string   `json:"api"`
	Data            string   `json:"data,omitempty"`
	Enable          bool     `json:"enable"`
	Nodes           []string `json:"nodes,omitempty"`
	ValidationDelay int      `json:"validation-delay"`
}

Acme Plugin options for the Proxmox API

func NewConfigAcmePluginFromApi

func NewConfigAcmePluginFromApi(ctx context.Context, id string, client *Client) (config *ConfigAcmePlugin, err error)

func NewConfigAcmePluginFromJson

func NewConfigAcmePluginFromJson(input []byte) (config *ConfigAcmePlugin, err error)

func (ConfigAcmePlugin) CreateAcmePlugin

func (config ConfigAcmePlugin) CreateAcmePlugin(ctx context.Context, client *Client) (err error)

func (ConfigAcmePlugin) SetAcmePlugin

func (config ConfigAcmePlugin) SetAcmePlugin(ctx context.Context, pluginId string, client *Client) (err error)

func (ConfigAcmePlugin) UpdateAcmePlugin

func (config ConfigAcmePlugin) UpdateAcmePlugin(ctx context.Context, client *Client) (err error)

type ConfigContent_Iso

type ConfigContent_Iso struct {
	Checksum          string
	ChecksumAlgorithm string
	DownloadUrl       string
	Filename          string
	Node              string
	Storage           string
}

func (ConfigContent_Iso) Validate

func (content ConfigContent_Iso) Validate() (err error)

Return an error if the one of the values is empty.

type ConfigContent_Template

type ConfigContent_Template struct {
	Node     string
	Storage  string
	Template string
}

func (ConfigContent_Template) Validate

func (content ConfigContent_Template) Validate() (err error)

Return an error if the one of the values is empty.

type ConfigGroup

type ConfigGroup struct {
	Name    GroupName `json:"name"`
	Comment string    `json:"comment,omitempty"`
	// Setting the Members will update the group membership to only include the specified members.
	Members *[]UserID `json:"members,omitempty"`
}

func NewConfigGroupFromApi

func NewConfigGroupFromApi(ctx context.Context, groupId GroupName, client *Client) (*ConfigGroup, error)

func (ConfigGroup) Create

func (config ConfigGroup) Create(ctx context.Context, client *Client) error

Creates the specified group

func (ConfigGroup) Set

func (config ConfigGroup) Set(ctx context.Context, client *Client) (err error)

Created or updates the specified group

func (ConfigGroup) Update

func (config ConfigGroup) Update(ctx context.Context, client *Client) error

Updates the specified group

func (ConfigGroup) Validate

func (config ConfigGroup) Validate(create bool) (err error)

Validates all items and sub items of the ConfigGroup

type ConfigLXC

type ConfigLXC struct {
	Architecture    CpuArchitecture   `json:"architecture"` // only returned
	BootMount       *LxcBootMount     `json:"boot_mount,omitempty"`
	CPU             *LxcCPU           `json:"cpu,omitempty"`
	CreateOptions   *LxcCreateOptions `json:"create,omitempty"` // only used during creation, never returned
	DNS             *GuestDNS         `json:"dns,omitempty"`
	Description     *string           `json:"description,omitempty"`
	Digest          [sha1.Size]byte   `json:"digest,omitempty"` // only returned.
	Features        *LxcFeatures      `json:"features,omitempty"`
	ID              *GuestID          `json:"id"`               // only used during creation
	Memory          *LxcMemory        `json:"memory,omitempty"` // Never nil when returned
	Mounts          LxcMounts         `json:"mounts,omitempty"`
	Name            *GuestName        `json:"name,omitempty"` // Never nil when returned
	Networks        LxcNetworks       `json:"networks,omitempty"`
	Node            *NodeName         `json:"node,omitempty"` // only used during creation
	OperatingSystem OperatingSystem   `json:"os"`             // only returned
	Pool            *PoolName         `json:"pool,omitempty"`
	Privileged      *bool             `json:"privileged,omitempty"` // only used during creation, defaults to false ,never nil when returned
	Protection      *bool             `json:"protection,omitempty"` // Never nil when returned
	State           *PowerState       `json:"state,omitempty"`
	Swap            *LxcSwap          `json:"swap,omitempty"` // Never nil when returned
	Tags            *Tags             `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

func (ConfigLXC) Create

func (config ConfigLXC) Create(ctx context.Context, c *Client) (*VmRef, error)

func (ConfigLXC) CreateNoCheck

func (config ConfigLXC) CreateNoCheck(ctx context.Context, c *Client) (*VmRef, error)

func (ConfigLXC) Update

func (config ConfigLXC) Update(ctx context.Context, allowRestart bool, vmr *VmRef, c *Client) error

func (ConfigLXC) UpdateNoCheck

func (config ConfigLXC) UpdateNoCheck(ctx context.Context, allowRestart bool, vmr *VmRef, c *Client) error

func (ConfigLXC) Validate

func (config ConfigLXC) Validate(current *ConfigLXC) (err error)

type ConfigLxc

type ConfigLxc struct {
	Ostemplate         string      `json:"ostemplate"`
	Arch               string      `json:"arch"`
	BWLimit            int         `json:"bwlimit,omitempty"`
	Clone              string      `json:"clone,omitempty"`
	CloneStorage       string      `json:"clone-storage,omitempty"`
	CMode              string      `json:"cmode"`
	Console            bool        `json:"console"`
	Cores              int         `json:"cores,omitempty"`
	CPULimit           int         `json:"cpulimit"`
	CPUUnits           int         `json:"cpuunits"`
	Description        string      `json:"description,omitempty"`
	Features           QemuDevice  `json:"features,omitempty"`
	Force              bool        `json:"force,omitempty"`
	Full               bool        `json:"full,omitempty"`
	HaState            string      `json:"hastate,omitempty"`
	HaGroup            string      `json:"hagroup,omitempty"`
	Hookscript         string      `json:"hookscript,omitempty"`
	Hostname           string      `json:"hostname,omitempty"`
	IgnoreUnpackErrors bool        `json:"ignore-unpack-errors,omitempty"`
	Lock               string      `json:"lock,omitempty"`
	Memory             int         `json:"memory"`
	Mountpoints        QemuDevices `json:"mountpoints,omitempty"`
	Nameserver         string      `json:"nameserver,omitempty"`
	Networks           QemuDevices `json:"networks,omitempty"`
	OnBoot             bool        `json:"onboot"`
	OsType             string      `json:"ostype,omitempty"`
	Password           string      `json:"password,omitempty"`
	Pool               *PoolName   `json:"pool,omitempty"`
	Protection         bool        `json:"protection"`
	Restore            bool        `json:"restore,omitempty"`
	RootFs             QemuDevice  `json:"rootfs,omitempty"`
	SearchDomain       string      `json:"searchdomain,omitempty"`
	Snapname           string      `json:"snapname,omitempty"`
	SSHPublicKeys      string      `json:"ssh-public-keys,omitempty"`
	Start              bool        `json:"start"`
	Startup            string      `json:"startup,omitempty"`
	Storage            string      `json:"storage"`
	Swap               int         `json:"swap"`
	Template           bool        `json:"template,omitempty"`
	Tty                int         `json:"tty"`
	Unique             bool        `json:"unique,omitempty"`
	Unprivileged       bool        `json:"unprivileged"`
	Tags               string      `json:"tags"`
	Unused             []string    `json:"unused,omitempty"`
}

LXC options for the Proxmox API

func NewConfigLxc

func NewConfigLxc() ConfigLxc

func NewConfigLxcFromApi

func NewConfigLxcFromApi(ctx context.Context, vmr *VmRef, client *Client) (config *ConfigLxc, err error)

func NewConfigLxcFromJson

func NewConfigLxcFromJson(input []byte) (config ConfigLxc, err error)

func (ConfigLxc) CloneLxc deprecated

func (config ConfigLxc) CloneLxc(ctx context.Context, vmr *VmRef, client *Client) (err error)

Deprecated: use VmRef.CloneLxc() instead

func (ConfigLxc) CreateLxc

func (config ConfigLxc) CreateLxc(ctx context.Context, vmr *VmRef, client *Client) (err error)

create LXC container using the Proxmox API

func (ConfigLxc) UpdateConfig

func (config ConfigLxc) UpdateConfig(ctx context.Context, vmr *VmRef, client *Client) (err error)

type ConfigMetrics

type ConfigMetrics struct {
	Name     string                 `json:"name"`
	Port     int                    `json:"port"`
	Server   string                 `json:"server"`
	Type     string                 `json:"type"` //type key is only used on create
	Enable   bool                   `json:"enable"`
	MTU      int                    `json:"mtu"`
	Timeout  int                    `json:"timeout,omitempty"`
	Graphite *ConfigMetricsGraphite `json:"graphite,omitempty"`
	InfluxDB *ConfigMetricsInfluxDB `json:"influxdb,omitempty"`
}

Metrics options for the Proxmox API

func InstantiateConfigMetrics

func InstantiateConfigMetrics() *ConfigMetrics

func NewConfigMetricsFromApi

func NewConfigMetricsFromApi(ctx context.Context, metricsId string, client *Client) (config *ConfigMetrics, err error)

func NewConfigMetricsFromJson

func NewConfigMetricsFromJson(input []byte) (config *ConfigMetrics, err error)

func (*ConfigMetrics) CreateMetrics

func (config *ConfigMetrics) CreateMetrics(ctx context.Context, client *Client) (err error)

func (*ConfigMetrics) RemoveMetricsNestedStructs

func (config *ConfigMetrics) RemoveMetricsNestedStructs()

func (*ConfigMetrics) SetMetrics

func (config *ConfigMetrics) SetMetrics(ctx context.Context, metricsId string, client *Client) (err error)

func (*ConfigMetrics) UpdateMetrics

func (config *ConfigMetrics) UpdateMetrics(ctx context.Context, client *Client) (err error)

func (*ConfigMetrics) ValidateMetrics

func (config *ConfigMetrics) ValidateMetrics() (err error)

type ConfigMetricsGraphite

type ConfigMetricsGraphite struct {
	Protocol string `json:"protocol"`
	Path     string `json:"path,omitempty"`
}

type ConfigMetricsInfluxDB

type ConfigMetricsInfluxDB struct {
	ApiPathPrefix     string `json:"api-path-prefix,omitempty"`
	Bucket            string `json:"bucket,omitempty"`
	Protocol          string `json:"protocol"`
	MaxBodySize       int    `json:"max-body-size,omitempty"`
	Organization      string `json:"organization,omitempty"`
	Token             string `json:"token,omitempty"` //token key is never returned from api
	VerifyCertificate bool   `json:"verify-certificate"`
}

type ConfigNetwork

type ConfigNetwork struct {
	Iface              string `json:"iface,omitempty"`
	Node               string `json:"node,omitempty"`
	Type               string `json:"type,omitempty"`
	Address            string `json:"address,omitempty"`
	Address6           string `json:"address6,omitempty"`
	Autostart          bool   `json:"autostart,omitempty"`
	BondPrimary        string `json:"bond-primary,omitempty"`
	BondMode           string `json:"bond_mode,omitempty"`
	BondXmitHashPolicy string `json:"bond_xmit_hash_policy,omitempty"`
	BridgePorts        string `json:"bridge_ports,omitempty"`
	BridgeVlanAware    bool   `json:"bridge_vlan_aware,omitempty"`
	CIDR               string `json:"cidr,omitempty"`
	CIDR6              string `json:"cidr6,omitempty"`
	Comments           string `json:"comments,omitempty"`
	Comments6          string `json:"comments6,omitempty"`
	Gateway            string `json:"gateway,omitempty"`
	Gateway6           string `json:"gateway6,omitempty"`
	MTU                int    `json:"mtu,omitempty"`
	Netmask            string `json:"netmask,omitempty"`
	Netmask6           int    `json:"netmask6,omitempty"`
	OVSBonds           string `json:"ovs_bonds,omitempty"`
	OVSBridge          string `json:"ovs_bridge,omitempty"`
	OVSOptions         string `json:"ovs_options,omitempty"`
	OVSPorts           string `json:"ovs_ports,omitempty"`
	OVSTag             int    `json:"ovs_tag,omitempty"`
	Slaves             string `json:"slaves,omitempty"`
	VlanID             int    `json:"vlan-id,omitempty"`
	VlanRawDevice      string `json:"vlan-raw-device,omitempty"`
}

ConfigNetwork maps go variables to API parameters.

func NewConfigNetworkFromJSON

func NewConfigNetworkFromJSON(input []byte) (config *ConfigNetwork, err error)

NewConfigNetworkFromJSON takes in a byte array from a json encoded network configuration and stores it in config. It returns the newly created config with the passed in configuration stored and an error if one occurs unmarshalling the input data.

func (ConfigNetwork) CreateNetwork

func (config ConfigNetwork) CreateNetwork(ctx context.Context, client *Client) (err error)

CreateNetwork creates a network on the Proxmox host with the stored config. It returns an error if the creation of the network fails.

func (ConfigNetwork) UpdateNetwork

func (config ConfigNetwork) UpdateNetwork(ctx context.Context, client *Client) (err error)

UpdateNetwork updates a network on the Proxmox host with the stored config. It returns an error if updating the network fails.

type ConfigPool

type ConfigPool struct {
	Name    PoolName   `json:"name"`
	Comment *string    `json:"comment"` // never nil when returned
	Guests  *[]GuestID `json:"guests"`
}

func (ConfigPool) Create

func (config ConfigPool) Create(ctx context.Context, c *Client) error

func (ConfigPool) CreateNoCheck

func (config ConfigPool) CreateNoCheck(ctx context.Context, c *Client) error

CreateNoCheck creates a new pool without validating the input

func (ConfigPool) Delete

func (config ConfigPool) Delete(ctx context.Context, c *Client) error

Same as PoolName.Delete()

func (ConfigPool) Exists

func (config ConfigPool) Exists(ctx context.Context, c *Client) (bool, error)

Same as PoolName.Exists()

func (ConfigPool) Set

func (config ConfigPool) Set(ctx context.Context, c *Client) error

func (ConfigPool) SetNoCheck

func (config ConfigPool) SetNoCheck(ctx context.Context, c *Client) error

func (ConfigPool) Update

func (config ConfigPool) Update(ctx context.Context, c *Client) error

func (ConfigPool) UpdateNoCheck

func (config ConfigPool) UpdateNoCheck(ctx context.Context, c *Client) error

UpdateNoCheck updates a pool without validating the input

func (ConfigPool) Validate

func (config ConfigPool) Validate() error

type ConfigQemu

type ConfigQemu struct {
	ID               *GuestID              `json:"id,omitempty"`   // Required for creation, cannot be changed
	Node             *NodeName             `json:"node,omitempty"` // Required for creation
	Agent            *QemuGuestAgent       `json:"agent,omitempty"`
	Args             string                `json:"args,omitempty"`
	Bios             string                `json:"bios,omitempty"`
	Boot             string                `json:"boot,omitempty"`     // TODO should be an array of custom enums
	BootDisk         string                `json:"bootdisk,omitempty"` // TODO discuss deprecation? Only returned as it's deprecated in the proxmox api
	CPU              *QemuCPU              `json:"cpu,omitempty"`      // never nil when returned
	CloudInit        *CloudInit            `json:"cloudinit,omitempty"`
	Description      *string               `json:"description,omitempty"` // never nil when returned
	Disks            *QemuStorages         `json:"disks,omitempty"`
	EFIDisk          QemuDevice            `json:"efidisk,omitempty"`   // TODO should be a struct
	FullClone        *int                  `json:"fullclone,omitempty"` // Deprecated
	HaGroup          string                `json:"hagroup,omitempty"`
	HaState          string                `json:"hastate,omitempty"` // TODO should be custom type with enum
	Hookscript       string                `json:"hookscript,omitempty"`
	Hotplug          string                `json:"hotplug,omitempty"`   // TODO should be a struct
	Iso              *IsoFile              `json:"iso,omitempty"`       // Same as Disks.Ide.Disk_2.CdRom.Iso
	LinkedID         *GuestID              `json:"linked_id,omitempty"` // Only returned setting it has no effect
	Machine          string                `json:"machine,omitempty"`   // TODO should be custom type with enum
	Memory           *QemuMemory           `json:"memory,omitempty"`
	Name             *GuestName            `json:"name,omitempty"` // never nil when returned
	Networks         QemuNetworkInterfaces `json:"networks,omitempty"`
	Onboot           *bool                 `json:"onboot,omitempty"`
	Pool             *PoolName             `json:"pool,omitempty"`
	Protection       *bool                 `json:"protection,omitempty"` // never nil when returned
	QemuDisks        QemuDevices           `json:"disk,omitempty"`       // Deprecated use Disks *QemuStorages instead
	QemuIso          string                `json:"qemuiso,omitempty"`    // Deprecated use Iso *IsoFile instead
	QemuKVM          *bool                 `json:"kvm,omitempty"`
	QemuOs           string                `json:"ostype,omitempty"`
	PciDevices       QemuPciDevices        `json:"pci_devices,omitempty"`
	QemuPxe          bool                  `json:"pxe,omitempty"`
	QemuUnusedDisks  QemuDevices           `json:"unused,omitempty"` // TODO should be a struct
	USBs             QemuUSBs              `json:"usbs,omitempty"`
	QemuVga          QemuDevice            `json:"vga,omitempty"`    // TODO should be a struct
	Scsihw           string                `json:"scsihw,omitempty"` // TODO should be custom type with enum
	Serials          SerialInterfaces      `json:"serials,omitempty"`
	Smbios1          string                `json:"smbios1,omitempty"` // TODO should be custom type with enum?
	Startup          string                `json:"startup,omitempty"` // TODO should be a struct?
	Storage          string                `json:"storage,omitempty"` // this value is only used when doing a full clone and is never returned
	TPM              *TpmState             `json:"tpm,omitempty"`
	Tablet           *bool                 `json:"tablet,omitempty"` // never nil when returned
	Tags             *Tags                 `json:"tags,omitempty"`
	RandomnessDevice *VirtIoRNG            `json:"randomness_device,omitempty"`
}

ConfigQemu - Proxmox API QEMU options

func NewConfigQemuFromApi

func NewConfigQemuFromApi(ctx context.Context, vmr *VmRef, client *Client) (config *ConfigQemu, err error)

func NewConfigQemuFromJson

func NewConfigQemuFromJson(input []byte) (config *ConfigQemu, err error)

func (ConfigQemu) CloneVm deprecated

func (config ConfigQemu) CloneVm(ctx context.Context, sourceVmr *VmRef, vmr *VmRef, client *Client) (err error)

CloneVm Example: request

nodes/proxmox1-xx/qemu/1012/clone

newid:145 name:tf-clone1 target:proxmox1-xx full:1 storage:xxx

Deprecated: use VmRef.CloneQemu() instead

func (ConfigQemu) Create

func (config ConfigQemu) Create(ctx context.Context, client *Client) (*VmRef, error)

Create - Tell Proxmox API to make the VM

func (ConfigQemu) CreateQemuEfiParams

func (c ConfigQemu) CreateQemuEfiParams(params map[string]interface{})

Create efi parameter.

func (ConfigQemu) String

func (c ConfigQemu) String() string

func (ConfigQemu) Update

func (config ConfigQemu) Update(ctx context.Context, rebootIfNeeded bool, vmr *VmRef, client *Client) (rebootRequired bool, err error)

func (ConfigQemu) Validate

func (config ConfigQemu) Validate(current *ConfigQemu, version Version) (err error)

type ConfigSDNDNS

type ConfigSDNDNS struct {
	DNS  string `json:"dns"`
	Key  string `json:"key"`
	Type string `json:"type"`
	URL  string `json:"url"`
	TTL  int    `json:"ttl,omitempty"`
	// The SDN Plugin schema contains ReverseV6Mask attribute while the
	// PowerDNS plugin schema contains the ReverseMaskV6 attribute
	// This is probably a bug that crept into the Proxmox implementation.a
	// Checked in libpve-network-perl=0.7.3
	ReverseMaskV6 int `json:"reversemaskv6,omitempty"`
	ReverseV6Mask int `json:"reversev6mask,omitempty"`
	// Digest allows for a form of optimistic locking
	Digest string `json:"digest,omitempty"`
}

ConfigSDNDNS describes the SDN DNS configurable element

func NewConfigSDNDNSFromJson

func NewConfigSDNDNSFromJson(input []byte) (config *ConfigSDNDNS, err error)

func (*ConfigSDNDNS) Create

func (config *ConfigSDNDNS) Create(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNDNS) CreateWithValidate

func (config *ConfigSDNDNS) CreateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNDNS) Update

func (config *ConfigSDNDNS) Update(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNDNS) UpdateWithValidate

func (config *ConfigSDNDNS) UpdateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNDNS) Validate

func (c *ConfigSDNDNS) Validate(ctx context.Context, id string, create bool, client *Client) (err error)

type ConfigSDNSubnet

type ConfigSDNSubnet struct {
	// For creation purposes - Subnet is a CIDR
	// Once a subnet has been created, the Subnet is an identifier with the format
	// "<zone>-<ip>-<mask>"
	Subnet string `json:"subnet"`

	DNSZonePrefix string `json:"dnszoneprefix,omitempty"`
	Gateway       string `json:"gateway,omitempty"`
	SNAT          bool   `json:"snat,omitempty"`

	// Delete is a string of attributes to be deleted from the object
	Delete string `json:"delete,omitempty"`
	// Type must always hold the string "subnet"
	Type string `json:"type"`
	// Digest allows for a form of optimistic locking
	Digest string `json:"digest,omitempty"`
}

func NewConfigSDNSubnetFromJson

func NewConfigSDNSubnetFromJson(input []byte) (config *ConfigSDNSubnet, err error)

NewConfigSDNSubnetFromJSON takes in a byte array from a json encoded SDN Subnet configuration and stores it in config. It returns the newly created config with the passed in configuration stored and an error if one occurs unmarshalling the input data.

func (*ConfigSDNSubnet) Create

func (config *ConfigSDNSubnet) Create(ctx context.Context, vnet, id string, client *Client) (err error)

func (*ConfigSDNSubnet) CreateWithValidate

func (config *ConfigSDNSubnet) CreateWithValidate(ctx context.Context, vnet, id string, client *Client) (err error)

func (*ConfigSDNSubnet) Update

func (config *ConfigSDNSubnet) Update(ctx context.Context, vnet, id string, client *Client) (err error)

func (*ConfigSDNSubnet) UpdateWithValidate

func (config *ConfigSDNSubnet) UpdateWithValidate(ctx context.Context, vnet, id string, client *Client) (err error)

func (*ConfigSDNSubnet) Validate

func (c *ConfigSDNSubnet) Validate(ctx context.Context, vnet, id string, create bool, client *Client) (err error)

type ConfigSDNVNet

type ConfigSDNVNet struct {
	VNet      string `json:"vnet"`
	Zone      string `json:"zone"`
	Alias     string `json:"alias,omitempty"`
	Delete    string `json:"delete,omitempty"`
	Tag       int    `json:"tag,omitempty"`
	VLANAware bool   `json:"vlanaware,omitempty"`
	// Digest allows for a form of optimistic locking
	Digest string `json:"digest,omitempty"`
}

func NewConfigSDNVNetFromJson

func NewConfigSDNVNetFromJson(input []byte) (config *ConfigSDNVNet, err error)

func (*ConfigSDNVNet) Create

func (config *ConfigSDNVNet) Create(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNVNet) CreateWithValidate

func (config *ConfigSDNVNet) CreateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNVNet) Update

func (config *ConfigSDNVNet) Update(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNVNet) UpdateWithValidate

func (config *ConfigSDNVNet) UpdateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNVNet) Validate

func (c *ConfigSDNVNet) Validate(ctx context.Context, id string, create bool, client *Client) (err error)

type ConfigSDNZone

type ConfigSDNZone struct {
	Type                     string `json:"type"`
	Zone                     string `json:"zone"`
	AdvertiseSubnets         bool   `json:"advertise-subnets,omitempty"`
	Bridge                   string `json:"bridge,omitempty"`
	BridgeDisableMacLearning bool   `json:"bridge-disable-mac-learning,omitempty"`
	Controller               string `json:"controller,omitempty"`
	DisableARPNDSuppression  bool   `json:"disable-arp-nd-suppression,omitempty"`
	DNS                      string `json:"dns,omitempty"`
	DNSZone                  string `json:"dnszone,omitempty"`
	DPID                     int    `json:"dp-id,omitempty"`
	ExitNodes                string `json:"exitnodes,omitempty"`
	ExitNodesLocalRouting    bool   `json:"exitnodes-local-routing,omitempty"`
	ExitNodesPrimary         string `json:"exitnodes-primary,omitempty"`
	IPAM                     string `json:"ipam,omitempty"`
	MAC                      string `json:"mac,omitempty"`
	MTU                      int    `json:"mtu,omitempty"`
	Nodes                    string `json:"nodes,omitempty"`
	Peers                    string `json:"peers,omitempty"`
	ReverseDNS               string `json:"reversedns,omitempty"`
	RTImport                 string `json:"rt-import,omitempty"`
	Tag                      int    `json:"tag,omitempty"`
	VlanProtocol             string `json:"vlan-protocol,omitempty"`
	VrfVxlan                 int    `json:"vrf-vxlan,omitempty"`
	// Pass a string of attributes to be deleted from the remote object
	Delete string `json:"delete,omitempty"`
	// Digest allows for a form of optimistic locking
	Digest string `json:"digest,omitempty"`
}

ConfigSDNZone describes the Zone configurable element

func NewConfigSDNZoneFromJson

func NewConfigSDNZoneFromJson(input []byte) (config *ConfigSDNZone, err error)

NewConfigNetworkFromJSON takes in a byte array from a json encoded SDN Zone configuration and stores it in config. It returns the newly created config with the passed in configuration stored and an error if one occurs unmarshalling the input data.

func (*ConfigSDNZone) Create

func (config *ConfigSDNZone) Create(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNZone) CreateWithValidate

func (config *ConfigSDNZone) CreateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNZone) Update

func (config *ConfigSDNZone) Update(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNZone) UpdateWithValidate

func (config *ConfigSDNZone) UpdateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigSDNZone) Validate

func (c *ConfigSDNZone) Validate(ctx context.Context, id string, create bool, client *Client) (err error)

type ConfigSnapshot

type ConfigSnapshot struct {
	Name        SnapshotName `json:"name,omitempty"`
	Description string       `json:"description,omitempty"`
	VmState     bool         `json:"ram,omitempty"`
}

func (ConfigSnapshot) Create

func (config ConfigSnapshot) Create(ctx context.Context, c *Client, vmr *VmRef) (err error)

Creates a snapshot and validates the input

func (ConfigSnapshot) CreateNoCheck

func (config ConfigSnapshot) CreateNoCheck(ctx context.Context, c *Client, vmr *VmRef) error

Create a snapshot without validating the input, use ConfigSnapshot.Create() to validate the input.

func (ConfigSnapshot) CreateSnapshot

func (config ConfigSnapshot) CreateSnapshot(ctx context.Context, c *Client, vmr *VmRef) error

deprecated use ConfigSnapshot.Create() instead

func (ConfigSnapshot) Validate

func (config ConfigSnapshot) Validate() error

type ConfigStorage

type ConfigStorage struct {
	ID              string                        `json:"id"`
	Enable          bool                          `json:"enable"`
	Nodes           []string                      `json:"nodes,omitempty"`
	Type            string                        `json:"type"`
	Directory       *ConfigStorageDirectory       `json:"directory,omitempty"`
	LVM             *ConfigStorageLVM             `json:"lvm,omitempty"`
	LVMThin         *ConfigStorageLVMThin         `json:"lvm-thin,omitempty"`
	NFS             *ConfigStorageNFS             `json:"nfs,omitempty"`
	SMB             *ConfigStorageSMB             `json:"smb,omitempty"`
	GlusterFS       *ConfigStorageGlusterFS       `json:"glusterfs,omitempty"`
	ISCSI           *ConfigStorageISCSI           `json:"iscsi,omitempty"`
	CephFS          *ConfigStorageCephFS          `json:"cephfs,omitempty"`
	RBD             *ConfigStorageRBD             `json:"rbd,omitempty"`
	ZFSoverISCSI    *ConfigStorageZFSoverISCSI    `json:"zfs-over-iscsi,omitempty"`
	ZFS             *ConfigStorageZFS             `json:"zfs,omitempty"`
	PBS             *ConfigStoragePBS             `json:"pbs,omitempty"`
	Content         *ConfigStorageContent         `json:"content,omitempty"`
	BackupRetention *ConfigStorageBackupRetention `json:"backupretention,omitempty"`
}

Storage options for the Proxmox API

func NewConfigStorageFromApi

func NewConfigStorageFromApi(ctx context.Context, storageid string, client *Client) (config *ConfigStorage, err error)

func NewConfigStorageFromJson

func NewConfigStorageFromJson(input []byte) (config *ConfigStorage, err error)

func (*ConfigStorage) Create

func (config *ConfigStorage) Create(ctx context.Context, id string, errorSupression bool, client *Client) (err error)

func (*ConfigStorage) CreateWithValidate

func (config *ConfigStorage) CreateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigStorage) RemapFromAPI

func (config *ConfigStorage) RemapFromAPI()

func (*ConfigStorage) RemapToAPI

func (config *ConfigStorage) RemapToAPI()

func (*ConfigStorage) SetDefaults

func (config *ConfigStorage) SetDefaults()

func (*ConfigStorage) Update

func (config *ConfigStorage) Update(ctx context.Context, id string, client *Client) (err error)

func (*ConfigStorage) UpdateWithValidate

func (config *ConfigStorage) UpdateWithValidate(ctx context.Context, id string, client *Client) (err error)

func (*ConfigStorage) Validate

func (newConfig *ConfigStorage) Validate(ctx context.Context, id string, create bool, client *Client) (err error)

type ConfigStorageBackupRetention

type ConfigStorageBackupRetention struct {
	Last    *int `json:"last,omitempty"`
	Hourly  *int `json:"hourly,omitempty"`
	Daily   *int `json:"daily,omitempty"`
	Monthly *int `json:"monthly,omitempty"`
	Weekly  *int `json:"weekly,omitempty"`
	Yearly  *int `json:"yearly,omitempty"`
}

func (*ConfigStorageBackupRetention) AllNil

func (b *ConfigStorageBackupRetention) AllNil() bool

func (*ConfigStorageBackupRetention) MapStorageBackupRetention

func (b *ConfigStorageBackupRetention) MapStorageBackupRetention() string

func (*ConfigStorageBackupRetention) Validate

func (b *ConfigStorageBackupRetention) Validate() (err error)

type ConfigStorageCephFS

type ConfigStorageCephFS struct {
	Monitors  []string `json:"monitors"`
	SecretKey *string  `json:"secret-key,omitempty"`
	Username  string   `json:"username"`
	FSname    string   `json:"fs-name"`
}

type ConfigStorageContent

type ConfigStorageContent struct {
	Backup    *bool `json:"backup,omitempty"`    //backup
	Iso       *bool `json:"iso,omitempty"`       //iso
	Template  *bool `json:"template,omitempty"`  //vztmpl
	DiskImage *bool `json:"diskimage,omitempty"` //images
	Container *bool `json:"container,omitempty"` //rootdir
	Snippets  *bool `json:"snippets,omitempty"`  //snippets
}

func (*ConfigStorageContent) MapStorageContent

func (c *ConfigStorageContent) MapStorageContent(array []bool) (list string)

func (*ConfigStorageContent) Validate

func (c *ConfigStorageContent) Validate(storageType string) error

type ConfigStorageDirectory

type ConfigStorageDirectory struct {
	Path          string  `json:"path"`
	Preallocation *string `json:"preallocation,omitempty"`
	Shared        bool    `json:"shared"`
}

Storage Types

func (*ConfigStorageDirectory) SetDefaults

func (directory *ConfigStorageDirectory) SetDefaults()

type ConfigStorageGlusterFS

type ConfigStorageGlusterFS struct {
	Server1       string  `json:"server1"`
	Server2       string  `json:"server2,omitempty"`
	Preallocation *string `json:"preallocation,omitempty"`
	Volume        string  `json:"volume"`
}

func (*ConfigStorageGlusterFS) SetDefaults

func (glusterfs *ConfigStorageGlusterFS) SetDefaults()

type ConfigStorageISCSI

type ConfigStorageISCSI struct {
	Portal string `json:"portal"`
	Target string `json:"target"`
}

type ConfigStorageLVM

type ConfigStorageLVM struct {
	VGname string `json:"vgname"`
	Shared bool   `json:"shared,omitempty"`
}

type ConfigStorageLVMThin

type ConfigStorageLVMThin struct {
	VGname   string `json:"vgname"`
	Thinpool string `json:"thinpool"`
}

type ConfigStorageNFS

type ConfigStorageNFS struct {
	Server        string  `json:"server"`
	Export        string  `json:"export"`
	Preallocation *string `json:"preallocation,omitempty"`
	Version       *string `json:"version,omitempty"`
}

func (*ConfigStorageNFS) SetDefaults

func (nfs *ConfigStorageNFS) SetDefaults()

type ConfigStoragePBS

type ConfigStoragePBS struct {
	Server      string  `json:"server"`
	Datastore   string  `json:"datastore"`
	Username    string  `json:"username"`
	Password    *string `json:"password,omitempty"`
	Fingerprint string  `json:"fingerprint,omitempty"`
	Port        *int    `json:"port,omitempty"`
	Namespace   string  `json:"namespace,omitempty"`
}

func (*ConfigStoragePBS) SetDefaults

func (pbs *ConfigStoragePBS) SetDefaults()

type ConfigStorageRBD

type ConfigStorageRBD struct {
	Pool      string   `json:"pool"`
	Monitors  []string `json:"monitors"`
	Username  string   `json:"username"`
	Keyring   *string  `json:"keyring,omitempty"`
	Namespace string   `json:"namespace"`
	KRBD      bool     `json:"krbd"`
}

type ConfigStorageSMB

type ConfigStorageSMB struct {
	Username      string  `json:"username"`
	Share         string  `json:"share"`
	Preallocation *string `json:"preallocation,omitempty"`
	Domain        string  `json:"domain"`
	Server        string  `json:"server"`
	Password      *string `json:"password,omitempty"`
	Version       *string `json:"version,omitempty"`
}

func (*ConfigStorageSMB) SetDefaults

func (smb *ConfigStorageSMB) SetDefaults()

type ConfigStorageZFS

type ConfigStorageZFS struct {
	Pool          string  `json:"pool"`
	Blocksize     *string `json:"blocksize,omitempty"`
	Thinprovision bool    `json:"thinprovision,omitempty"`
}

func (*ConfigStorageZFS) SetDefaults

func (zfs *ConfigStorageZFS) SetDefaults()

type ConfigStorageZFSoverISCSI

type ConfigStorageZFSoverISCSI struct {
	Portal        string                             `json:"portal"`
	Pool          string                             `json:"pool"`
	Blocksize     *string                            `json:"blocksize"`
	Target        string                             `json:"target"`
	ISCSIprovider string                             `json:"iscsiprovider"`
	Thinprovision bool                               `json:"thinprovision"`
	Comstar       *ConfigStorageZFSoverISCSI_Comstar `json:"comstar,omitempty"`
	Istgt         *ConfigStorageZFSoverISCSI_istgt   `json:"istgt,omitempty"`
	LIO           *ConfigStorageZFSoverISCSI_LIO     `json:"lio,omitempty"`
}

func (*ConfigStorageZFSoverISCSI) RemapFromAPI

func (zfsoveriscsi *ConfigStorageZFSoverISCSI) RemapFromAPI()

func (*ConfigStorageZFSoverISCSI) RemapToAPI

func (zfsoveriscsi *ConfigStorageZFSoverISCSI) RemapToAPI()

func (*ConfigStorageZFSoverISCSI) SetDefaults

func (zfsoveriscsi *ConfigStorageZFSoverISCSI) SetDefaults()

type ConfigStorageZFSoverISCSI_Comstar

type ConfigStorageZFSoverISCSI_Comstar struct {
	TargetGroup string `json:"target-group"`
	HostGroup   string `json:"host-group"`
	Writecache  bool   `json:"writecache"`
}

type ConfigStorageZFSoverISCSI_LIO

type ConfigStorageZFSoverISCSI_LIO struct {
	TargetPortalGroup string `json:"targetportal-group"`
}

type ConfigStorageZFSoverISCSI_istgt

type ConfigStorageZFSoverISCSI_istgt struct {
	Writecache bool `json:"writecache"`
}

type ConfigUser

type ConfigUser struct {
	User      UserID       `json:"user"`
	Comment   string       `json:"comment,omitempty"`
	Email     string       `json:"email,omitempty"`
	Enable    bool         `json:"enable"`
	Expire    uint         `json:"expire"`
	FirstName string       `json:"firstname,omitempty"`
	Groups    *[]GroupName `json:"groups,omitempty"`
	Keys      string       `json:"keys,omitempty"`
	LastName  string       `json:"lastname,omitempty"`
	// Password is always empty when getting information from Proxmox
	Password UserPassword `json:"-"`
}

User options for the Proxmox API TODO rework this at some point to use pointers for all optional values

func NewConfigUserFromJson

func NewConfigUserFromJson(input []byte) (config *ConfigUser, err error)

func (ConfigUser) CreateApiToken

func (config ConfigUser) CreateApiToken(ctx context.Context, client *Client, token ApiToken) (value string, err error)

func (ConfigUser) CreateUser

func (config ConfigUser) CreateUser(ctx context.Context, client *Client) (err error)

func (ConfigUser) DeleteApiToken

func (config ConfigUser) DeleteApiToken(ctx context.Context, client *Client, token ApiToken) (err error)

func (ConfigUser) DeleteUser

func (config ConfigUser) DeleteUser(ctx context.Context, client *Client) (err error)

func (ConfigUser) ListApiTokens

func (config ConfigUser) ListApiTokens(ctx context.Context, client *Client) (tokens *[]ApiToken, err error)

func (*ConfigUser) SetUser

func (config *ConfigUser) SetUser(ctx context.Context, userId UserID, password UserPassword, client *Client) (err error)

Create or update the user depending on if the user already exists or not. "userId" and "password" overwrite what is specified in "*ConfigUser".

func (ConfigUser) UpdateApiToken

func (config ConfigUser) UpdateApiToken(ctx context.Context, client *Client, token ApiToken) (err error)

func (ConfigUser) UpdateUser

func (config ConfigUser) UpdateUser(ctx context.Context, client *Client) (err error)

func (ConfigUser) UpdateUserPassword

func (config ConfigUser) UpdateUserPassword(ctx context.Context, client *Client) (err error)

func (ConfigUser) Validate

func (config ConfigUser) Validate() (err error)

Validates all items and sub items in the ConfigUser struct

type ContentType

type ContentType string
const (
	ContentType_Backup    ContentType = "backup"
	ContentType_Container ContentType = "container"
	ContentType_DiskImage ContentType = "diskimage"
	ContentType_Iso       ContentType = "iso"
	ContentType_Snippets  ContentType = "snippets"
	ContentType_Template  ContentType = "template"
)

func (ContentType) Validate

func (c ContentType) Validate() (err error)

Returns an error if the enum value is invalid.

type Content_File

type Content_File struct {
	Storage     string
	ContentType ContentType
	FilePath    string
}

func (Content_File) Validate

func (c Content_File) Validate() (err error)

Return an error if the required fields are empty

type Content_FileProperties

type Content_FileProperties struct {
	Name         string    `json:"name"`
	CreationTime time.Time `json:"time"`
	Format       string    `json:"format"`
	Size         uint      `json:"size"`
}

type CpuArchitecture

type CpuArchitecture string

func (CpuArchitecture) String

func (arch CpuArchitecture) String() string

type CpuFlags

type CpuFlags struct {
	AES        *TriBool `json:"aes,omitempty"`        // Activate AES instruction set for HW acceleration.
	AmdNoSSB   *TriBool `json:"amdnossb,omitempty"`   // Notifies guest OS that host is not vulnerable for Spectre on AMD CPUs.
	AmdSSBD    *TriBool `json:"amdssbd,omitempty"`    // Improves Spectre mitigation performance with AMD CPUs, best used with "VirtSSBD".
	HvEvmcs    *TriBool `json:"hvevmcs,omitempty"`    // Improve performance for nested virtualization. Only supported on Intel CPUs.
	HvTlbFlush *TriBool `json:"hvtlbflush,omitempty"` // Improve performance in overcommitted Windows guests. May lead to guest bluescreens on old CPUs.
	Ibpb       *TriBool `json:"ibpb,omitempty"`       // Allows improved Spectre mitigation with AMD CPUs.
	MdClear    *TriBool `json:"mdclear,omitempty"`    // Required to let the guest OS know if MDS is mitigated correctly.
	PCID       *TriBool `json:"pcid,omitempty"`       // Meltdown fix cost reduction on Westmere, Sandy-, and IvyBridge Intel CPUs.
	Pdpe1GB    *TriBool `json:"pdpe1gb,omitempty"`    // Allow guest OS to use 1GB size pages, if host HW supports it.
	SSBD       *TriBool `json:"ssbd,omitempty"`       // Protection for "Speculative Store Bypass" for Intel models.
	SpecCtrl   *TriBool `json:"specctrl,omitempty"`   // Allows improved Spectre mitigation with Intel CPUs.
	VirtSSBD   *TriBool `json:"cirtssbd,omitempty"`   // Basis for "Speculative Store Bypass" protection for AMD models.
}

func (CpuFlags) Validate

func (flags CpuFlags) Validate() (err error)

type CpuLimit

type CpuLimit uint8 // min value 0 is unlimited, max value of 128

func (CpuLimit) Validate

func (limit CpuLimit) Validate() error

type CpuType

type CpuType string // enum
const (
	CpuType_Intel486       CpuType = "486"
	CpuType_AmdAthlon      CpuType = "athlon"
	CpuType_IntelBroadwell CpuType = "Broadwell"

	CpuType_IntelBroadwellIBRS CpuType = "Broadwell-IBRS"

	CpuType_IntelBroadwellNoTSX CpuType = "Broadwell-noTSX"

	CpuType_IntelBroadwellNoTSXIBRS CpuType = "Broadwell-noTSX-IBRS"

	CpuType_IntelCascadelakeServer CpuType = "Cascadelake-Server"

	CpuType_IntelCascadelakeServerNoTSX CpuType = "Cascadelake-Server-noTSX"

	CpuType_IntelCascadelakeServerV2 CpuType = "Cascadelake-Server-V2"

	CpuType_IntelCascadelakeServerV4 CpuType = "Cascadelake-Server-V4"

	CpuType_IntelCascadelakeServerV5 CpuType = "Cascadelake-Server-V5"

	CpuType_IntelConroe CpuType = "Conroe"

	CpuType_IntelCooperlake CpuType = "Cooperlake"

	CpuType_IntelCooperlakeV2 CpuType = "Cooperlake-V2"

	CpuType_IntelCore2Duo CpuType = "core2duo"
	CpuType_IntelCoreDuo  CpuType = "coreduo"
	CpuType_AmdEPYC       CpuType = "EPYC"

	CpuType_AmdEPYCIBPB CpuType = "EPYC-IBPB"

	CpuType_AmdEPYCMilan CpuType = "EPYC-Milan"

	CpuType_AmdEPYCMilanV2 CpuType = "EPYC-Milan-v2"

	CpuType_AmdEPYCRome CpuType = "EPYC-Rome"

	CpuType_AmdEPYCRomeV2 CpuType = "EPYC-Rome-v2"

	CpuType_AmdEPYCV3 CpuType = "EPYC-v3"

	CpuType_Host         CpuType = "host"
	CpuType_IntelHaswell CpuType = "Haswell"

	CpuType_IntelHaswellIBRS CpuType = "Haswell-IBRS"

	CpuType_IntelHaswellNoTSX CpuType = "Haswell-noTSX"

	CpuType_IntelHaswellNoTSXIBRS CpuType = "Haswell-noTSX-IBRS"

	CpuType_IntelIcelakeClient CpuType = "Icelake-Client"

	CpuType_IntelIcelakeClientNoTSX CpuType = "Icelake-Client-noTSX"

	CpuType_IntelIcelakeServer CpuType = "Icelake-Server"

	CpuType_IntelIcelakeServerNoTSX CpuType = "Icelake-Server-noTSX"

	CpuType_IntelIcelakeServerV3 CpuType = "Icelake-Server-v3"

	CpuType_IntelIcelakeServerV4 CpuType = "Icelake-Server-v4"

	CpuType_IntelIcelakeServerV5 CpuType = "Icelake-Server-v5"

	CpuType_IntelIcelakeServerV6 CpuType = "Icelake-Server-v6"

	CpuType_IntelIvybridge CpuType = "IvyBridge"

	CpuType_IntelIvybridgeIBRS CpuType = "IvyBridge-IBRS"

	CpuType_IntelKnightsmill CpuType = "KnightsMill"

	CpuType_QemuKvm32    CpuType = "kvm32"
	CpuType_QemuKvm64    CpuType = "kvm64"
	CpuType_QemuMax      CpuType = "max"
	CpuType_IntelNehalem CpuType = "Nehalem"

	CpuType_IntelNehalemIBRS CpuType = "Nehalem-IRBS"

	CpuType_AmdOpteronG1 CpuType = "Opteron_G1"

	CpuType_AmdOpteronG2 CpuType = "Opteron_G2"

	CpuType_AmdOpteronG3 CpuType = "Opteron_G3"

	CpuType_AmdOpteronG4 CpuType = "Opteron_G4"

	CpuType_AmdOpteronG5 CpuType = "Opteron_G5"

	CpuType_IntelPenrym CpuType = "Penrym"

	CpuType_IntelPentium     CpuType = "pentium"
	CpuType_IntelPentium2    CpuType = "pentium2"
	CpuType_IntelPentium3    CpuType = "pentium3"
	CpuType_AmdPhenom        CpuType = "phenom"
	CpuType_Qemu32           CpuType = "qemu32"
	CpuType_Qemu64           CpuType = "qemu64"
	CpuType_IntelSandyBridge CpuType = "SandyBridge"

	CpuType_IntelSandybridgeIBRS CpuType = "SandyBridge-IBRS"

	CpuType_IntelSapphireRapids CpuType = "SapphireRapids"

	CpuType_IntelSkylakeClient CpuType = "Skylake-Client"

	CpuType_IntelSkylakeClientIBRS CpuType = "Skylake-Client-IBRS"

	CpuType_IntelSkylakeClientNoTSXIBRS CpuType = "Skylake-Client-noTSX-IBRS"

	CpuType_IntelSkylakeClientV4 CpuType = "Skylake-Client-v4"

	CpuType_IntelSkylakeServer CpuType = "Skylake-Server"

	CpuType_IntelSkylakeServerIBRS CpuType = "Skylake-Server-IBRS"

	CpuType_IntelSkylakeServerNoTSXIBRS CpuType = "Skylake-Server-noTSX-IBRS"

	CpuType_IntelSkylakeServerV4 CpuType = "Skylake-Server-v4"

	CpuType_IntelSkylakeServerV5 CpuType = "Skylake-Server-v5"

	CpuType_IntelWestmere CpuType = "Westmere"

	CpuType_IntelWestmereIBRS CpuType = "Westmere-IBRS"

	CpuType_X86_64_v2 CpuType = "x86-64-v2"

	CpuType_X86_64_v2_AES CpuType = "x86-64-v2-AES"

	CpuType_X86_64_v3 CpuType = "x86-64-v3"

	CpuType_X86_64_v4 CpuType = "x86-64-v4"
)

func (CpuType) Error

func (CpuType) Error(version Version) error

func (CpuType) Validate

func (cpu CpuType) Validate(version Version) error

type CpuUnits

type CpuUnits uint32 // min value 0 is unset, max value of 262144

func (CpuUnits) Validate

func (units CpuUnits) Validate() error

type CpuVirtualCores

type CpuVirtualCores uint16 // min value 0 is unset, max value 512. is QemuCpuCores * CpuSockets

func (CpuVirtualCores) Error

func (cores CpuVirtualCores) Error() error

func (CpuVirtualCores) Validate

func (vCores CpuVirtualCores) Validate(cores *QemuCpuCores, sockets *QemuCpuSockets, current *QemuCPU) error

type EncodedVersion

type EncodedVersion uint32

type EntropySource

type EntropySource int

EntropySource is an Enum.

const (
	EntropySourceRandom EntropySource
	EntropySourceURandom
	EntropySourceHwRNG
)

func (EntropySource) MarshalJSON

func (source EntropySource) MarshalJSON() ([]byte, error)

func (*EntropySource) Parse

func (source *EntropySource) Parse(raw string) error

func (EntropySource) String

func (source EntropySource) String() string

func (*EntropySource) UnmarshalJSON

func (source *EntropySource) UnmarshalJSON(data []byte) error

func (EntropySource) Validate

func (source EntropySource) Validate() error

type GroupName

type GroupName string

GroupName may only contain the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_

func (GroupName) AddUsersToGroup

func (group GroupName) AddUsersToGroup(ctx context.Context, members *[]UserID, client *Client) error

Add users to the specified group

func (GroupName) CheckExistence

func (group GroupName) CheckExistence(ctx context.Context, client *Client) (bool, error)

Check if the specified group exists.

func (GroupName) Delete

func (group GroupName) Delete(ctx context.Context, client *Client) (err error)

Deletes the specified group

func (GroupName) RemoveAllUsersFromGroup

func (group GroupName) RemoveAllUsersFromGroup(ctx context.Context, client *Client) (err error)

Recursively remove all users from the specified group

func (GroupName) RemoveUsersFromGroup

func (group GroupName) RemoveUsersFromGroup(ctx context.Context, members *[]UserID, client *Client) (err error)

Remove users from the specified group

func (GroupName) SetMembers

func (group GroupName) SetMembers(ctx context.Context, members *[]UserID, client *Client) (err error)

Recursively add and remove users from the specified group so only the the specified users will be members of the group

func (GroupName) Validate

func (group GroupName) Validate() error

Check if a groupname is valid.

type GuestDNS

type GuestDNS struct {
	NameServers  *[]netip.Addr `json:"nameservers,omitempty"`
	SearchDomain *string       `json:"searchdomain,omitempty"` // we are not validating this field, as validating domain names is a complex topic.
}

type GuestFeature

type GuestFeature string

Enum

const (
	GuestFeature_Clone    GuestFeature = "clone"
	GuestFeature_Copy     GuestFeature = "copy"
	GuestFeature_Snapshot GuestFeature = "snapshot"
)

func (GuestFeature) Error

func (GuestFeature) Error() error

func (GuestFeature) Validate

func (feature GuestFeature) Validate() error

type GuestFeatures

type GuestFeatures struct {
	Clone    bool `json:"clone"`
	Copy     bool `json:"copy"`
	Snapshot bool `json:"snapshot"`
}

func ListGuestFeatures

func ListGuestFeatures(ctx context.Context, vmr *VmRef, client *Client) (features GuestFeatures, err error)

List all features the guest has.

type GuestID

type GuestID uint32

Positive number between 100 and 1000000000

func (GuestID) Exists

func (id GuestID) Exists(ctx context.Context, c *Client) (bool, error)

func (GuestID) ExistsNoCheck

func (id GuestID) ExistsNoCheck(ctx context.Context, c *Client) (bool, error)

func (GuestID) String

func (id GuestID) String() string

func (GuestID) Validate

func (id GuestID) Validate() error

type GuestName

type GuestName string

GuestName has a maximum length of 128 characters. Has the same syntax as a DNS name. Domain sections may not start or end with a hyphen (-) or dot (.). Valid characters are letters, numbers, hyphens (-) and dots (.). Regex: ^(?=.{1,127}$)(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?)\.)*(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?)$

func (GuestName) String

func (name GuestName) String() string

func (GuestName) Validate

func (name GuestName) Validate() error

type GuestNetworkRate

type GuestNetworkRate uint32

0 to 10240000, where 0 means no limit

func (GuestNetworkRate) Validate

func (rate GuestNetworkRate) Validate() error

type GuestResource

type GuestResource struct {
	CpuCores           uint          `json:"cpu_cores"`
	CpuUsage           float64       `json:"cpu_usage"`
	DiskReadTotal      uint          `json:"disk_read"`
	DiskSizeInBytes    uint          `json:"disk_size"`
	DiskUsedInBytes    uint          `json:"disk_used"`
	DiskWriteTotal     uint          `json:"disk_write"`
	HaState            string        `json:"hastate"` // TODO custom type?
	ID                 GuestID       `json:"id"`
	MemoryTotalInBytes uint          `json:"memory_total"`
	MemoryUsedInBytes  uint          `json:"memory_used"`
	Name               GuestName     `json:"name"`
	NetworkIn          uint          `json:"network_in"`
	NetworkOut         uint          `json:"network_out"`
	Node               NodeName      `json:"node"`
	Pool               PoolName      `json:"pool"`
	Status             PowerState    `json:"status"`
	Tags               Tags          `json:"tags"`
	Template           bool          `json:"template"`
	Type               GuestType     `json:"type"`
	Uptime             time.Duration `json:"uptime"`
}

type GuestStatus

type GuestStatus struct {
	Name   GuestName     `json:"name"`
	State  PowerState    `json:"state"`
	Uptime time.Duration `json:"uptime"`
}

TODO add more properties to GuestStatus

type GuestType

type GuestType uint8

GuestType is an enum for the type of guest (lxc or qemu)

const (
	GuestLxc  GuestType = 1
	GuestQemu GuestType = 2
)

func (*GuestType) Parse

func (t *GuestType) Parse(guestType string) error

func (GuestType) String

func (t GuestType) String() string

type HAGroup

type HAGroup struct {
	Comment    string   // Description.
	Group      string   // The HA group identifier.
	Nodes      []string // List of cluster node names with optional priority. LIKE: <node>[:<pri>]{,<node>[:<pri>]}*
	NoFailback bool     // The CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior.
	Restricted bool     // Resources bound to restricted groups may only run on nodes defined by the group.
	Type       string   // Group type
}

type HaAffinity

type HaAffinity int8

HaAffinity is an enum.

const (
	HaAffinityPositive HaAffinity = 1
	HaAffinityUnknown  HaAffinity = 0
	HaAffinityNegative HaAffinity = -1
)

func (HaAffinity) String

func (a HaAffinity) String() string

func (HaAffinity) Validate

func (a HaAffinity) Validate() error

type HaNode

type HaNode struct {
	Node     NodeName
	Priority HaPriority
}

func (HaNode) Validate

func (n HaNode) Validate() error

type HaNodeAffinityRule

type HaNodeAffinityRule struct {
	Comment *string         `json:"comment,omitempty"` // Never nil when returned
	Digest  [sha1.Size]byte `json:"digest,omitempty"`  // only returned.
	Enabled *bool           `json:"enabled,omitempty"` // Never nil when returned
	Guests  *[]VmRef        `json:"guests,omitempty"`  // Never nil when returned
	ID      HaRuleID        `json:"id"`
	Nodes   *[]HaNode       `json:"nodes,omitempty"`  // Never nil when returned
	Strict  *bool           `json:"strict,omitempty"` // Never nil when returned
	// contains filtered or unexported fields
}

func (HaNodeAffinityRule) Create

func (config HaNodeAffinityRule) Create(ctx context.Context, c *Client) error

func (HaNodeAffinityRule) CreateNoCheck

func (config HaNodeAffinityRule) CreateNoCheck(ctx context.Context, c *Client) error

func (HaNodeAffinityRule) Update

func (config HaNodeAffinityRule) Update(ctx context.Context, c *Client) error

func (HaNodeAffinityRule) UpdateNoCheck

func (config HaNodeAffinityRule) UpdateNoCheck(ctx context.Context, c *Client) error

func (HaNodeAffinityRule) Validate

func (config HaNodeAffinityRule) Validate(current *HaNodeAffinityRule) error

type HaPriority

type HaPriority uint16

Max 1000

func (HaPriority) String

func (p HaPriority) String() string

func (HaPriority) Validate

func (p HaPriority) Validate() error

type HaResourceAffinityRule

type HaResourceAffinityRule struct {
	Affinity *HaAffinity     `json:"affinity,omitempty"` // Never nil when returned
	Comment  *string         `json:"comment,omitempty"`  // Never nil when returned
	Digest   [sha1.Size]byte `json:"digest,omitempty"`   // only returned.
	Enabled  *bool           `json:"enabled,omitempty"`  // Never nil when returned
	Guests   *[]VmRef        `json:"guests,omitempty"`   // Never nil when returned
	ID       HaRuleID        `json:"id"`
	// contains filtered or unexported fields
}

func (HaResourceAffinityRule) Create

func (config HaResourceAffinityRule) Create(ctx context.Context, c *Client) error

func (HaResourceAffinityRule) CreateNoCheck

func (config HaResourceAffinityRule) CreateNoCheck(ctx context.Context, c *Client) error

func (HaResourceAffinityRule) Update

func (config HaResourceAffinityRule) Update(ctx context.Context, c *Client) error

func (HaResourceAffinityRule) UpdateNoCheck

func (config HaResourceAffinityRule) UpdateNoCheck(ctx context.Context, c *Client) error

func (HaResourceAffinityRule) Validate

func (config HaResourceAffinityRule) Validate(current *HaResourceAffinityRule) error

type HaRule

type HaRule interface {
	GetComment() string
	GetDigest() [sha1.Size]byte
	GetEnabled() bool
	GetID() HaRuleID
	GetNodeAffinity() (RawHaNodeAffinityRule, bool)
	GetResourceAffinity() (RawHaResourceAffinityRule, bool)
	Kind() HaRuleKind
}

func NewHaRuleFromApi

func NewHaRuleFromApi(ctx context.Context, id HaRuleID, c *Client) (HaRule, error)

type HaRuleID

type HaRuleID string

HaRuleID has a minimum of 2 characters and max of 128 characters.

func (HaRuleID) Delete

func (id HaRuleID) Delete(ctx context.Context, c *Client) error

func (HaRuleID) DeleteNoCheck

func (id HaRuleID) DeleteNoCheck(ctx context.Context, c *Client) error

func (HaRuleID) String

func (id HaRuleID) String() string

func (HaRuleID) Validate

func (id HaRuleID) Validate() error

type HaRuleKind

type HaRuleKind int8

HaRuleKind is an enum.

const (
	HaRuleKindUnknown          HaRuleKind = 0
	HaRuleKindNodeAffinity     HaRuleKind = 1
	HaRuleKindResourceAffinity HaRuleKind = 2
)

type HaRules

type HaRules interface {
	ConvertArray() []HaRule
	ConvertMap() map[HaRuleID]HaRule
}

func ListHaRules

func ListHaRules(ctx context.Context, c *Client) (HaRules, error)

func ListHaRulesNoCheck

func ListHaRulesNoCheck(ctx context.Context, c *Client) (HaRules, error)

type IPv4Address

type IPv4Address string

func (IPv4Address) String

func (ip IPv4Address) String() string

func (IPv4Address) Validate

func (ip IPv4Address) Validate() error

type IPv4CIDR

type IPv4CIDR string

func (IPv4CIDR) String

func (cidr IPv4CIDR) String() string

func (IPv4CIDR) Validate

func (cidr IPv4CIDR) Validate() error

type IPv6Address

type IPv6Address string

func (IPv6Address) String

func (ip IPv6Address) String() string

func (IPv6Address) Validate

func (ip IPv6Address) Validate() error

type IPv6CIDR

type IPv6CIDR string

func (IPv6CIDR) String

func (cidr IPv6CIDR) String() string

func (IPv6CIDR) Validate

func (cidr IPv6CIDR) Validate() error

type IsoFile

type IsoFile struct {
	File    string `json:"file"`
	Storage string `json:"storage"`
	// SizeInKibibytes can only be retrieved, setting it has no effect
	SizeInKibibytes string `json:"size"`
}

func (IsoFile) Validate

func (iso IsoFile) Validate() error

type LxcBindMount

type LxcBindMount struct {
	GuestPath *LxcMountPath    `json:"guest_path,omitempty"` // Required during creation, never nil when returned
	HostPath  *LxcHostPath     `json:"host_path,omitempty"`  // Required during creation, never nil when returned
	Options   *LxcMountOptions `json:"mount_options,omitempty"`
	ReadOnly  *bool            `json:"read_only,omitempty"` // Never nil when returned
	Replicate *bool            `json:"replicate,omitempty"` // Never nil when returned
}

func (LxcBindMount) Validate

func (config LxcBindMount) Validate(current *LxcBindMount) error

type LxcBootMount

type LxcBootMount struct {
	ACL             *TriBool // Never nil when returned
	Options         *LxcBootMountOptions
	Quota           *bool         // Only for privileged guests.
	Replicate       *bool         // Never nil when returned
	SizeInKibibytes *LxcMountSize // Required during creation, never nil when returned
	Storage         *string       // Required during creation, never nil when returned
	// contains filtered or unexported fields
}

func (LxcBootMount) Validate

func (config LxcBootMount) Validate(current *LxcBootMount, privileged bool) error

type LxcBootMountOptions

type LxcBootMountOptions struct {
	Discard  *bool `json:"discard,omitempty"`   // Never nil when returned
	LazyTime *bool `json:"lazy_time,omitempty"` // Never nil when returned
	NoATime  *bool `json:"no_atime,omitempty"`  // Never nil when returned
	NoSuid   *bool `json:"no_suid,omitempty"`   // Never nil when returned
}

type LxcCPU

type LxcCPU struct {
	Cores *LxcCpuCores `json:"cores,omitempty"`
	Limit *LxcCpuLimit `json:"limit,omitempty"`
	Units *LxcCpuUnits `json:"units,omitempty"`
}

func (LxcCPU) Validate

func (cpu LxcCPU) Validate() error

type LxcCpuCores

type LxcCpuCores uint16

0-8192, 0 means no limit

func (LxcCpuCores) String

func (cores LxcCpuCores) String() string

func (LxcCpuCores) Validate

func (cores LxcCpuCores) Validate() error

type LxcCpuLimit

type LxcCpuLimit float32

0-8192, 0 means no limit

func (LxcCpuLimit) String

func (limit LxcCpuLimit) String() string

func (LxcCpuLimit) Validate

func (limit LxcCpuLimit) Validate() error

type LxcCpuUnits

type LxcCpuUnits uint32

0-100000, 0 means no limit

func (LxcCpuUnits) String

func (units LxcCpuUnits) String() string

func (LxcCpuUnits) Validate

func (units LxcCpuUnits) Validate() error

type LxcCreateOptions

type LxcCreateOptions struct {
	OsTemplate    *LxcTemplate    `json:"os_template,omitempty"`
	UserPassword  *string         `json:"password,omitempty"`
	PublicSSHkeys []AuthorizedKey `json:"sshkeys,omitempty"`
}

These settings are only available during creation and can not be changed afterwards, or returned by the API

func (LxcCreateOptions) Validate

func (config LxcCreateOptions) Validate() error

type LxcDataMount

type LxcDataMount struct {
	ACL             *TriBool         `json:"acl,omitempty"`    // Never nil when returned
	Backup          *bool            `json:"backup,omitempty"` // Never nil when returned
	Options         *LxcMountOptions `json:"mount_options,omitempty"`
	Path            *LxcMountPath    `json:"path,omitempty"` // Required during creation, never nil when returned
	Quota           *bool            `json:"quota,omitempty"`
	ReadOnly        *bool            `json:"read_only,omitempty"`         // Never nil when returned
	Replicate       *bool            `json:"replicate,omitempty"`         // Never nil when returned
	SizeInKibibytes *LxcMountSize    `json:"size_in_kibibytes,omitempty"` // Required during creation, never nil when returned
	Storage         *string          `json:"storage,omitempty"`           // Required during creation, never nil when returned
	// contains filtered or unexported fields
}

func (LxcDataMount) Validate

func (config LxcDataMount) Validate(current *LxcDataMount, privileged bool) error

type LxcFeatures

type LxcFeatures struct {
	Privileged   *PrivilegedFeatures   `json:"privileged,omitempty"`   // Mutually exclusive with Unprivileged
	Unprivileged *UnprivilegedFeatures `json:"unprivileged,omitempty"` // Mutually exclusive with Privileged
}

func (LxcFeatures) Validate

func (config LxcFeatures) Validate(privileged bool) error

type LxcHostPath

type LxcHostPath string

LxcHostPath is the absolute path to the mount point on the PVE host. Example: `/mnt/data` The path must start with a slash and must not contain `,` character.

func (LxcHostPath) String

func (path LxcHostPath) String() string

func (LxcHostPath) Validate

func (path LxcHostPath) Validate() error

type LxcIPv4

type LxcIPv4 struct {
	Address *IPv4CIDR    `json:"address,omitempty"`
	Gateway *IPv4Address `json:"gateway,omitempty"`
	DHCP    bool         `json:"dhcp,omitempty"`
	Manual  bool         `json:"manual,omitempty"`
}

func (LxcIPv4) Validate

func (ipv4 LxcIPv4) Validate() error

type LxcIPv6

type LxcIPv6 struct {
	Address *IPv6CIDR    `json:"address,omitempty"`
	Gateway *IPv6Address `json:"gateway,omitempty"`
	DHCP    bool         `json:"dhcp,omitempty"`
	SLAAC   bool         `json:"slaac,omitempty"`
	Manual  bool         `json:"manual,omitempty"`
}

func (LxcIPv6) Validate

func (ipv6 LxcIPv6) Validate() error

type LxcMemory

type LxcMemory uint

func (LxcMemory) String

func (memory LxcMemory) String() string

func (LxcMemory) Validate

func (memory LxcMemory) Validate() error

type LxcMount

type LxcMount struct {
	BindMount *LxcBindMount `json:"bind,omitempty"`
	DataMount *LxcDataMount `json:"data,omitempty"`
	Detach    bool          `json:"detach,omitempty"`
}

func (LxcMount) Validate

func (config LxcMount) Validate(current *LxcMount, privileged bool) error

type LxcMountID

type LxcMountID uint8
const (
	LxcMountID0 LxcMountID = iota
	LxcMountID1
	LxcMountID2
	LxcMountID3
	LxcMountID4
	LxcMountID5
	LxcMountID6
	LxcMountID7
	LxcMountID8
	LxcMountID9
	LxcMountID10
	LxcMountID11
	LxcMountID12
	LxcMountID13
	LxcMountID14
	LxcMountID15
	LxcMountID16
	LxcMountID17
	LxcMountID18
	LxcMountID19
	LxcMountID20
	LxcMountID21
	LxcMountID22
	LxcMountID23
	LxcMountID24
	LxcMountID25
	LxcMountID26
	LxcMountID27
	LxcMountID28
	LxcMountID29
	LxcMountID30
	LxcMountID31
	LxcMountID32
	LxcMountID33
	LxcMountID34
	LxcMountID35
	LxcMountID36
	LxcMountID37
	LxcMountID38
	LxcMountID39
	LxcMountID40
	LxcMountID41
	LxcMountID42
	LxcMountID43
	LxcMountID44
	LxcMountID45
	LxcMountID46
	LxcMountID47
	LxcMountID48
	LxcMountID49
	LxcMountID50
	LxcMountID51
	LxcMountID52
	LxcMountID53
	LxcMountID54
	LxcMountID55
	LxcMountID56
	LxcMountID57
	LxcMountID58
	LxcMountID59
	LxcMountID60
	LxcMountID61
	LxcMountID62
	LxcMountID63
	LxcMountID64
	LxcMountID65
	LxcMountID66
	LxcMountID67
	LxcMountID68
	LxcMountID69
	LxcMountID70
	LxcMountID71
	LxcMountID72
	LxcMountID73
	LxcMountID74
	LxcMountID75
	LxcMountID76
	LxcMountID77
	LxcMountID78
	LxcMountID79
	LxcMountID80
	LxcMountID81
	LxcMountID82
	LxcMountID83
	LxcMountID84
	LxcMountID85
	LxcMountID86
	LxcMountID87
	LxcMountID88
	LxcMountID89
	LxcMountID90
	LxcMountID91
	LxcMountID92
	LxcMountID93
	LxcMountID94
	LxcMountID95
	LxcMountID96
	LxcMountID97
	LxcMountID98
	LxcMountID99
	LxcMountID100
	LxcMountID101
	LxcMountID102
	LxcMountID103
	LxcMountID104
	LxcMountID105
	LxcMountID106
	LxcMountID107
	LxcMountID108
	LxcMountID109
	LxcMountID110
	LxcMountID111
	LxcMountID112
	LxcMountID113
	LxcMountID114
	LxcMountID115
	LxcMountID116
	LxcMountID117
	LxcMountID118
	LxcMountID119
	LxcMountID120
	LxcMountID121
	LxcMountID122
	LxcMountID123
	LxcMountID124
	LxcMountID125
	LxcMountID126
	LxcMountID127
	LxcMountID128
	LxcMountID129
	LxcMountID130
	LxcMountID131
	LxcMountID132
	LxcMountID133
	LxcMountID134
	LxcMountID135
	LxcMountID136
	LxcMountID137
	LxcMountID138
	LxcMountID139
	LxcMountID140
	LxcMountID141
	LxcMountID142
	LxcMountID143
	LxcMountID144
	LxcMountID145
	LxcMountID146
	LxcMountID147
	LxcMountID148
	LxcMountID149
	LxcMountID150
	LxcMountID151
	LxcMountID152
	LxcMountID153
	LxcMountID154
	LxcMountID155
	LxcMountID156
	LxcMountID157
	LxcMountID158
	LxcMountID159
	LxcMountID160
	LxcMountID161
	LxcMountID162
	LxcMountID163
	LxcMountID164
	LxcMountID165
	LxcMountID166
	LxcMountID167
	LxcMountID168
	LxcMountID169
	LxcMountID170
	LxcMountID171
	LxcMountID172
	LxcMountID173
	LxcMountID174
	LxcMountID175
	LxcMountID176
	LxcMountID177
	LxcMountID178
	LxcMountID179
	LxcMountID180
	LxcMountID181
	LxcMountID182
	LxcMountID183
	LxcMountID184
	LxcMountID185
	LxcMountID186
	LxcMountID187
	LxcMountID188
	LxcMountID189
	LxcMountID190
	LxcMountID191
	LxcMountID192
	LxcMountID193
	LxcMountID194
	LxcMountID195
	LxcMountID196
	LxcMountID197
	LxcMountID198
	LxcMountID199
	LxcMountID200
	LxcMountID201
	LxcMountID202
	LxcMountID203
	LxcMountID204
	LxcMountID205
	LxcMountID206
	LxcMountID207
	LxcMountID208
	LxcMountID209
	LxcMountID210
	LxcMountID211
	LxcMountID212
	LxcMountID213
	LxcMountID214
	LxcMountID215
	LxcMountID216
	LxcMountID217
	LxcMountID218
	LxcMountID219
	LxcMountID220
	LxcMountID221
	LxcMountID222
	LxcMountID223
	LxcMountID224
	LxcMountID225
	LxcMountID226
	LxcMountID227
	LxcMountID228
	LxcMountID229
	LxcMountID230
	LxcMountID231
	LxcMountID232
	LxcMountID233
	LxcMountID234
	LxcMountID235
	LxcMountID236
	LxcMountID237
	LxcMountID238
	LxcMountID239
	LxcMountID240
	LxcMountID241
	LxcMountID242
	LxcMountID243
	LxcMountID244
	LxcMountID245
	LxcMountID246
	LxcMountID247
	LxcMountID248
	LxcMountID249
	LxcMountID250
	LxcMountID251
	LxcMountID252
	LxcMountID253
	LxcMountID254
	LxcMountID255
)

func (LxcMountID) String

func (id LxcMountID) String() string

type LxcMountOptions

type LxcMountOptions struct {
	Discard  *bool `json:"discard,omitempty"`   // Never nil when returned
	LazyTime *bool `json:"lazy_time,omitempty"` // Never nil when returned
	NoATime  *bool `json:"no_atime,omitempty"`  // Never nil when returned
	NoDevice *bool `json:"no_device,omitempty"` // Never nil when returned
	NoExec   *bool `json:"no_exec,omitempty"`   // Never nil when returned
	NoSuid   *bool `json:"no_suid,omitempty"`   // Never nil when returned
}

type LxcMountPath

type LxcMountPath string

LxcMountPath is the absolute path to the mount point inside the container. Example: `/mnt/data` The path must start with a slash and must not contain `,` character.

func (LxcMountPath) String

func (path LxcMountPath) String() string

func (LxcMountPath) Validate

func (path LxcMountPath) Validate() error

type LxcMountSize

type LxcMountSize uint

func (LxcMountSize) String

func (size LxcMountSize) String() string

func (LxcMountSize) Validate

func (size LxcMountSize) Validate() error

type LxcMounts

type LxcMounts map[LxcMountID]LxcMount

func (LxcMounts) Validate

func (config LxcMounts) Validate(current LxcMounts, privileged bool) error

type LxcNetwork

type LxcNetwork struct {
	Bridge        *string           `json:"bridge,omitempty"`    // Required for creation. Never nil when returned
	Connected     *bool             `json:"connected,omitempty"` // Never nil when returned
	Firewall      *bool             `json:"firewall,omitempty"`  // Never nil when returned
	IPv4          *LxcIPv4          `json:"ipv4,omitempty"`
	IPv6          *LxcIPv6          `json:"ipv6,omitempty"`
	MAC           *net.HardwareAddr `json:"mac,omitempty"` // Never nil when returned
	Mtu           *MTU              `json:"mtu,omitempty"`
	Name          *LxcNetworkName   `json:"name,omitempty"` // Required for creation. Never nil when returned
	NativeVlan    *Vlan             `json:"native_vlan,omitempty"`
	RateLimitKBps *GuestNetworkRate `json:"rate,omitempty"`
	TaggedVlans   *Vlans            `json:"tagged_vlans,omitempty"`
	Delete        bool              `json:"delete,omitempty"`
	// contains filtered or unexported fields
}

func (LxcNetwork) Validate

func (config LxcNetwork) Validate(current *LxcNetwork) error

type LxcNetworkID

type LxcNetworkID uint8
const (
	LxcNetworkID0  LxcNetworkID = 0
	LxcNetworkID1  LxcNetworkID = 1
	LxcNetworkID2  LxcNetworkID = 2
	LxcNetworkID3  LxcNetworkID = 3
	LxcNetworkID4  LxcNetworkID = 4
	LxcNetworkID5  LxcNetworkID = 5
	LxcNetworkID6  LxcNetworkID = 6
	LxcNetworkID7  LxcNetworkID = 7
	LxcNetworkID8  LxcNetworkID = 8
	LxcNetworkID9  LxcNetworkID = 9
	LxcNetworkID10 LxcNetworkID = 10
	LxcNetworkID11 LxcNetworkID = 11
	LxcNetworkID12 LxcNetworkID = 12
	LxcNetworkID13 LxcNetworkID = 13
	LxcNetworkID14 LxcNetworkID = 14
	LxcNetworkID15 LxcNetworkID = 15
)

func (LxcNetworkID) String

func (id LxcNetworkID) String() string

func (LxcNetworkID) Validate

func (id LxcNetworkID) Validate() error

type LxcNetworkName

type LxcNetworkName string

max len 16, must be unique across all networks regex ^(?!\.\.)[a-zA-Z0-9_.-]{2,16}$

func (LxcNetworkName) String

func (name LxcNetworkName) String() string

func (LxcNetworkName) Validate

func (name LxcNetworkName) Validate() error

type LxcNetworks

type LxcNetworks map[LxcNetworkID]LxcNetwork

func (LxcNetworks) Validate

func (config LxcNetworks) Validate(current LxcNetworks) error

type LxcSwap

type LxcSwap uint

func (LxcSwap) String

func (swap LxcSwap) String() string

type LxcTemplate

type LxcTemplate struct {
	Storage string `json:"storage"`
	File    string `json:"template"`
}

func (LxcTemplate) String

func (template LxcTemplate) String() string

func (LxcTemplate) Validate

func (template LxcTemplate) Validate() error

type MTU

type MTU uint16 // minimum value 576 - 65520

func (MTU) String

func (mtu MTU) String() string

func (MTU) Validate

func (mtu MTU) Validate() error

type MockClient

type MockClient struct {
	// Guest
	GuestCheckPendingChangesFunc    func(ctx context.Context, vmr *VmRef) (bool, error)
	GuestCheckVmRefFunc             func(ctx context.Context, vmr *VmRef) error
	GuestGetLxcActiveRawConfigFunc  func(ctx context.Context, vmr *VmRef) (raw RawConfigLXC, pending bool, err error)
	GuestGetLxcRawConfigFunc        func(ctx context.Context, vmr *VmRef) (RawConfigLXC, error)
	GuestGetQemuActiveRawConfigFunc func(ctx context.Context, vmr *VmRef) (raw RawConfigQemu, pending bool, err error)
	GuestGetQemuRawConfigFunc       func(ctx context.Context, vmr *VmRef) (RawConfigQemu, error)
	GuestListResourcesFunc          func(ctx context.Context) (RawGuestResources, error)
	// HA
	HaCreateNodeAffinityRuleFunc            func(ctx context.Context, ha HaNodeAffinityRule) error
	HaCreateNodeAffinityRuleNoCheckFunc     func(ctx context.Context, ha HaNodeAffinityRule) error
	HaCreateResourceAffinityRuleFunc        func(ctx context.Context, ha HaResourceAffinityRule) error
	HaCreateResourceAffinityRuleNoCheckFunc func(ctx context.Context, ha HaResourceAffinityRule) error
	HaDeleteRuleFunc                        func(ctx context.Context, id HaRuleID) error
	HaDeleteRuleNoCheckFunc                 func(ctx context.Context, id HaRuleID) error
	HaGetRuleFunc                           func(ctx context.Context, id HaRuleID) (HaRule, error)
	HaListRulesFunc                         func(ctx context.Context) (HaRules, error)
	HaListRulesNoCheckFunc                  func(ctx context.Context) (HaRules, error)
	HaUpdateNodeAffinityRuleFunc            func(ctx context.Context, ha HaNodeAffinityRule) error
	HaUpdateNodeAffinityRuleNoCheckFunc     func(ctx context.Context, ha HaNodeAffinityRule) error
	HaUpdateResourceAffinityRuleFunc        func(ctx context.Context, ha HaResourceAffinityRule) error
	HaUpdateResourceAffinityRuleNoCheckFunc func(ctx context.Context, ha HaResourceAffinityRule) error
	// Pool
	PoolGetRawConfigFunc        func(ctx context.Context, pool PoolName) (RawConfigPool, error)
	PoolGetRawConfigNoCheckFunc func(ctx context.Context, pool PoolName) (RawConfigPool, error)
	// User
	UserGetRawConfigFunc func(ctx context.Context, userID UserID) (RawConfigUser, error)
}

func (MockClient) New

func (m MockClient) New() ClientNew

type NodeName

type NodeName string

Only the following characters are allowed: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-". May not start with a hyphen. May not end with a hyphen. Must contain at least one alphabetical character. Max length 63 characters.

func (NodeName) String

func (name NodeName) String() string

func (NodeName) Validate

func (name NodeName) Validate() error

type OperatingSystem

type OperatingSystem string

type PciDeviceID

type PciDeviceID string

Hexadecimal, range 0x0000-0xFFFF, prefixed is optional Set to empty string to remove the device id

func (PciDeviceID) String

func (id PciDeviceID) String() string

func (PciDeviceID) Validate

func (id PciDeviceID) Validate() error

type PciID

type PciID string

0000:00:00.1

func (PciID) String

func (id PciID) String() string

func (PciID) Validate

func (id PciID) Validate() error

type PciMediatedDevice

type PciMediatedDevice string

May not include `,` There are probably more restrictions, but they are not documented.

func (PciMediatedDevice) String

func (mDev PciMediatedDevice) String() string

func (PciMediatedDevice) Validate

func (mDev PciMediatedDevice) Validate() error

type PciSubDeviceID

type PciSubDeviceID string

Hexadecimal, range 0x0000-0xFFFF, prefixed is optional Set to empty string to remove the sub device id

func (PciSubDeviceID) String

func (id PciSubDeviceID) String() string

func (PciSubDeviceID) Validate

func (id PciSubDeviceID) Validate() error

type PciSubVendorID

type PciSubVendorID string

Hexadecimal, range 0x0000-0xFFFF, prefixed is optional Set to empty string to remove the sub vendor id

func (PciSubVendorID) String

func (id PciSubVendorID) String() string

func (PciSubVendorID) Validate

func (id PciSubVendorID) Validate() error

type PciVendorID

type PciVendorID string

Hexadecimal, range 0x0000-0xFFFF, prefixed is optional Set to empty string to remove the vendor id

func (PciVendorID) String

func (id PciVendorID) String() string

func (PciVendorID) Validate

func (id PciVendorID) Validate() error

type Permission

type Permission struct {
	Category   PermissionCategory
	Item       PermissionItem
	Privileges Privileges
}

func (Permission) Validate

func (p Permission) Validate() error

type PermissionCategory

type PermissionCategory string // Enum
const (
	PermissionCategory_Root PermissionCategory = "root"

	PermissionCategory_Access PermissionCategory = "access"

	PermissionCategory_Group PermissionCategory = "group"

	PermissionCategory_Realm PermissionCategory = "realm"

	PermissionCategory_Node PermissionCategory = "node"

	PermissionCategory_Guest PermissionCategory = "guest"

	PermissionCategory_Pool PermissionCategory = "pool"

	PermissionCategory_Storage PermissionCategory = "storage"

	PermissionCategory_Zone PermissionCategory = "zone"
)

func (PermissionCategory) Error

func (PermissionCategory) Error() error

func (PermissionCategory) String

func (c PermissionCategory) String() string

func (PermissionCategory) Validate

func (c PermissionCategory) Validate() error

type PermissionItem

type PermissionItem string

type PoolName

type PoolName string

func ListPools

func ListPools(ctx context.Context, c *Client) ([]PoolName, error)

func (PoolName) AddGuests

func (config PoolName) AddGuests(ctx context.Context, c *Client, guestIDs []GuestID) error

func (PoolName) AddGuestsNoCheck

func (pool PoolName) AddGuestsNoCheck(ctx context.Context, c *Client, guestIDs []GuestID) error

func (PoolName) Delete

func (config PoolName) Delete(ctx context.Context, c *Client) error

func (PoolName) DeleteNoCheck

func (config PoolName) DeleteNoCheck(ctx context.Context, c *Client) error

func (PoolName) Exists

func (config PoolName) Exists(ctx context.Context, c *Client) (bool, error)

func (PoolName) ExistsNoCheck

func (config PoolName) ExistsNoCheck(ctx context.Context, c *Client) (bool, error)

func (PoolName) Get

func (pool PoolName) Get(ctx context.Context, c *Client) (RawConfigPool, error)

func (PoolName) GetNoCheck

func (pool PoolName) GetNoCheck(ctx context.Context, c *Client) (RawConfigPool, error)

func (PoolName) RemoveGuests

func (pool PoolName) RemoveGuests(ctx context.Context, c *Client, guestIDs []GuestID) error

func (PoolName) RemoveGuestsNoChecks

func (pool PoolName) RemoveGuestsNoChecks(ctx context.Context, c *Client, guestIDs []GuestID) error

func (PoolName) SetGuests

func (pool PoolName) SetGuests(ctx context.Context, c *Client, guestIDs []GuestID) error

func (PoolName) SetGuestsNoChecks

func (pool PoolName) SetGuestsNoChecks(ctx context.Context, c *Client, guestID []GuestID) error

func (PoolName) String

func (pool PoolName) String() string

func (PoolName) Validate

func (config PoolName) Validate() error

type PowerState

type PowerState uint8

Enum TODO need custom json marshaller/unmarshaller to handle this type

const (
	PowerStateUnknown PowerState = 0
	PowerStateStopped PowerState = 1
	PowerStateRunning PowerState = 2
)

func (PowerState) String

func (state PowerState) String() string

type PrivilegedFeatures

type PrivilegedFeatures struct {
	CreateDeviceNodes *bool `json:"create_device_nodes,omitempty"` // Never nil when returned
	FUSE              *bool `json:"fuse,omitempty"`                // Never nil when returned
	NFS               *bool `json:"nfs,omitempty"`                 // Never nil when returned
	Nesting           *bool `json:"nesting,omitempty"`             // Never nil when returned
	SMB               *bool `json:"smb,omitempty"`                 // Never nil when returned
}

type Privileges

type Privileges struct {
	DatastoreAllocate         bool `json:"Datastore.Allocate,omitempty"`
	DatastoreAllocateSpace    bool `json:"Datastore.AllocateSpace,omitempty"`
	DatastoreAllocateTemplate bool `json:"Datastore.AllocateTemplate,omitempty"`
	DatastoreAudit            bool `json:"Datastore.Audit,omitempty"`
	GroupAllocate             bool `json:"Group.Allocate,omitempty"`
	PermissionsModify         bool `json:"Permissions.Modify,omitempty"`
	PoolAllocate              bool `json:"Pool.Allocate,omitempty"`
	PoolAudit                 bool `json:"Pool.Audit,omitempty"`
	RealmAllocate             bool `json:"Realm.Allocate,omitempty"`
	RealmAllocateUser         bool `json:"Realm.AllocateUser,omitempty"`
	SDNAllocate               bool `json:"SDN.Allocate,omitempty"`
	SDNAudit                  bool `json:"SDN.Audit,omitempty"`
	SysAudit                  bool `json:"Sys.Audit,omitempty"`
	SysConsole                bool `json:"Sys.Console,omitempty"`
	SysIncoming               bool `json:"Sys.Incoming,omitempty"`
	SysModify                 bool `json:"Sys.Modify,omitempty"`
	SysPowerMgmt              bool `json:"Sys.PowerMgmt,omitempty"`
	SysSyslog                 bool `json:"Sys.Syslog,omitempty"`
	UserModify                bool `json:"User.Modify,omitempty"`
	VMAllocate                bool `json:"VM.Allocate,omitempty"`
	VMAudit                   bool `json:"VM.Audit,omitempty"`
	VMBackup                  bool `json:"VM.Backup,omitempty"`
	VMClone                   bool `json:"VM.Clone,omitempty"`
	VMConfigCDROM             bool `json:"VM.Config.CDROM,omitempty"`
	VMConfigCPU               bool `json:"VM.Config.CPU,omitempty"`
	VMConfigCloudinit         bool `json:"VM.Config.Cloudinit,omitempty"`
	VMConfigDisk              bool `json:"VM.Config.Disk,omitempty"`
	VMConfigHWType            bool `json:"VM.Config.HWType,omitempty"`
	VMConfigMemory            bool `json:"VM.Config.Memory,omitempty"`
	VMConfigNetwork           bool `json:"VM.Config.Network,omitempty"`
	VMConfigOptions           bool `json:"VM.Config.Options,omitempty"`
	VMConsole                 bool `json:"VM.Console,omitempty"`
	VMMigrate                 bool `json:"VM.Migrate,omitempty"`
	VMMonitor                 bool `json:"VM.Monitor,omitempty"`
	VMPowerMgmt               bool `json:"VM.PowerMgmt,omitempty"`
	VMSnapshot                bool `json:"VM.Snapshot,omitempty"`
	VMSnapshotRollback        bool `json:"VM.Snapshot.Rollback,omitempty"`
}

func (Privileges) String

func (p Privileges) String() (privileges string)

type QemuCPU

type QemuCPU struct {
	Affinity     *[]uint          `json:"affinity,omitempty"`
	Cores        *QemuCpuCores    `json:"cores,omitempty"` // Required during creation
	Flags        *CpuFlags        `json:"flags,omitempty"`
	Limit        *CpuLimit        `json:"limit,omitempty"`
	Numa         *bool            `json:"numa,omitempty"`
	Sockets      *QemuCpuSockets  `json:"sockets,omitempty"`
	Type         *CpuType         `json:"type,omitempty"`
	Units        *CpuUnits        `json:"units,omitempty"`
	VirtualCores *CpuVirtualCores `json:"vcores,omitempty"`
}

func (QemuCPU) Validate

func (cpu QemuCPU) Validate(current *QemuCPU, version Version) (err error)

type QemuCdRom

type QemuCdRom struct {
	Iso *IsoFile `json:"iso,omitempty"`
	// Passthrough and File are mutually exclusive
	Passthrough bool `json:"passthrough,omitempty"`
}

func (QemuCdRom) Validate

func (cdRom QemuCdRom) Validate() error

type QemuCloudInitDisk

type QemuCloudInitDisk struct {
	Format  QemuDiskFormat `json:"format,omitempty"`
	Storage string         `json:"storage,omitempty"`
}

func (QemuCloudInitDisk) Validate

func (cloudInit QemuCloudInitDisk) Validate() error

type QemuCpuCores

type QemuCpuCores uint8 // min value 1, max value of 128

func (QemuCpuCores) Validate

func (cores QemuCpuCores) Validate() error

type QemuCpuSockets

type QemuCpuSockets uint8 // min value 1, max value 4

func (QemuCpuSockets) Validate

func (sockets QemuCpuSockets) Validate() error

type QemuDevice

type QemuDevice map[string]interface{}

TODO phase this out

func ParseConf

func ParseConf(
	kvString string,
	confSeparator string,
	subConfSeparator string,
	implicitFirstKey string,
) QemuDevice

ParseConf - Parse standard device conf string `key1=val1,key2=val2`.

func ParseLxcDisk

func ParseLxcDisk(diskStr string) QemuDevice

func ParsePMConf

func ParsePMConf(
	kvString string,
	implicitFirstKey string,
) QemuDevice

type QemuDeviceParam

type QemuDeviceParam []string

TODO phase this out

type QemuDevices

type QemuDevices map[int]map[string]interface{}

TODO phase this out

type QemuDiskAsyncIO

type QemuDiskAsyncIO string
const (
	QemuDiskAsyncIO_Native  QemuDiskAsyncIO = "native"
	QemuDiskAsyncIO_Threads QemuDiskAsyncIO = "threads"
	QemuDiskAsyncIO_IOuring QemuDiskAsyncIO = "io_uring"
)

func (QemuDiskAsyncIO) Error

func (QemuDiskAsyncIO) Error() error

func (QemuDiskAsyncIO) Validate

func (asyncIO QemuDiskAsyncIO) Validate() error

type QemuDiskBandwidth

type QemuDiskBandwidth struct {
	MBps QemuDiskBandwidthMBps `json:"mbps,omitempty"`
	Iops QemuDiskBandwidthIops `json:"iops,omitempty"`
}

func (QemuDiskBandwidth) Validate

func (bandwidth QemuDiskBandwidth) Validate() error

type QemuDiskBandwidthIops

type QemuDiskBandwidthIops struct {
	ReadLimit  QemuDiskBandwidthIopsLimit `json:"read,omitempty"`
	WriteLimit QemuDiskBandwidthIopsLimit `json:"write,omitempty"`
}

func (QemuDiskBandwidthIops) Validate

func (iops QemuDiskBandwidthIops) Validate() error

type QemuDiskBandwidthIopsLimit

type QemuDiskBandwidthIopsLimit struct {
	Burst         QemuDiskBandwidthIopsLimitBurst      `json:"burst,omitempty"`          // 0 = unlimited
	BurstDuration uint                                 `json:"burst_duration,omitempty"` // burst duration in seconds
	Concurrent    QemuDiskBandwidthIopsLimitConcurrent `json:"concurrent,omitempty"`     // 0 = unlimited
}

func (QemuDiskBandwidthIopsLimit) Validate

func (limit QemuDiskBandwidthIopsLimit) Validate() (err error)

type QemuDiskBandwidthIopsLimitBurst

type QemuDiskBandwidthIopsLimitBurst uint

func (QemuDiskBandwidthIopsLimitBurst) Validate

func (limit QemuDiskBandwidthIopsLimitBurst) Validate() error

type QemuDiskBandwidthIopsLimitConcurrent

type QemuDiskBandwidthIopsLimitConcurrent uint

func (QemuDiskBandwidthIopsLimitConcurrent) Validate

type QemuDiskBandwidthMBps

type QemuDiskBandwidthMBps struct {
	ReadLimit  QemuDiskBandwidthMBpsLimit `json:"read,omitempty"`
	WriteLimit QemuDiskBandwidthMBpsLimit `json:"write,omitempty"`
}

func (QemuDiskBandwidthMBps) Validate

func (data QemuDiskBandwidthMBps) Validate() error

type QemuDiskBandwidthMBpsLimit

type QemuDiskBandwidthMBpsLimit struct {
	Burst      QemuDiskBandwidthMBpsLimitBurst      `json:"burst,omitempty"`      // 0 = unlimited
	Concurrent QemuDiskBandwidthMBpsLimitConcurrent `json:"concurrent,omitempty"` // 0 = unlimited
}

func (QemuDiskBandwidthMBpsLimit) Validate

func (limit QemuDiskBandwidthMBpsLimit) Validate() (err error)

type QemuDiskBandwidthMBpsLimitBurst

type QemuDiskBandwidthMBpsLimitBurst float32

func (QemuDiskBandwidthMBpsLimitBurst) Validate

func (limit QemuDiskBandwidthMBpsLimitBurst) Validate() error

type QemuDiskBandwidthMBpsLimitConcurrent

type QemuDiskBandwidthMBpsLimitConcurrent float32

func (QemuDiskBandwidthMBpsLimitConcurrent) Validate

type QemuDiskCache

type QemuDiskCache string
const (
	QemuDiskCache_None         QemuDiskCache = "none"
	QemuDiskCache_WriteThrough QemuDiskCache = "writethrough"
	QemuDiskCache_WriteBack    QemuDiskCache = "writeback"
	QemuDiskCache_Unsafe       QemuDiskCache = "unsafe"
	QemuDiskCache_DirectSync   QemuDiskCache = "directsync"
)

func (QemuDiskCache) Error

func (QemuDiskCache) Error() error

func (QemuDiskCache) Validate

func (cache QemuDiskCache) Validate() error

type QemuDiskFormat

type QemuDiskFormat string
const (
	QemuDiskFormat_Cow   QemuDiskFormat = "cow"
	QemuDiskFormat_Cloop QemuDiskFormat = "cloop"
	QemuDiskFormat_Qcow  QemuDiskFormat = "qcow"
	QemuDiskFormat_Qcow2 QemuDiskFormat = "qcow2"
	QemuDiskFormat_Qed   QemuDiskFormat = "qed"
	QemuDiskFormat_Vmdk  QemuDiskFormat = "vmdk"
	QemuDiskFormat_Raw   QemuDiskFormat = "raw"
)

func (QemuDiskFormat) Error

func (QemuDiskFormat) Error() error

func (QemuDiskFormat) String

func (format QemuDiskFormat) String() string

func (QemuDiskFormat) Validate

func (format QemuDiskFormat) Validate() error

type QemuDiskId

type QemuDiskId string

func (QemuDiskId) String

func (id QemuDiskId) String() string

func (QemuDiskId) Validate

func (id QemuDiskId) Validate() error

type QemuDiskSerial

type QemuDiskSerial string

func (QemuDiskSerial) Validate

func (serial QemuDiskSerial) Validate() error

QemuDiskSerial may only contain the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_ And has a max length of 60 characters

type QemuDiskSize

type QemuDiskSize uint

Amount of Kibibytes the disk should be. Disk size must be greater then 4096.

func (QemuDiskSize) Validate

func (size QemuDiskSize) Validate() error

type QemuGuestAgent

type QemuGuestAgent struct {
	Enable *bool               `json:"enable,omitempty"` // Optional
	Type   *QemuGuestAgentType `json:"type,omitempty"`   // Optional
	Freeze *bool               `json:"freeze,omitempty"` // Optional
	FsTrim *bool               `json:"trim,omitempty"`   // Optional
}

func (QemuGuestAgent) Validate

func (setting QemuGuestAgent) Validate() error

type QemuGuestAgentType

type QemuGuestAgentType string // enum

func (QemuGuestAgentType) Validate

func (q QemuGuestAgentType) Validate() error

type QemuIdeDisk

type QemuIdeDisk struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	Format          QemuDiskFormat    `json:"format"`
	Id              uint              `json:"id"`     //Id is only returned and setting it has no effect
	LinkedDiskId    *GuestID          `json:"linked"` //LinkedClone is only returned and setting it has no effect
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"`
	Storage         string            `json:"storage"`

	WorldWideName QemuWorldWideName `json:"wwn"`
	ImportFrom    string            `json:"import_from,omitempty"`
	Backup        bool              `json:"backup"`
	Discard       bool              `json:"discard"`
	EmulateSSD    bool              `json:"emulatessd"`
	Replicate     bool              `json:"replicate"`
	// contains filtered or unexported fields
}

func (QemuIdeDisk) Validate

func (disk QemuIdeDisk) Validate() error

type QemuIdeDisks

type QemuIdeDisks struct {
	Disk_0 *QemuIdeStorage `json:"0,omitempty"`
	Disk_1 *QemuIdeStorage `json:"1,omitempty"`
	Disk_2 *QemuIdeStorage `json:"2,omitempty"`
	Disk_3 *QemuIdeStorage `json:"3,omitempty"`
}

func (QemuIdeDisks) Validate

func (disks QemuIdeDisks) Validate() (err error)

type QemuIdePassthrough

type QemuIdePassthrough struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	File            string            `json:"file"`
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"` //size is only returned and setting it has no effect
	WorldWideName   QemuWorldWideName `json:"wwn"`
	Backup          bool              `json:"backup"`
	Discard         bool              `json:"discard"`
	EmulateSSD      bool              `json:"emulatessd"`
	Replicate       bool              `json:"replicate"`
}

func (QemuIdePassthrough) Validate

func (passthrough QemuIdePassthrough) Validate() error

type QemuIdeStorage

type QemuIdeStorage struct {
	CdRom       *QemuCdRom          `json:"cdrom,omitempty"`
	CloudInit   *QemuCloudInitDisk  `json:"cloudinit,omitempty"`
	Disk        *QemuIdeDisk        `json:"disk,omitempty"`
	Passthrough *QemuIdePassthrough `json:"passthrough,omitempty"`
	Delete      bool                `json:"delete,omitempty"`
}

func (QemuIdeStorage) Validate

func (storage QemuIdeStorage) Validate() (err error)

type QemuMTU

type QemuMTU struct {
	Inherit bool `json:"inherit,omitempty"`
	Value   MTU  `json:"value,omitempty"`
}

func (QemuMTU) Validate

func (config QemuMTU) Validate() error

type QemuMemory

type QemuMemory struct {
	CapacityMiB        *QemuMemoryCapacity        `json:"capacity,omitempty"` // min 1, max 4178944
	MinimumCapacityMiB *QemuMemoryBalloonCapacity `json:"balloon,omitempty"`  // 0 to clear (balloon), max 4178944
	Shares             *QemuMemoryShares          `json:"shares,omitempty"`   // 0 to clear, max 50000
}

func (QemuMemory) Validate

func (config QemuMemory) Validate(current *QemuMemory) error

type QemuMemoryBalloonCapacity

type QemuMemoryBalloonCapacity uint32 // max 4178944

func (QemuMemoryBalloonCapacity) Validate

func (m QemuMemoryBalloonCapacity) Validate() error

type QemuMemoryCapacity

type QemuMemoryCapacity uint32 // max 4178944

func (QemuMemoryCapacity) Validate

func (m QemuMemoryCapacity) Validate() error

type QemuMemoryShares

type QemuMemoryShares uint16 // max 50000

func (QemuMemoryShares) Validate

func (m QemuMemoryShares) Validate() error

type QemuNetworkInterface

type QemuNetworkInterface struct {
	Bridge        *string           `json:"bridge,omitempty"` // Required for creation
	Delete        bool              `json:"delete,omitempty"`
	Connected     *bool             `json:"connected,omitempty"`
	Firewall      *bool             `json:"firewall,omitempty"`
	MAC           *net.HardwareAddr `json:"mac,omitempty"`
	MTU           *QemuMTU          `json:"mtu,omitempty"`   // only when `Model == QemuNetworkModelVirtIO`
	Model         *QemuNetworkModel `json:"model,omitempty"` // Required for creation
	MultiQueue    *QemuNetworkQueue `json:"queue,omitempty"`
	RateLimitKBps *GuestNetworkRate `json:"rate,omitempty"`
	NativeVlan    *Vlan             `json:"native_vlan,omitempty"`
	TaggedVlans   *Vlans            `json:"tagged_vlans,omitempty"`
	// contains filtered or unexported fields
}

if we get more edge cases, we should give every model its own struct

func (QemuNetworkInterface) Validate

func (config QemuNetworkInterface) Validate(current *QemuNetworkInterface) error

type QemuNetworkInterfaceID

type QemuNetworkInterfaceID uint8

func (QemuNetworkInterfaceID) String

func (id QemuNetworkInterfaceID) String() string

func (QemuNetworkInterfaceID) Validate

func (id QemuNetworkInterfaceID) Validate() error

type QemuNetworkInterfaces

type QemuNetworkInterfaces map[QemuNetworkInterfaceID]QemuNetworkInterface

func (QemuNetworkInterfaces) Validate

func (config QemuNetworkInterfaces) Validate(current QemuNetworkInterfaces) error

type QemuNetworkModel

type QemuNetworkModel string // enum
const (
	QemuNetworkModelE1000        QemuNetworkModel = "e1000"
	QemuNetworkModelE100082540em QemuNetworkModel = "e1000-82540em"

	QemuNetworkModelE100082544gc QemuNetworkModel = "e1000-82544gc"

	QemuNetworkModelE100082545em QemuNetworkModel = "e1000-82545em"

	QemuNetworkModelE1000e   QemuNetworkModel = "e1000e"
	QemuNetworkModelI82551   QemuNetworkModel = "i82551"
	QemuNetworkModelI82557b  QemuNetworkModel = "i82557b"
	QemuNetworkModelI82559er QemuNetworkModel = "i82559er"
	QemuNetworkModelNe2kISA  QemuNetworkModel = "ne2k_isa"

	QemuNetworkModelNe2kPCI QemuNetworkModel = "ne2k_pci"

	QemuNetworkModelPcNet   QemuNetworkModel = "pcnet"
	QemuNetworkModelRtl8139 QemuNetworkModel = "rtl8139"
	QemuNetworkModelVirtIO  QemuNetworkModel = "virtio"
	QemuNetworkModelVmxNet3 QemuNetworkModel = "vmxnet3"
)

func (QemuNetworkModel) Error

func (QemuNetworkModel) Error() error

func (QemuNetworkModel) String

func (model QemuNetworkModel) String() string

returns the model with proper dashes, underscores and capitalization

func (QemuNetworkModel) Validate

func (model QemuNetworkModel) Validate() error

type QemuNetworkQueue

type QemuNetworkQueue uint8 // 0-64, 0 to disable

func (QemuNetworkQueue) Validate

func (queue QemuNetworkQueue) Validate() error

type QemuPci

type QemuPci struct {
	Delete  bool            `json:"delete,omitempty"`
	Mapping *QemuPciMapping `json:"mapping,omitempty"`
	Raw     *QemuPciRaw     `json:"raw,omitempty"`
}

func (QemuPci) Validate

func (config QemuPci) Validate(current QemuPci) error

type QemuPciDevices

type QemuPciDevices map[QemuPciID]QemuPci

func (QemuPciDevices) Validate

func (config QemuPciDevices) Validate(current QemuPciDevices) (err error)

type QemuPciID

type QemuPciID uint8

func (QemuPciID) String

func (id QemuPciID) String() string

func (QemuPciID) Validate

func (id QemuPciID) Validate() error

type QemuPciMapping

type QemuPciMapping struct {
	DeviceID    *PciDeviceID          `json:"device_id,omitempty"`
	ID          *ResourceMappingPciID `json:"id,omitempty"`
	MDev        *PciMediatedDevice    `json:"mdev,omitempty"`
	PCIe        *bool                 `json:"pcie,omitempty"`
	PrimaryGPU  *bool                 `json:"gpu,omitempty"`
	ROMbar      *bool                 `json:"rombar,omitempty"`
	SubDeviceID *PciSubDeviceID       `json:"sub_device_id,omitempty"`
	SubVendorID *PciSubVendorID       `json:"sub_vendor_id,omitempty"`
	VendorID    *PciVendorID          `json:"vendor_id,omitempty"`
}

func (QemuPciMapping) Validate

func (config QemuPciMapping) Validate(current *QemuPciMapping) error

type QemuPciRaw

type QemuPciRaw struct {
	DeviceID    *PciDeviceID       `json:"device_id,omitempty"`
	ID          *PciID             `json:"id,omitempty"`
	MDev        *PciMediatedDevice `json:"mdev,omitempty"`
	PCIe        *bool              `json:"pcie,omitempty"`
	PrimaryGPU  *bool              `json:"gpu,omitempty"`
	ROMbar      *bool              `json:"rombar,omitempty"`
	SubDeviceID *PciSubDeviceID    `json:"sub_device_id,omitempty"`
	SubVendorID *PciSubVendorID    `json:"sub_vendor_id,omitempty"`
	VendorID    *PciVendorID       `json:"vendor_id,omitempty"`
}

func (QemuPciRaw) Validate

func (config QemuPciRaw) Validate(current *QemuPciRaw) error

type QemuSataDisk

type QemuSataDisk struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	Format          QemuDiskFormat    `json:"format"`
	Id              uint              `json:"id"`     //Id is only returned and setting it has no effect
	LinkedDiskId    *GuestID          `json:"linked"` //LinkedClone is only returned and setting it has no effect
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"`
	Storage         string            `json:"storage"`

	WorldWideName QemuWorldWideName `json:"wwn"`
	ImportFrom    string            `json:"import_from,omitempty"`
	Backup        bool              `json:"backup"`
	Discard       bool              `json:"discard"`
	EmulateSSD    bool              `json:"emulatessd"`
	Replicate     bool              `json:"replicate"`
	// contains filtered or unexported fields
}

func (QemuSataDisk) Validate

func (disk QemuSataDisk) Validate() error

type QemuSataDisks

type QemuSataDisks struct {
	Disk_0 *QemuSataStorage `json:"0,omitempty"`
	Disk_1 *QemuSataStorage `json:"1,omitempty"`
	Disk_2 *QemuSataStorage `json:"2,omitempty"`
	Disk_3 *QemuSataStorage `json:"3,omitempty"`
	Disk_4 *QemuSataStorage `json:"4,omitempty"`
	Disk_5 *QemuSataStorage `json:"5,omitempty"`
}

func (QemuSataDisks) Validate

func (disks QemuSataDisks) Validate() (err error)

type QemuSataPassthrough

type QemuSataPassthrough struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	File            string            `json:"file"`
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"` //size is only returned and setting it has no effect
	WorldWideName   QemuWorldWideName `json:"wwn"`
	Backup          bool              `json:"backup"`
	Discard         bool              `json:"discard"`
	EmulateSSD      bool              `json:"emulatessd"`
	Replicate       bool              `json:"replicate"`
}

func (QemuSataPassthrough) Validate

func (passthrough QemuSataPassthrough) Validate() error

type QemuSataStorage

type QemuSataStorage struct {
	CdRom       *QemuCdRom           `json:"cdrom,omitempty"`
	CloudInit   *QemuCloudInitDisk   `json:"cloudinit,omitempty"`
	Disk        *QemuSataDisk        `json:"disk,omitempty"`
	Passthrough *QemuSataPassthrough `json:"passthrough,omitempty"`
	Delete      bool                 `json:"delete,omitempty"`
}

func (QemuSataStorage) Validate

func (storage QemuSataStorage) Validate() (err error)

type QemuScsiDisk

type QemuScsiDisk struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	Format          QemuDiskFormat    `json:"format"`
	Id              uint              `json:"id"`     //Id is only returned and setting it has no effect
	LinkedDiskId    *GuestID          `json:"linked"` //LinkedCloneId is only returned and setting it has no effect
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"`
	Storage         string            `json:"storage"`

	WorldWideName QemuWorldWideName `json:"wwn"`
	ImportFrom    string            `json:"import_from,omitempty"`
	Backup        bool              `json:"backup"`
	Discard       bool              `json:"discard"`
	EmulateSSD    bool              `json:"emulatessd"`
	IOThread      bool              `json:"iothread"`
	ReadOnly      bool              `json:"readonly"`
	Replicate     bool              `json:"replicate"`
	// contains filtered or unexported fields
}

func (QemuScsiDisk) Validate

func (disk QemuScsiDisk) Validate() error

type QemuScsiDisks

type QemuScsiDisks struct {
	Disk_0  *QemuScsiStorage `json:"0,omitempty"`
	Disk_1  *QemuScsiStorage `json:"1,omitempty"`
	Disk_2  *QemuScsiStorage `json:"2,omitempty"`
	Disk_3  *QemuScsiStorage `json:"3,omitempty"`
	Disk_4  *QemuScsiStorage `json:"4,omitempty"`
	Disk_5  *QemuScsiStorage `json:"5,omitempty"`
	Disk_6  *QemuScsiStorage `json:"6,omitempty"`
	Disk_7  *QemuScsiStorage `json:"7,omitempty"`
	Disk_8  *QemuScsiStorage `json:"8,omitempty"`
	Disk_9  *QemuScsiStorage `json:"9,omitempty"`
	Disk_10 *QemuScsiStorage `json:"10,omitempty"`
	Disk_11 *QemuScsiStorage `json:"11,omitempty"`
	Disk_12 *QemuScsiStorage `json:"12,omitempty"`
	Disk_13 *QemuScsiStorage `json:"13,omitempty"`
	Disk_14 *QemuScsiStorage `json:"14,omitempty"`
	Disk_15 *QemuScsiStorage `json:"15,omitempty"`
	Disk_16 *QemuScsiStorage `json:"16,omitempty"`
	Disk_17 *QemuScsiStorage `json:"17,omitempty"`
	Disk_18 *QemuScsiStorage `json:"18,omitempty"`
	Disk_19 *QemuScsiStorage `json:"19,omitempty"`
	Disk_20 *QemuScsiStorage `json:"20,omitempty"`
	Disk_21 *QemuScsiStorage `json:"21,omitempty"`
	Disk_22 *QemuScsiStorage `json:"22,omitempty"`
	Disk_23 *QemuScsiStorage `json:"23,omitempty"`
	Disk_24 *QemuScsiStorage `json:"24,omitempty"`
	Disk_25 *QemuScsiStorage `json:"25,omitempty"`
	Disk_26 *QemuScsiStorage `json:"26,omitempty"`
	Disk_27 *QemuScsiStorage `json:"27,omitempty"`
	Disk_28 *QemuScsiStorage `json:"28,omitempty"`
	Disk_29 *QemuScsiStorage `json:"29,omitempty"`
	Disk_30 *QemuScsiStorage `json:"30,omitempty"`
}

func (QemuScsiDisks) Validate

func (disks QemuScsiDisks) Validate() (err error)

type QemuScsiPassthrough

type QemuScsiPassthrough struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	File            string            `json:"file"`
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"` //size is only returned and setting it has no effect
	WorldWideName   QemuWorldWideName `json:"wwn"`
	Backup          bool              `json:"backup"`
	Discard         bool              `json:"discard"`
	EmulateSSD      bool              `json:"emulatessd"`
	IOThread        bool              `json:"iothread"`
	ReadOnly        bool              `json:"readonly"`
	Replicate       bool              `json:"replicate"`
}

func (QemuScsiPassthrough) Validate

func (passthrough QemuScsiPassthrough) Validate() error

type QemuScsiStorage

type QemuScsiStorage struct {
	CdRom       *QemuCdRom           `json:"cdrom,omitempty"`
	CloudInit   *QemuCloudInitDisk   `json:"cloudinit,omitempty"`
	Disk        *QemuScsiDisk        `json:"disk,omitempty"`
	Passthrough *QemuScsiPassthrough `json:"passthrough,omitempty"`
	Delete      bool                 `json:"delete,omitempty"`
}

func (QemuScsiStorage) Validate

func (storage QemuScsiStorage) Validate() (err error)

type QemuStorages

type QemuStorages struct {
	Ide    *QemuIdeDisks    `json:"ide,omitempty"`
	Sata   *QemuSataDisks   `json:"sata,omitempty"`
	Scsi   *QemuScsiDisks   `json:"scsi,omitempty"`
	VirtIO *QemuVirtIODisks `json:"virtio,omitempty"`
}

func (QemuStorages) Validate

func (storages QemuStorages) Validate() (err error)

type QemuUSB

type QemuUSB struct {
	Delete  bool            `json:"delete,omitempty"`
	Device  *QemuUsbDevice  `json:"device,omitempty"`
	Mapping *QemuUsbMapping `json:"mapping,omitempty"`
	Port    *QemuUsbPort    `json:"port,omitempty"`
	Spice   *QemuUsbSpice   `json:"spice,omitempty"`
}

func (QemuUSB) Validate

func (config QemuUSB) Validate(current *QemuUSB) (err error)

type QemuUSBs

type QemuUSBs map[QemuUsbID]QemuUSB

func (QemuUSBs) Validate

func (config QemuUSBs) Validate(current QemuUSBs) (err error)

type QemuUsbDevice

type QemuUsbDevice struct {
	ID   *UsbDeviceID `json:"id,omitempty"`
	USB3 *bool        `json:"usb3,omitempty"`
}

func (QemuUsbDevice) Validate

func (config QemuUsbDevice) Validate() error

type QemuUsbID

type QemuUsbID uint8

func (QemuUsbID) String

func (id QemuUsbID) String() string

func (QemuUsbID) Validate

func (id QemuUsbID) Validate() error

type QemuUsbMapping

type QemuUsbMapping struct {
	ID   *ResourceMappingUsbID `json:"id,omitempty"`
	USB3 *bool                 `json:"usb3,omitempty"`
}

func (QemuUsbMapping) Validate

func (config QemuUsbMapping) Validate() error

type QemuUsbPort

type QemuUsbPort struct {
	ID   *UsbPortID `json:"id,omitempty"`
	USB3 *bool      `json:"usb3,omitempty"`
}

func (QemuUsbPort) Validate

func (config QemuUsbPort) Validate() error

type QemuUsbSpice

type QemuUsbSpice struct {
	USB3 bool `json:"usb3"`
}

type QemuVirtIODisk

type QemuVirtIODisk struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	Format          QemuDiskFormat    `json:"format"`
	Id              uint              `json:"id"`     //Id is only returned and setting it has no effect
	LinkedDiskId    *GuestID          `json:"linked"` //LinkedCloneId is only returned and setting it has no effect
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"`
	Storage         string            `json:"storage"`

	WorldWideName QemuWorldWideName `json:"wwn"`
	ImportFrom    string            `json:"import_from,omitempty"`
	Backup        bool              `json:"backup"`
	Discard       bool              `json:"discard"`
	IOThread      bool              `json:"iothread"`
	ReadOnly      bool              `json:"readonly"`
	Replicate     bool              `json:"replicate"`
	// contains filtered or unexported fields
}

func (QemuVirtIODisk) Validate

func (disk QemuVirtIODisk) Validate() error

type QemuVirtIODisks

type QemuVirtIODisks struct {
	Disk_0  *QemuVirtIOStorage `json:"0,omitempty"`
	Disk_1  *QemuVirtIOStorage `json:"1,omitempty"`
	Disk_2  *QemuVirtIOStorage `json:"2,omitempty"`
	Disk_3  *QemuVirtIOStorage `json:"3,omitempty"`
	Disk_4  *QemuVirtIOStorage `json:"4,omitempty"`
	Disk_5  *QemuVirtIOStorage `json:"5,omitempty"`
	Disk_6  *QemuVirtIOStorage `json:"6,omitempty"`
	Disk_7  *QemuVirtIOStorage `json:"7,omitempty"`
	Disk_8  *QemuVirtIOStorage `json:"8,omitempty"`
	Disk_9  *QemuVirtIOStorage `json:"9,omitempty"`
	Disk_10 *QemuVirtIOStorage `json:"10,omitempty"`
	Disk_11 *QemuVirtIOStorage `json:"11,omitempty"`
	Disk_12 *QemuVirtIOStorage `json:"12,omitempty"`
	Disk_13 *QemuVirtIOStorage `json:"13,omitempty"`
	Disk_14 *QemuVirtIOStorage `json:"14,omitempty"`
	Disk_15 *QemuVirtIOStorage `json:"15,omitempty"`
}

func (QemuVirtIODisks) Validate

func (disks QemuVirtIODisks) Validate() (err error)

type QemuVirtIOPassthrough

type QemuVirtIOPassthrough struct {
	AsyncIO         QemuDiskAsyncIO   `json:"asyncio,omitempty"`
	Bandwidth       QemuDiskBandwidth `json:"bandwidth,omitempty"`
	Cache           QemuDiskCache     `json:"cache,omitempty"`
	File            string            `json:"file"`
	Serial          QemuDiskSerial    `json:"serial,omitempty"`
	SizeInKibibytes QemuDiskSize      `json:"size"` //size is only returned and setting it has no effect
	WorldWideName   QemuWorldWideName `json:"wwn"`
	Backup          bool              `json:"backup"`
	Discard         bool              `json:"discard"`
	IOThread        bool              `json:"iothread"`
	ReadOnly        bool              `json:"readonly"`
	Replicate       bool              `json:"replicate"`
}

func (QemuVirtIOPassthrough) Validate

func (passthrough QemuVirtIOPassthrough) Validate() error

type QemuVirtIOStorage

type QemuVirtIOStorage struct {
	CdRom       *QemuCdRom             `json:"cdrom,omitempty"`
	CloudInit   *QemuCloudInitDisk     `json:"cloudinit,omitempty"`
	Disk        *QemuVirtIODisk        `json:"disk,omitempty"`
	Passthrough *QemuVirtIOPassthrough `json:"passthrough,omitempty"`
	Delete      bool                   `json:"delete,omitempty"`
}

func (QemuVirtIOStorage) Validate

func (storage QemuVirtIOStorage) Validate() (err error)

type QemuWorldWideName

type QemuWorldWideName string

func (QemuWorldWideName) Validate

func (wwn QemuWorldWideName) Validate() error

type RawConfigLXC

type RawConfigLXC interface {
	Get(vmr VmRef, state PowerState) *ConfigLXC
	GetArchitecture() CpuArchitecture
	GetBootMount() *LxcBootMount
	GetDNS() *GuestDNS
	GetDescription() *string
	GetDigest() [sha1.Size]byte
	GetMemory() LxcMemory
	GetMounts() LxcMounts
	GetName() GuestName
	GetOperatingSystem() OperatingSystem
	GetPrivileged() bool
	GetProtection() bool
	GetSwap() LxcSwap
	GetTags() *Tags
	// contains filtered or unexported methods
}

func NewActiveRawConfigLXCFromApi

func NewActiveRawConfigLXCFromApi(ctx context.Context, vmr *VmRef, c *Client) (raw RawConfigLXC, pending bool, err error)

NewActiveRawConfigLXCFromApi returns the active configuration of the LXC guest. Without pending changes.

func NewRawConfigLXCFromAPI

func NewRawConfigLXCFromAPI(ctx context.Context, vmr *VmRef, c *Client) (RawConfigLXC, error)

NewRawConfigLXCFromAPI returns the configuration of the LXC guest. Including pending changes.

type RawConfigLXCMock

type RawConfigLXCMock struct {
	GetFunc                func(vmr VmRef, state PowerState) *ConfigLXC
	GetArchitectureFunc    func() CpuArchitecture
	GetBootMountFunc       func() *LxcBootMount
	GetDNSFunc             func() *GuestDNS
	GetDescriptionFunc     func() *string
	GetDigestFunc          func() [sha1.Size]byte
	GetMemoryFunc          func() LxcMemory
	GetMountsFunc          func() LxcMounts
	GetNameFunc            func() GuestName
	GetOperatingSystemFunc func() OperatingSystem
	GetPrivilegedFunc      func() bool
	GetProtectionFunc      func() bool
	GetSwapFunc            func() LxcSwap
	GetTagsFunc            func() *Tags
}

RawConfigLXCMock is a mock implementation of the RawConfigLXC interface

func (*RawConfigLXCMock) Get

func (m *RawConfigLXCMock) Get(vmr VmRef, state PowerState) *ConfigLXC

func (*RawConfigLXCMock) GetArchitecture

func (m *RawConfigLXCMock) GetArchitecture() CpuArchitecture

func (*RawConfigLXCMock) GetBootMount

func (m *RawConfigLXCMock) GetBootMount() *LxcBootMount

func (*RawConfigLXCMock) GetDNS

func (m *RawConfigLXCMock) GetDNS() *GuestDNS

func (*RawConfigLXCMock) GetDescription

func (m *RawConfigLXCMock) GetDescription() *string

func (*RawConfigLXCMock) GetDigest

func (m *RawConfigLXCMock) GetDigest() [sha1.Size]byte

func (*RawConfigLXCMock) GetMemory

func (m *RawConfigLXCMock) GetMemory() LxcMemory

func (*RawConfigLXCMock) GetMounts

func (m *RawConfigLXCMock) GetMounts() LxcMounts

func (*RawConfigLXCMock) GetName

func (m *RawConfigLXCMock) GetName() GuestName

func (*RawConfigLXCMock) GetOperatingSystem

func (m *RawConfigLXCMock) GetOperatingSystem() OperatingSystem

func (*RawConfigLXCMock) GetPrivileged

func (m *RawConfigLXCMock) GetPrivileged() bool

func (*RawConfigLXCMock) GetProtection

func (m *RawConfigLXCMock) GetProtection() bool

func (*RawConfigLXCMock) GetSwap

func (m *RawConfigLXCMock) GetSwap() LxcSwap

func (*RawConfigLXCMock) GetTags

func (m *RawConfigLXCMock) GetTags() *Tags

type RawConfigPool

type RawConfigPool interface {
	Get() ConfigPool
	GetName() PoolName
	GetComment() string
	GetGuests() *[]GuestID
}

type RawConfigPoolMock

type RawConfigPoolMock struct {
	GetFunc        func() ConfigPool
	GetNameFunc    func() PoolName
	GetCommentFunc func() string
	GetGuestsFunc  func() *[]GuestID
}

RawConfigPoolMock is a mock implementation of the RawConfigPool interface

func (*RawConfigPoolMock) Get

func (m *RawConfigPoolMock) Get() ConfigPool

func (*RawConfigPoolMock) GetComment

func (m *RawConfigPoolMock) GetComment() string

func (*RawConfigPoolMock) GetGuests

func (m *RawConfigPoolMock) GetGuests() *[]GuestID

func (*RawConfigPoolMock) GetName

func (m *RawConfigPoolMock) GetName() PoolName

type RawConfigQemu

type RawConfigQemu interface {
	Get(vmr *VmRef) (*ConfigQemu, error)
	GetAgent() *QemuGuestAgent
	GetCPU() *QemuCPU
	GetCloudInit() *CloudInit
	GetDescription() string
	GetMemory() *QemuMemory
	GetName() GuestName
	GetNetworks() QemuNetworkInterfaces
	GetPciDevices() QemuPciDevices
	GetProtection() bool
	GetRandomnessDevice() *VirtIoRNG
	GetSerials() SerialInterfaces
	GetTablet() bool
	GetTags() *Tags
	GetUSBs() QemuUSBs
	// contains filtered or unexported methods
}

func NewActiveRawConfigQemuFromApi

func NewActiveRawConfigQemuFromApi(ctx context.Context, vmr *VmRef, c *Client) (raw RawConfigQemu, pending bool, err error)

NewActiveRawConfigQemuFromApi returns the active configuration of the Qemu guest. Without pending changes.

func NewRawConfigQemuFromApi

func NewRawConfigQemuFromApi(ctx context.Context, vmr *VmRef, client *Client) (RawConfigQemu, error)

NewRawConfigQemuFromApi returns the configuration of the Qemu guest. Including pending changes.

type RawConfigQemuMock

type RawConfigQemuMock struct {
	GetAgentFunc            func() *QemuGuestAgent
	GetCPUFunc              func() *QemuCPU
	GetCloudInitFunc        func() *CloudInit
	GetDescriptionFunc      func() string
	GetFunc                 func(vmr *VmRef) (*ConfigQemu, error)
	GetMemoryFunc           func() *QemuMemory
	GetNameFunc             func() GuestName
	GetNetworksFunc         func() QemuNetworkInterfaces
	GetPciDevicesFunc       func() QemuPciDevices
	GetProtectionFunc       func() bool
	GetRandomnessDeviceFunc func() *VirtIoRNG
	GetSerialsFunc          func() SerialInterfaces
	GetTabletFunc           func() bool
	GetTagsFunc             func() *Tags
	GetUSBsFunc             func() QemuUSBs
}

RawConfigQemuMock is a mock implementation of the RawConfigQemu interface

func (*RawConfigQemuMock) Get

func (m *RawConfigQemuMock) Get(vmr *VmRef) (*ConfigQemu, error)

func (*RawConfigQemuMock) GetAgent

func (m *RawConfigQemuMock) GetAgent() *QemuGuestAgent

func (*RawConfigQemuMock) GetCPU

func (m *RawConfigQemuMock) GetCPU() *QemuCPU

func (*RawConfigQemuMock) GetCloudInit

func (m *RawConfigQemuMock) GetCloudInit() *CloudInit

func (*RawConfigQemuMock) GetDescription

func (m *RawConfigQemuMock) GetDescription() string

func (*RawConfigQemuMock) GetMemory

func (m *RawConfigQemuMock) GetMemory() *QemuMemory

func (*RawConfigQemuMock) GetName

func (m *RawConfigQemuMock) GetName() GuestName

func (*RawConfigQemuMock) GetNetworks

func (m *RawConfigQemuMock) GetNetworks() QemuNetworkInterfaces

func (*RawConfigQemuMock) GetPciDevices

func (m *RawConfigQemuMock) GetPciDevices() QemuPciDevices

func (*RawConfigQemuMock) GetProtection

func (m *RawConfigQemuMock) GetProtection() bool

func (*RawConfigQemuMock) GetRandomnessDevice

func (m *RawConfigQemuMock) GetRandomnessDevice() *VirtIoRNG

func (*RawConfigQemuMock) GetSerials

func (m *RawConfigQemuMock) GetSerials() SerialInterfaces

func (*RawConfigQemuMock) GetTablet

func (m *RawConfigQemuMock) GetTablet() bool

func (*RawConfigQemuMock) GetTags

func (m *RawConfigQemuMock) GetTags() *Tags

func (*RawConfigQemuMock) GetUSBs

func (m *RawConfigQemuMock) GetUSBs() QemuUSBs

type RawConfigUser

type RawConfigUser interface {
	Get() *ConfigUser
	GetComment() string
	GetEmail() string
	GetEnable() bool
	GetExpire() uint
	GetFirstName() string
	GetGroups() *[]GroupName
	GetKeys() string
	GetLastName() string
	GetUser() UserID
}

func NewRawConfigUserFromApi

func NewRawConfigUserFromApi(ctx context.Context, userID UserID, c *Client) (RawConfigUser, error)

type RawConfigUserMock

type RawConfigUserMock struct {
	GetFunc          func() *ConfigUser
	GetCommentFunc   func() string
	GetEmailFunc     func() string
	GetEnableFunc    func() bool
	GetExpireFunc    func() uint
	GetFirstNameFunc func() string
	GetGroupsFunc    func() []GroupName
	GetKeysFunc      func() string
	GetLastNameFunc  func() string
	GetUserFunc      func() UserID
}

RawConfigUserMock is a mock implementation of the RawConfigUser interface

func (*RawConfigUserMock) Get

func (m *RawConfigUserMock) Get() *ConfigUser

func (*RawConfigUserMock) GetComment

func (m *RawConfigUserMock) GetComment() string

func (*RawConfigUserMock) GetEmail

func (m *RawConfigUserMock) GetEmail() string

func (*RawConfigUserMock) GetEnable

func (m *RawConfigUserMock) GetEnable() bool

func (*RawConfigUserMock) GetExpire

func (m *RawConfigUserMock) GetExpire() uint

func (*RawConfigUserMock) GetFirstName

func (m *RawConfigUserMock) GetFirstName() string

func (*RawConfigUserMock) GetGroups

func (m *RawConfigUserMock) GetGroups() []GroupName

func (*RawConfigUserMock) GetKeys

func (m *RawConfigUserMock) GetKeys() string

func (*RawConfigUserMock) GetLastName

func (m *RawConfigUserMock) GetLastName() string

func (*RawConfigUserMock) GetUser

func (m *RawConfigUserMock) GetUser() UserID

type RawGuestResource

type RawGuestResource interface {
	Get() GuestResource
	GetCPUcores() uint
	GetCPUusage() float64
	GetDiskReadTotal() uint
	GetDiskSizeInBytes() uint
	GetDiskUsedInBytes() uint
	GetDiskWriteTotal() uint
	GetHaState() string
	GetID() GuestID
	GetMemoryTotalInBytes() uint
	GetMemoryUsedInBytes() uint
	GetName() GuestName
	GetNetworkIn() uint
	GetNetworkOut() uint
	GetNode() NodeName
	GetPool() PoolName
	GetStatus() PowerState
	GetTags() Tags
	GetTemplate() bool
	GetType() GuestType
	GetUptime() time.Duration
}

type RawGuestResourceMock

type RawGuestResourceMock struct {
	GetFunc                   func() GuestResource
	GetCPUcoresFunc           func() uint
	GetCPUusageFunc           func() float64
	GetDiskReadTotalFunc      func() uint
	GetDiskSizeInBytesFunc    func() uint
	GetDiskUsedInBytesFunc    func() uint
	GetDiskWriteTotalFunc     func() uint
	GetHaStateFunc            func() string
	GetIDFunc                 func() GuestID
	GetMemoryTotalInBytesFunc func() uint
	GetMemoryUsedInBytesFunc  func() uint
	GetNameFunc               func() GuestName
	GetNetworkInFunc          func() uint
	GetNetworkOutFunc         func() uint
	GetNodeFunc               func() NodeName
	GetPoolFunc               func() PoolName
	GetStatusFunc             func() PowerState
	GetTagsFunc               func() Tags
	GetTemplateFunc           func() bool
	GetTypeFunc               func() GuestType
	GetUptimeFunc             func() time.Duration
}

RawGuestResourceMock is a mock implementation of the RawGuestResource interface

func (*RawGuestResourceMock) Get

func (*RawGuestResourceMock) GetCPUcores

func (m *RawGuestResourceMock) GetCPUcores() uint

func (*RawGuestResourceMock) GetCPUusage

func (m *RawGuestResourceMock) GetCPUusage() float64

func (*RawGuestResourceMock) GetDiskReadTotal

func (m *RawGuestResourceMock) GetDiskReadTotal() uint

func (*RawGuestResourceMock) GetDiskSizeInBytes

func (m *RawGuestResourceMock) GetDiskSizeInBytes() uint

func (*RawGuestResourceMock) GetDiskUsedInBytes

func (m *RawGuestResourceMock) GetDiskUsedInBytes() uint

func (*RawGuestResourceMock) GetDiskWriteTotal

func (m *RawGuestResourceMock) GetDiskWriteTotal() uint

func (*RawGuestResourceMock) GetHaState

func (m *RawGuestResourceMock) GetHaState() string

func (*RawGuestResourceMock) GetID

func (m *RawGuestResourceMock) GetID() GuestID

func (*RawGuestResourceMock) GetMemoryTotalInBytes

func (m *RawGuestResourceMock) GetMemoryTotalInBytes() uint

func (*RawGuestResourceMock) GetMemoryUsedInBytes

func (m *RawGuestResourceMock) GetMemoryUsedInBytes() uint

func (*RawGuestResourceMock) GetName

func (m *RawGuestResourceMock) GetName() GuestName

func (*RawGuestResourceMock) GetNetworkIn

func (m *RawGuestResourceMock) GetNetworkIn() uint

func (*RawGuestResourceMock) GetNetworkOut

func (m *RawGuestResourceMock) GetNetworkOut() uint

func (*RawGuestResourceMock) GetNode

func (m *RawGuestResourceMock) GetNode() NodeName

func (*RawGuestResourceMock) GetPool

func (m *RawGuestResourceMock) GetPool() PoolName

func (*RawGuestResourceMock) GetStatus

func (m *RawGuestResourceMock) GetStatus() PowerState

func (*RawGuestResourceMock) GetTags

func (m *RawGuestResourceMock) GetTags() Tags

func (*RawGuestResourceMock) GetTemplate

func (m *RawGuestResourceMock) GetTemplate() bool

func (*RawGuestResourceMock) GetType

func (m *RawGuestResourceMock) GetType() GuestType

func (*RawGuestResourceMock) GetUptime

func (m *RawGuestResourceMock) GetUptime() time.Duration

type RawGuestResources

type RawGuestResources []RawGuestResource

func ListGuests

func ListGuests(ctx context.Context, c *Client) (RawGuestResources, error)

List all guest the user has viewing rights for in the cluster

func (RawGuestResources) Get

func (r RawGuestResources) Get() []GuestResource

func (RawGuestResources) SelectID

func (r RawGuestResources) SelectID(id GuestID) (RawGuestResource, error)

type RawGuestStatus

type RawGuestStatus map[string]any

func (RawGuestStatus) Get

func (raw RawGuestStatus) Get() GuestStatus

func (RawGuestStatus) GetName

func (raw RawGuestStatus) GetName() GuestName

func (RawGuestStatus) GetState

func (raw RawGuestStatus) GetState() PowerState

func (RawGuestStatus) GetUptime

func (raw RawGuestStatus) GetUptime() time.Duration

type RawHaNodeAffinityRule

type RawHaNodeAffinityRule interface {
	Get() HaNodeAffinityRule
	GetComment() string
	GetDigest() [sha1.Size]byte
	GetEnabled() bool
	GetGuests() []VmRef
	GetID() HaRuleID
	GetNodes() []HaNode
	GetStrict() bool
}

type RawHaResourceAffinityRule

type RawHaResourceAffinityRule interface {
	Get() HaResourceAffinityRule
	GetAffinity() HaAffinity
	GetComment() string
	GetDigest() [sha1.Size]byte
	GetEnabled() bool
	GetGuests() []VmRef
	GetID() HaRuleID
}

type ResourceMappingPciID

type ResourceMappingPciID string

minimum length: 2 ,maximum length: 128 ,regex: ^\w(\w|\d|_|-){1,127}$

func (ResourceMappingPciID) String

func (id ResourceMappingPciID) String() string

func (ResourceMappingPciID) Validate

func (id ResourceMappingPciID) Validate() error

type ResourceMappingUsbID

type ResourceMappingUsbID string

minimum length: 2 ,maximum length: 128 ,regex: ^\w(\w|\d|_|-){1,127}$

func (ResourceMappingUsbID) String

func (id ResourceMappingUsbID) String() string

func (ResourceMappingUsbID) Validate

func (id ResourceMappingUsbID) Validate() error

type SerialID

type SerialID uint8

func (SerialID) String

func (id SerialID) String() string

func (SerialID) Validate

func (id SerialID) Validate() error

type SerialInterface

type SerialInterface struct {
	Path   SerialPath `json:"path,omitempty"`   // Path to the serial device. Mutually exclusive with socket.
	Socket bool       `json:"socket,omitempty"` // If true, the serial device is a socket. Mutually exclusive with path.
	Delete bool       `json:"delete,omitempty"` // If true, the serial adapter will be removed.
}

func (SerialInterface) Validate

func (port SerialInterface) Validate() error

type SerialInterfaces

type SerialInterfaces map[SerialID]SerialInterface

func (SerialInterfaces) Validate

func (s SerialInterfaces) Validate() error

type SerialPath

type SerialPath string

func (SerialPath) Validate

func (path SerialPath) Validate() error

type Session

type Session struct {
	ApiUrl     string
	AuthTicket string
	CsrfToken  string
	AuthToken  string // Combination of user, realm, token ID and UUID
	Headers    http.Header
	// contains filtered or unexported fields
}

func NewSession

func NewSession(apiUrl string, hclient *http.Client, proxyString string, tls *tls.Config) (session *Session, err error)

func (*Session) NewRequest

func (s *Session) NewRequest(ctx context.Context, method, url string, headers *http.Header, body io.Reader) (req *http.Request, err error)

type Snapshot

type Snapshot struct {
	Name        SnapshotName `json:"name"`
	SnapTime    uint         `json:"time,omitempty"`
	Description string       `json:"description,omitempty"`
	VmState     bool         `json:"ram,omitempty"`
	Children    []*Snapshot  `json:"children,omitempty"`
	Parent      SnapshotName `json:"parent,omitempty"`
}

Used for formatting the output when retrieving snapshots

type SnapshotName

type SnapshotName string

Minimum length of 3 characters Maximum length of 40 characters First character must be a letter Must only contain the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_

func (SnapshotName) Delete

func (snap SnapshotName) Delete(ctx context.Context, c *Client, vmr *VmRef) (exitStatus string, err error)

Deletes the specified snapshot, validates the input

func (SnapshotName) DeleteNoCheck

func (snap SnapshotName) DeleteNoCheck(ctx context.Context, c *Client, vmr *VmRef) (exitStatus string, err error)

Deletes the specified snapshot without validating the input, use SnapshotName.Delete() to validate the input.

func (SnapshotName) Rollback

func (snap SnapshotName) Rollback(ctx context.Context, c *Client, vmr *VmRef) (exitStatus string, err error)

Rollback to the specified snapshot, validates the input

func (SnapshotName) RollbackNoCheck

func (snap SnapshotName) RollbackNoCheck(ctx context.Context, c *Client, vmr *VmRef) (exitStatus string, err error)

Rollback to the specified snapshot without validating the input, use SnapshotName.Rollback() to validate the input.

func (SnapshotName) UpdateDescription

func (snap SnapshotName) UpdateDescription(ctx context.Context, c *Client, vmr *VmRef, description string) (err error)

Updates the description of the specified snapshot, validates the input

func (SnapshotName) UpdateDescriptionNoCheck

func (snap SnapshotName) UpdateDescriptionNoCheck(ctx context.Context, c *Client, vmr *VmRef, description string) error

Updates the description of the specified snapshot without validating the input, use SnapshotName.UpdateDescription() to validate the input.

func (SnapshotName) Validate

func (name SnapshotName) Validate() error

type Tag

type Tag string

func (Tag) String

func (t Tag) String() string

func (Tag) Validate

func (t Tag) Validate() error

type Tags

type Tags []Tag

func (Tags) Len

func (t Tags) Len() int

func (Tags) Less

func (t Tags) Less(i, j int) bool

func (Tags) String

func (t Tags) String() string

func (Tags) Swap

func (t Tags) Swap(i, j int)

func (Tags) Validate

func (t Tags) Validate() error

type TemplateItem

type TemplateItem struct {
	Architecture   string
	Description    string
	Headline       string
	InfoPage       string
	Location       string
	ManageURL      string
	OS             string
	Package        string
	Section        string
	SHA512Checksum string
	Source         string
	Template       string
	Type           string
	Version        string
}

type TpmState

type TpmState struct {
	Delete  bool        `json:"remove,omitempty"`  // If true, the tpmstate will be deleted.
	Storage string      `json:"storage"`           // TODO change to proper type once the type is added.
	Version *TpmVersion `json:"version,omitempty"` // Changing version will delete the current tpmstate and create a new one. Optional during update, required during create.
}

func (TpmState) Validate

func (t TpmState) Validate(current *TpmState) error

type TpmVersion

type TpmVersion string // enum

func (TpmVersion) Validate

func (t TpmVersion) Validate() error

type TriBool

type TriBool int8

func (TriBool) MarshalJSON

func (b TriBool) MarshalJSON() ([]byte, error)

func (*TriBool) UnmarshalJSON

func (b *TriBool) UnmarshalJSON(data []byte) error

func (TriBool) Validate

func (b TriBool) Validate() error

type UnprivilegedFeatures

type UnprivilegedFeatures struct {
	CreateDeviceNodes *bool `json:"create_device_nodes,omitempty"` // Never nil when returned
	FUSE              *bool `json:"fuse,omitempty"`                // Never nil when returned
	KeyCtl            *bool `json:"keyctl,omitempty"`              // Never nil when returned
	Nesting           *bool `json:"nesting,omitempty"`             // Never nil when returned
}

type UsbDeviceID

type UsbDeviceID string

func (UsbDeviceID) String

func (id UsbDeviceID) String() string

func (UsbDeviceID) Validate

func (id UsbDeviceID) Validate() error

type UsbPortID

type UsbPortID string // regex: \d+-\d+

func (UsbPortID) String

func (id UsbPortID) String() string

func (UsbPortID) Validate

func (id UsbPortID) Validate() error

type UserID

type UserID struct {
	// TODO create custom type for Name.
	// the name only seems to allows some characters, and using the string type would imply that all characters are allowed.
	// https://bugzilla.proxmox.com/show_bug.cgi?id=4461
	Name string `json:"name"`
	// TODO create custom type for Realm.
	// the realm only allows some characters, and using the string type would imply that all characters are allowed.
	// https://bugzilla.proxmox.com/show_bug.cgi?id=4462
	Realm string `json:"realm"`
}

func NewUserID

func NewUserID(userId string) (id UserID, err error)

Converts "username@realm" to a UserID object

func (UserID) String

func (id UserID) String() string

Converts the userID to "username@realm" Returns an empty string when either the Name or Realm is empty

func (UserID) ToString

func (id UserID) ToString() string

deprecated use String() instead

func (UserID) Validate

func (id UserID) Validate() error

TODO improve when Name and Realm have their own types

type UserPassword

type UserPassword string

May be empty or should be at least be 5 characters long.

func (UserPassword) Validate

func (password UserPassword) Validate() error

type Version

type Version struct {
	Major uint8
	Minor uint8
	Patch uint8
}

func (Version) Encode

func (v Version) Encode() EncodedVersion

func (Version) Greater

func (v Version) Greater(other Version) bool

Greater returns true if the version is greater than the other version.

func (Version) Smaller

func (v Version) Smaller(other Version) bool

Smaller returns true if the version is less than the other version.

func (Version) String

func (v Version) String() string

type VirtIoRNG

type VirtIoRNG struct {
	Limit  *uint          `json:"limit,omitempty"`
	Period *time.Duration `json:"period,omitempty"`
	Source *EntropySource `json:"source,omitempty"` // Never nil when returned
	Delete bool           `json:"delete,omitempty"`
}

func (VirtIoRNG) Validate

func (config VirtIoRNG) Validate(current *VirtIoRNG) error

type Vlan

type Vlan uint16 // 0-4095, 0 means no vlan

func (Vlan) String

func (config Vlan) String() string

func (Vlan) Validate

func (config Vlan) Validate() error

type Vlans

type Vlans []Vlan

func (Vlans) Validate

func (config Vlans) Validate() error

type VmRef

type VmRef struct {
	// contains filtered or unexported fields
}

VmRef - virtual machine ref parts map[type:qemu node:proxmox1-xx id:qemu/132 diskread:5.57424738e+08 disk:0 netin:5.9297450593e+10 mem:3.3235968e+09 uptime:1.4567097e+07 vmid:132 template:0 maxcpu:2 netout:6.053310416e+09 maxdisk:3.4359738368e+10 maxmem:8.592031744e+09 diskwrite:1.49663619584e+12 status:running cpu:0.00386980694947209 name:appt-app1-dev.xxx.xx]

func NewVmRef

func NewVmRef(vmId GuestID) (vmr *VmRef)

func (*VmRef) CloneLxc

func (vmr *VmRef) CloneLxc(ctx context.Context, settings CloneLxcTarget, c *Client) (*VmRef, error)

CloneLxc clones a new LXC container by cloning current container

func (*VmRef) CloneLxcNoCheck

func (vmr *VmRef) CloneLxcNoCheck(ctx context.Context, settings CloneLxcTarget, c *Client) (*VmRef, error)

CloneLxcNoCheck creates a new LXC container by cloning the current container, without input validation.

func (*VmRef) CloneQemu

func (vmr *VmRef) CloneQemu(ctx context.Context, settings CloneQemuTarget, c *Client) (*VmRef, error)

CloneQemu creates a new Qemu VM by cloning the current VM.

func (*VmRef) CloneQemuNoCheck

func (vmr *VmRef) CloneQemuNoCheck(ctx context.Context, settings CloneQemuTarget, c *Client) (*VmRef, error)

CloneQemuNoCheck creates a new VM by cloning the current VM, without input validation.

func (VmRef) Delete

func (vmr VmRef) Delete(ctx context.Context, c *Client) error

func (VmRef) DeleteNoCheck

func (vmr VmRef) DeleteNoCheck(ctx context.Context, c *Client) error

func (*VmRef) ForceStop

func (vmr *VmRef) ForceStop(ctx context.Context, c *Client) error

func (*VmRef) GetAgentInformation

func (vmr *VmRef) GetAgentInformation(ctx context.Context, c *Client, statistics bool) ([]AgentNetworkInterface, error)

func (*VmRef) GetRawGuestStatus

func (vmr *VmRef) GetRawGuestStatus(ctx context.Context, c *Client) (RawGuestStatus, error)

func (*VmRef) GetVmType

func (vmr *VmRef) GetVmType() GuestType

func (*VmRef) HaGroup

func (vmr *VmRef) HaGroup() string

func (*VmRef) HaState

func (vmr *VmRef) HaState() string

func (*VmRef) Migrate

func (vmr *VmRef) Migrate(ctx context.Context, c *Client, newNode NodeName, LiveMigrate bool) error

func (*VmRef) MigrateNoCheck

func (vmr *VmRef) MigrateNoCheck(ctx context.Context, c *Client, newNode NodeName, LiveMigrate bool) error

func (*VmRef) Node

func (vmr *VmRef) Node() NodeName

func (*VmRef) PendingChanges

func (vmr *VmRef) PendingChanges(ctx context.Context, c *Client) (bool, error)

func (*VmRef) Pool

func (vmr *VmRef) Pool() PoolName

func (*VmRef) SetNode

func (vmr *VmRef) SetNode(node string)

func (*VmRef) SetPool

func (vmr *VmRef) SetPool(pool string)

func (*VmRef) SetVmType

func (vmr *VmRef) SetVmType(vmType GuestType)

func (*VmRef) Stop

func (vmr *VmRef) Stop(ctx context.Context, c *Client) error

func (*VmRef) VmId

func (vmr *VmRef) VmId() GuestID

Jump to

Keyboard shortcuts

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