diff --git a/proxmox/types/disk_size.go b/internal/types/disk_size.go similarity index 100% rename from proxmox/types/disk_size.go rename to internal/types/disk_size.go diff --git a/proxmox/types/disk_size_test.go b/internal/types/disk_size_test.go similarity index 100% rename from proxmox/types/disk_size_test.go rename to internal/types/disk_size_test.go diff --git a/proxmox/types/helpers.go b/internal/types/helpers.go similarity index 72% rename from proxmox/types/helpers.go rename to internal/types/helpers.go index 3cbed2410..683495170 100644 --- a/proxmox/types/helpers.go +++ b/internal/types/helpers.go @@ -6,15 +6,13 @@ package types -import "github.com/bpg/terraform-provider-proxmox/internal/types" - // StrPtr returns a pointer to a string. func StrPtr(s string) *string { return &s } // BoolPtr returns a pointer to a bool. -func BoolPtr(s bool) *types.CustomBool { - customBool := types.CustomBool(s) +func BoolPtr(s bool) *CustomBool { + customBool := CustomBool(s) return &customBool } diff --git a/proxmox/nodes/containers/container.go b/proxmox/nodes/containers/containers.go similarity index 100% rename from proxmox/nodes/containers/container.go rename to proxmox/nodes/containers/containers.go diff --git a/proxmox/nodes/containers/container_types.go b/proxmox/nodes/containers/containers_types.go similarity index 78% rename from proxmox/nodes/containers/container_types.go rename to proxmox/nodes/containers/containers_types.go index ce6bde418..1ad3a3f35 100644 --- a/proxmox/nodes/containers/container_types.go +++ b/proxmox/nodes/containers/containers_types.go @@ -13,27 +13,26 @@ import ( "strconv" "strings" - types2 "github.com/bpg/terraform-provider-proxmox/internal/types" - "github.com/bpg/terraform-provider-proxmox/proxmox/types" + "github.com/bpg/terraform-provider-proxmox/internal/types" ) // CloneRequestBody contains the data for an container clone request. type CloneRequestBody struct { - BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` - Description *string `json:"description,omitempty" url:"description,omitempty"` - FullCopy *types2.CustomBool `json:"full,omitempty" url:"full,omitempty,int"` - Hostname *string `json:"hostname,omitempty" url:"hostname,omitempty"` - PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` - SnapshotName *string `json:"snapname,omitempty" url:"snapname,omitempty"` - TargetNodeName *string `json:"target,omitempty" url:"target,omitempty"` - TargetStorage *string `json:"storage,omitempty" url:"storage,omitempty"` - VMIDNew int `json:"newid" url:"newid"` + BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` + Description *string `json:"description,omitempty" url:"description,omitempty"` + FullCopy *types.CustomBool `json:"full,omitempty" url:"full,omitempty,int"` + Hostname *string `json:"hostname,omitempty" url:"hostname,omitempty"` + PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` + SnapshotName *string `json:"snapname,omitempty" url:"snapname,omitempty"` + TargetNodeName *string `json:"target,omitempty" url:"target,omitempty"` + TargetStorage *string `json:"storage,omitempty" url:"storage,omitempty"` + VMIDNew int `json:"newid" url:"newid"` } // CreateRequestBody contains the data for a user create request. type CreateRequestBody struct { BandwidthLimit *float64 `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` - ConsoleEnabled *types2.CustomBool `json:"console,omitempty" url:"console,omitempty,int"` + ConsoleEnabled *types.CustomBool `json:"console,omitempty" url:"console,omitempty,int"` ConsoleMode *string `json:"cmode,omitempty" url:"cmode,omitempty"` CPUArchitecture *string `json:"arch,omitempty" url:"arch,omitempty"` CPUCores *int `json:"cores,omitempty" url:"cores,omitempty"` @@ -46,10 +45,10 @@ type CreateRequestBody struct { DNSDomain *string `json:"searchdomain,omitempty" url:"searchdomain,omitempty"` DNSServer *string `json:"nameserver,omitempty" url:"nameserver,omitempty"` Features *CustomFeatures `json:"features,omitempty" url:"features,omitempty"` - Force *types2.CustomBool `json:"force,omitempty" url:"force,omitempty,int"` + Force *types.CustomBool `json:"force,omitempty" url:"force,omitempty,int"` HookScript *string `json:"hookscript,omitempty" url:"hookscript,omitempty"` Hostname *string `json:"hostname,omitempty" url:"hostname,omitempty"` - IgnoreUnpackErrors *types2.CustomBool `json:"ignore-unpack-errors,omitempty" url:"force,omitempty,int"` + IgnoreUnpackErrors *types.CustomBool `json:"ignore-unpack-errors,omitempty" url:"force,omitempty,int"` Lock *string `json:"lock,omitempty" url:"lock,omitempty,int"` MountPoints CustomMountPointArray `json:"mp,omitempty" url:"mp,omitempty,numbered"` NetworkInterfaces CustomNetworkInterfaceArray `json:"net,omitempty" url:"net,omitempty,numbered"` @@ -57,43 +56,43 @@ type CreateRequestBody struct { OSType *string `json:"ostype,omitempty" url:"ostype,omitempty"` Password *string `json:"password,omitempty" url:"password,omitempty"` PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` - Protection *types2.CustomBool `json:"protection,omitempty" url:"protection,omitempty,int"` - Restore *types2.CustomBool `json:"restore,omitempty" url:"restore,omitempty,int"` + Protection *types.CustomBool `json:"protection,omitempty" url:"protection,omitempty,int"` + Restore *types.CustomBool `json:"restore,omitempty" url:"restore,omitempty,int"` RootFS *CustomRootFS `json:"rootfs,omitempty" url:"rootfs,omitempty"` SSHKeys *CustomSSHKeys `json:"ssh-public-keys,omitempty" url:"ssh-public-keys,omitempty"` - Start *types2.CustomBool `json:"start,omitempty" url:"start,omitempty,int"` - StartOnBoot *types2.CustomBool `json:"onboot,omitempty" url:"onboot,omitempty,int"` + Start *types.CustomBool `json:"start,omitempty" url:"start,omitempty,int"` + StartOnBoot *types.CustomBool `json:"onboot,omitempty" url:"onboot,omitempty,int"` StartupBehavior *CustomStartupBehavior `json:"startup,omitempty" url:"startup,omitempty"` Swap *int `json:"swap,omitempty" url:"swap,omitempty"` Tags *string `json:"tags,omitempty" url:"tags,omitempty"` - Template *types2.CustomBool `json:"template,omitempty" url:"template,omitempty,int"` + Template *types.CustomBool `json:"template,omitempty" url:"template,omitempty,int"` TTY *int `json:"tty,omitempty" url:"tty,omitempty"` - Unique *types2.CustomBool `json:"unique,omitempty" url:"unique,omitempty,int"` - Unprivileged *types2.CustomBool `json:"unprivileged,omitempty" url:"unprivileged,omitempty,int"` + Unique *types.CustomBool `json:"unique,omitempty" url:"unique,omitempty,int"` + Unprivileged *types.CustomBool `json:"unprivileged,omitempty" url:"unprivileged,omitempty,int"` VMID *int `json:"vmid,omitempty" url:"vmid,omitempty"` } // CustomFeatures contains the values for the "features" property. type CustomFeatures struct { - FUSE *types2.CustomBool `json:"fuse,omitempty" url:"fuse,omitempty,int"` - KeyControl *types2.CustomBool `json:"keyctl,omitempty" url:"keyctl,omitempty,int"` - MountTypes *[]string `json:"mount,omitempty" url:"mount,omitempty"` - Nesting *types2.CustomBool `json:"nesting,omitempty" url:"nesting,omitempty,int"` + FUSE *types.CustomBool `json:"fuse,omitempty" url:"fuse,omitempty,int"` + KeyControl *types.CustomBool `json:"keyctl,omitempty" url:"keyctl,omitempty,int"` + MountTypes *[]string `json:"mount,omitempty" url:"mount,omitempty"` + Nesting *types.CustomBool `json:"nesting,omitempty" url:"nesting,omitempty,int"` } // CustomMountPoint contains the values for the "mp[n]" properties. type CustomMountPoint struct { - ACL *types2.CustomBool `json:"acl,omitempty" url:"acl,omitempty,int"` - Backup *types2.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"` - DiskSize *string `json:"size,omitempty" url:"size,omitempty"` - Enabled bool `json:"-" url:"-"` - MountOptions *[]string `json:"mountoptions,omitempty" url:"mountoptions,omitempty"` - MountPoint string `json:"mp" url:"mp"` - Quota *types2.CustomBool `json:"quota,omitempty" url:"quota,omitempty,int"` - ReadOnly *types2.CustomBool `json:"ro,omitempty" url:"ro,omitempty,int"` - Replicate *types2.CustomBool `json:"replicate,omitempty" url:"replicate,omitempty,int"` - Shared *types2.CustomBool `json:"shared,omitempty" url:"shared,omitempty,int"` - Volume string `json:"volume" url:"volume"` + ACL *types.CustomBool `json:"acl,omitempty" url:"acl,omitempty,int"` + Backup *types.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"` + DiskSize *string `json:"size,omitempty" url:"size,omitempty"` + Enabled bool `json:"-" url:"-"` + MountOptions *[]string `json:"mountoptions,omitempty" url:"mountoptions,omitempty"` + MountPoint string `json:"mp" url:"mp"` + Quota *types.CustomBool `json:"quota,omitempty" url:"quota,omitempty,int"` + ReadOnly *types.CustomBool `json:"ro,omitempty" url:"ro,omitempty,int"` + Replicate *types.CustomBool `json:"replicate,omitempty" url:"replicate,omitempty,int"` + Shared *types.CustomBool `json:"shared,omitempty" url:"shared,omitempty,int"` + Volume string `json:"volume" url:"volume"` } // CustomMountPointArray is an array of CustomMountPoint. @@ -101,20 +100,20 @@ type CustomMountPointArray []CustomMountPoint // CustomNetworkInterface contains the values for the "net[n]" properties. type CustomNetworkInterface struct { - Bridge *string `json:"bridge,omitempty" url:"bridge,omitempty"` - Enabled bool `json:"-" url:"-"` - Firewall *types2.CustomBool `json:"firewall,omitempty" url:"firewall,omitempty,int"` - IPv4Address *string `json:"ip,omitempty" url:"ip,omitempty"` - IPv4Gateway *string `json:"gw,omitempty" url:"gw,omitempty"` - IPv6Address *string `json:"ip6,omitempty" url:"ip6,omitempty"` - IPv6Gateway *string `json:"gw6,omitempty" url:"gw6,omitempty"` - MACAddress *string `json:"hwaddr,omitempty" url:"hwaddr,omitempty"` - MTU *int `json:"mtu,omitempty" url:"mtu,omitempty"` - Name string `json:"name" url:"name"` - RateLimit *float64 `json:"rate,omitempty" url:"rate,omitempty"` - Tag *int `json:"tag,omitempty" url:"tag,omitempty"` - Trunks *[]int `json:"trunks,omitempty" url:"trunks,omitempty"` - Type *string `json:"type,omitempty" url:"type,omitempty"` + Bridge *string `json:"bridge,omitempty" url:"bridge,omitempty"` + Enabled bool `json:"-" url:"-"` + Firewall *types.CustomBool `json:"firewall,omitempty" url:"firewall,omitempty,int"` + IPv4Address *string `json:"ip,omitempty" url:"ip,omitempty"` + IPv4Gateway *string `json:"gw,omitempty" url:"gw,omitempty"` + IPv6Address *string `json:"ip6,omitempty" url:"ip6,omitempty"` + IPv6Gateway *string `json:"gw6,omitempty" url:"gw6,omitempty"` + MACAddress *string `json:"hwaddr,omitempty" url:"hwaddr,omitempty"` + MTU *int `json:"mtu,omitempty" url:"mtu,omitempty"` + Name string `json:"name" url:"name"` + RateLimit *float64 `json:"rate,omitempty" url:"rate,omitempty"` + Tag *int `json:"tag,omitempty" url:"tag,omitempty"` + Trunks *[]int `json:"trunks,omitempty" url:"trunks,omitempty"` + Type *string `json:"type,omitempty" url:"type,omitempty"` } // CustomNetworkInterfaceArray is an array of CustomNetworkInterface. @@ -122,14 +121,14 @@ type CustomNetworkInterfaceArray []CustomNetworkInterface // CustomRootFS contains the values for the "rootfs" property. type CustomRootFS struct { - ACL *types2.CustomBool `json:"acl,omitempty" url:"acl,omitempty,int"` - Size *types.DiskSize `json:"size,omitempty" url:"size,omitempty"` - MountOptions *[]string `json:"mountoptions,omitempty" url:"mountoptions,omitempty"` - Quota *types2.CustomBool `json:"quota,omitempty" url:"quota,omitempty,int"` - ReadOnly *types2.CustomBool `json:"ro,omitempty" url:"ro,omitempty,int"` - Replicate *types2.CustomBool `json:"replicate,omitempty" url:"replicate,omitempty,int"` - Shared *types2.CustomBool `json:"shared,omitempty" url:"shared,omitempty,int"` - Volume string `json:"volume" url:"volume"` + ACL *types.CustomBool `json:"acl,omitempty" url:"acl,omitempty,int"` + Size *types.DiskSize `json:"size,omitempty" url:"size,omitempty"` + MountOptions *[]string `json:"mountoptions,omitempty" url:"mountoptions,omitempty"` + Quota *types.CustomBool `json:"quota,omitempty" url:"quota,omitempty,int"` + ReadOnly *types.CustomBool `json:"ro,omitempty" url:"ro,omitempty,int"` + Replicate *types.CustomBool `json:"replicate,omitempty" url:"replicate,omitempty,int"` + Shared *types.CustomBool `json:"shared,omitempty" url:"shared,omitempty,int"` + Volume string `json:"volume" url:"volume"` } // CustomSSHKeys contains the values for the "ssh-public-keys" property. @@ -149,7 +148,7 @@ type GetResponseBody struct { // GetResponseData contains the data from a user get response. type GetResponseData struct { - ConsoleEnabled *types2.CustomBool `json:"console,omitempty"` + ConsoleEnabled *types.CustomBool `json:"console,omitempty"` ConsoleMode *string `json:"cmode,omitempty"` CPUArchitecture *string `json:"arch,omitempty"` CPUCores *int `json:"cores,omitempty"` @@ -163,7 +162,7 @@ type GetResponseData struct { Features *CustomFeatures `json:"features,omitempty"` HookScript *string `json:"hookscript,omitempty"` Hostname *string `json:"hostname,omitempty"` - Lock *types2.CustomBool `json:"lock,omitempty"` + Lock *types.CustomBool `json:"lock,omitempty"` LXCConfiguration *[][2]string `json:"lxc,omitempty"` MountPoint0 CustomMountPoint `json:"mp0,omitempty"` MountPoint1 CustomMountPoint `json:"mp1,omitempty"` @@ -178,15 +177,15 @@ type GetResponseData struct { NetworkInterface6 *CustomNetworkInterface `json:"net6,omitempty"` NetworkInterface7 *CustomNetworkInterface `json:"net7,omitempty"` OSType *string `json:"ostype,omitempty"` - Protection *types2.CustomBool `json:"protection,omitempty"` + Protection *types.CustomBool `json:"protection,omitempty"` RootFS *CustomRootFS `json:"rootfs,omitempty"` - StartOnBoot *types2.CustomBool `json:"onboot,omitempty"` + StartOnBoot *types.CustomBool `json:"onboot,omitempty"` StartupBehavior *CustomStartupBehavior `json:"startup,omitempty"` Swap *int `json:"swap,omitempty"` Tags *string `json:"tags,omitempty"` - Template *types2.CustomBool `json:"template,omitempty"` + Template *types.CustomBool `json:"template,omitempty"` TTY *int `json:"tty,omitempty"` - Unprivileged *types2.CustomBool `json:"unprivileged,omitempty"` + Unprivileged *types.CustomBool `json:"unprivileged,omitempty"` } // GetStatusResponseBody contains the body from a container get status response. @@ -215,8 +214,8 @@ type RebootRequestBody struct { // ShutdownRequestBody contains the body for a container shutdown request. type ShutdownRequestBody struct { - ForceStop *types2.CustomBool `json:"forceStop,omitempty" url:"forceStop,omitempty,int"` - Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` + ForceStop *types.CustomBool `json:"forceStop,omitempty" url:"forceStop,omitempty,int"` + Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` } // UpdateRequestBody contains the data for an user update request. @@ -551,10 +550,10 @@ func (r *CustomFeatures) UnmarshalJSON(b []byte) error { if len(v) == 2 { switch v[0] { case "fuse": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.FUSE = &bv case "keyctl": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.KeyControl = &bv case "mount": if v[1] != "" { @@ -565,7 +564,7 @@ func (r *CustomFeatures) UnmarshalJSON(b []byte) error { r.MountTypes = &a } case "nesting": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Nesting = &bv } } @@ -593,10 +592,10 @@ func (r *CustomMountPoint) UnmarshalJSON(b []byte) error { } else if len(v) == 2 { switch v[0] { case "acl": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.ACL = &bv case "backup": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Backup = &bv case "mountoptions": if v[1] != "" { @@ -609,16 +608,16 @@ func (r *CustomMountPoint) UnmarshalJSON(b []byte) error { case "mp": r.MountPoint = v[1] case "quota": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Quota = &bv case "ro": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.ReadOnly = &bv case "replicate": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Replicate = &bv case "shared": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Shared = &bv case "size": r.DiskSize = &v[1] @@ -651,7 +650,7 @@ func (r *CustomNetworkInterface) UnmarshalJSON(b []byte) error { case "bridge": r.Bridge = &v[1] case "firewall": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Firewall = &bv case "gw": r.IPv4Gateway = &v[1] @@ -732,7 +731,7 @@ func (r *CustomRootFS) UnmarshalJSON(b []byte) error { } else if len(v) == 2 { switch v[0] { case "acl": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.ACL = &bv case "mountoptions": if v[1] != "" { @@ -743,16 +742,16 @@ func (r *CustomRootFS) UnmarshalJSON(b []byte) error { r.MountOptions = &a } case "quota": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Quota = &bv case "ro": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.ReadOnly = &bv case "replicate": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Replicate = &bv case "shared": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Shared = &bv case "size": r.Size = new(types.DiskSize) diff --git a/proxmox/nodes/vms/vms_types.go b/proxmox/nodes/vms/vms_types.go index 16625621e..db6f93b94 100644 --- a/proxmox/nodes/vms/vms_types.go +++ b/proxmox/nodes/vms/vms_types.go @@ -15,15 +15,14 @@ import ( "strconv" "strings" - types2 "github.com/bpg/terraform-provider-proxmox/internal/types" - "github.com/bpg/terraform-provider-proxmox/proxmox/types" + "github.com/bpg/terraform-provider-proxmox/internal/types" ) // CustomAgent handles QEMU agent parameters. type CustomAgent struct { - Enabled *types2.CustomBool `json:"enabled,omitempty" url:"enabled,int"` - TrimClonedDisks *types2.CustomBool `json:"fstrim_cloned_disks" url:"fstrim_cloned_disks,int"` - Type *string `json:"type" url:"type"` + Enabled *types.CustomBool `json:"enabled,omitempty" url:"enabled,int"` + TrimClonedDisks *types.CustomBool `json:"fstrim_cloned_disks" url:"fstrim_cloned_disks,int"` + Type *string `json:"type" url:"type"` } // CustomAudioDevice handles QEMU audio parameters. @@ -74,33 +73,33 @@ type CustomCloudInitSSHKeys []string // CustomCPUEmulation handles QEMU CPU emulation parameters. type CustomCPUEmulation struct { - Flags *[]string `json:"flags,omitempty" url:"flags,omitempty,semicolon"` - Hidden *types2.CustomBool `json:"hidden,omitempty" url:"hidden,omitempty,int"` - HVVendorID *string `json:"hv-vendor-id,omitempty" url:"hv-vendor-id,omitempty"` - Type string `json:"cputype,omitempty" url:"cputype,omitempty"` + Flags *[]string `json:"flags,omitempty" url:"flags,omitempty,semicolon"` + Hidden *types.CustomBool `json:"hidden,omitempty" url:"hidden,omitempty,int"` + HVVendorID *string `json:"hv-vendor-id,omitempty" url:"hv-vendor-id,omitempty"` + Type string `json:"cputype,omitempty" url:"cputype,omitempty"` } // CustomEFIDisk handles QEMU EFI disk parameters. type CustomEFIDisk struct { - FileVolume string `json:"file" url:"file"` - Format *string `json:"format,omitempty" url:"format,omitempty"` - Type *string `json:"efitype,omitempty" url:"efitype,omitempty"` - PreEnrolledKeys *types2.CustomBool `json:"pre-enrolled-keys,omitempty" url:"pre-enrolled-keys,omitempty,int"` + FileVolume string `json:"file" url:"file"` + Format *string `json:"format,omitempty" url:"format,omitempty"` + Type *string `json:"efitype,omitempty" url:"efitype,omitempty"` + PreEnrolledKeys *types.CustomBool `json:"pre-enrolled-keys,omitempty" url:"pre-enrolled-keys,omitempty,int"` } // CustomNetworkDevice handles QEMU network device parameters. type CustomNetworkDevice struct { - Model string `json:"model" url:"model"` - Bridge *string `json:"bridge,omitempty" url:"bridge,omitempty"` - Enabled bool `json:"-" url:"-"` - Firewall *types2.CustomBool `json:"firewall,omitempty" url:"firewall,omitempty,int"` - LinkDown *types2.CustomBool `json:"link_down,omitempty" url:"link_down,omitempty,int"` - MACAddress *string `json:"macaddr,omitempty" url:"macaddr,omitempty"` - Queues *int `json:"queues,omitempty" url:"queues,omitempty"` - RateLimit *float64 `json:"rate,omitempty" url:"rate,omitempty"` - Tag *int `json:"tag,omitempty" url:"tag,omitempty"` - MTU *int `json:"mtu,omitempty" url:"mtu,omitempty"` - Trunks []int `json:"trunks,omitempty" url:"trunks,omitempty"` + Model string `json:"model" url:"model"` + Bridge *string `json:"bridge,omitempty" url:"bridge,omitempty"` + Enabled bool `json:"-" url:"-"` + Firewall *types.CustomBool `json:"firewall,omitempty" url:"firewall,omitempty,int"` + LinkDown *types.CustomBool `json:"link_down,omitempty" url:"link_down,omitempty,int"` + MACAddress *string `json:"macaddr,omitempty" url:"macaddr,omitempty"` + Queues *int `json:"queues,omitempty" url:"queues,omitempty"` + RateLimit *float64 `json:"rate,omitempty" url:"rate,omitempty"` + Tag *int `json:"tag,omitempty" url:"tag,omitempty"` + MTU *int `json:"mtu,omitempty" url:"mtu,omitempty"` + Trunks []int `json:"trunks,omitempty" url:"trunks,omitempty"` } // CustomNetworkDevices handles QEMU network device parameters. @@ -119,12 +118,12 @@ type CustomNUMADevices []CustomNUMADevice // CustomPCIDevice handles QEMU host PCI device mapping parameters. type CustomPCIDevice struct { - DeviceIDs []string `json:"host" url:"host,semicolon"` - MDev *string `json:"mdev,omitempty" url:"mdev,omitempty"` - PCIExpress *types2.CustomBool `json:"pcie,omitempty" url:"pcie,omitempty,int"` - ROMBAR *types2.CustomBool `json:"rombar,omitempty" url:"rombar,omitempty,int"` - ROMFile *string `json:"romfile,omitempty" url:"romfile,omitempty"` - XVGA *types2.CustomBool `json:"x-vga,omitempty" url:"x-vga,omitempty,int"` + DeviceIDs []string `json:"host" url:"host,semicolon"` + MDev *string `json:"mdev,omitempty" url:"mdev,omitempty"` + PCIExpress *types.CustomBool `json:"pcie,omitempty" url:"pcie,omitempty,int"` + ROMBAR *types.CustomBool `json:"rombar,omitempty" url:"rombar,omitempty,int"` + ROMFile *string `json:"romfile,omitempty" url:"romfile,omitempty"` + XVGA *types.CustomBool `json:"x-vga,omitempty" url:"x-vga,omitempty,int"` } // CustomPCIDevices handles QEMU host PCI device mapping parameters. @@ -141,20 +140,20 @@ type CustomSharedMemory struct { // CustomSMBIOS handles QEMU SMBIOS parameters. type CustomSMBIOS struct { - Base64 *types2.CustomBool `json:"base64,omitempty" url:"base64,omitempty"` - Family *string `json:"family,omitempty" url:"family,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty" url:"manufacturer,omitempty"` - Product *string `json:"product,omitempty" url:"product,omitempty"` - Serial *string `json:"serial,omitempty" url:"serial,omitempty"` - SKU *string `json:"sku,omitempty" url:"sku,omitempty"` - UUID *string `json:"uuid,omitempty" url:"uuid,omitempty"` - Version *string `json:"version,omitempty" url:"version,omitempty"` + Base64 *types.CustomBool `json:"base64,omitempty" url:"base64,omitempty"` + Family *string `json:"family,omitempty" url:"family,omitempty"` + Manufacturer *string `json:"manufacturer,omitempty" url:"manufacturer,omitempty"` + Product *string `json:"product,omitempty" url:"product,omitempty"` + Serial *string `json:"serial,omitempty" url:"serial,omitempty"` + SKU *string `json:"sku,omitempty" url:"sku,omitempty"` + UUID *string `json:"uuid,omitempty" url:"uuid,omitempty"` + Version *string `json:"version,omitempty" url:"version,omitempty"` } // CustomSpiceEnhancements handles QEMU spice enhancement parameters. type CustomSpiceEnhancements struct { - FolderSharing *types2.CustomBool `json:"foldersharing,omitempty" url:"foldersharing,omitempty"` - VideoStreaming *string `json:"videostreaming,omitempty" url:"videostreaming,omitempty"` + FolderSharing *types.CustomBool `json:"foldersharing,omitempty" url:"foldersharing,omitempty"` + VideoStreaming *string `json:"videostreaming,omitempty" url:"videostreaming,omitempty"` } // CustomStartupOrder handles QEMU startup order parameters. @@ -166,20 +165,20 @@ type CustomStartupOrder struct { // CustomStorageDevice handles QEMU SATA device parameters. type CustomStorageDevice struct { - AIO *string `json:"aio,omitempty" url:"aio,omitempty"` - BackupEnabled *types2.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"` - BurstableReadSpeedMbps *int `json:"mbps_rd_max,omitempty" url:"mbps_rd_max,omitempty"` - BurstableWriteSpeedMbps *int `json:"mbps_wr_max,omitempty" url:"mbps_wr_max,omitempty"` - Discard *string `json:"discard,omitempty" url:"discard,omitempty"` - Enabled bool `json:"-" url:"-"` - FileVolume string `json:"file" url:"file"` - Format *string `json:"format,omitempty" url:"format,omitempty"` - IOThread *types2.CustomBool `json:"iothread,omitempty" url:"iothread,omitempty,int"` - SSD *types2.CustomBool `json:"ssd,omitempty" url:"ssd,omitempty,int"` - MaxReadSpeedMbps *int `json:"mbps_rd,omitempty" url:"mbps_rd,omitempty"` - MaxWriteSpeedMbps *int `json:"mbps_wr,omitempty" url:"mbps_wr,omitempty"` - Media *string `json:"media,omitempty" url:"media,omitempty"` - Size *types.DiskSize `json:"size,omitempty" url:"size,omitempty"` + AIO *string `json:"aio,omitempty" url:"aio,omitempty"` + BackupEnabled *types.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"` + BurstableReadSpeedMbps *int `json:"mbps_rd_max,omitempty" url:"mbps_rd_max,omitempty"` + BurstableWriteSpeedMbps *int `json:"mbps_wr_max,omitempty" url:"mbps_wr_max,omitempty"` + Discard *string `json:"discard,omitempty" url:"discard,omitempty"` + Enabled bool `json:"-" url:"-"` + FileVolume string `json:"file" url:"file"` + Format *string `json:"format,omitempty" url:"format,omitempty"` + IOThread *types.CustomBool `json:"iothread,omitempty" url:"iothread,omitempty,int"` + SSD *types.CustomBool `json:"ssd,omitempty" url:"ssd,omitempty,int"` + MaxReadSpeedMbps *int `json:"mbps_rd,omitempty" url:"mbps_rd,omitempty"` + MaxWriteSpeedMbps *int `json:"mbps_wr,omitempty" url:"mbps_wr,omitempty"` + Media *string `json:"media,omitempty" url:"media,omitempty"` + Size *types.DiskSize `json:"size,omitempty" url:"size,omitempty"` Interface *string ID *string FileID *string @@ -191,8 +190,8 @@ type CustomStorageDevices map[string]CustomStorageDevice // CustomUSBDevice handles QEMU USB device parameters. type CustomUSBDevice struct { - HostDevice string `json:"host" url:"host"` - USB3 *types2.CustomBool `json:"usb3,omitempty" url:"usb3,omitempty,int"` + HostDevice string `json:"host" url:"host"` + USB3 *types.CustomBool `json:"usb3,omitempty" url:"usb3,omitempty,int"` } // CustomUSBDevices handles QEMU USB device parameters. @@ -206,10 +205,10 @@ type CustomVGADevice struct { // CustomVirtualIODevice handles QEMU VirtIO device parameters. type CustomVirtualIODevice struct { - AIO *string `json:"aio,omitempty" url:"aio,omitempty"` - BackupEnabled *types2.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"` - Enabled bool `json:"-" url:"-"` - FileVolume string `json:"file" url:"file"` + AIO *string `json:"aio,omitempty" url:"aio,omitempty"` + BackupEnabled *types.CustomBool `json:"backup,omitempty" url:"backup,omitempty,int"` + Enabled bool `json:"-" url:"-"` + FileVolume string `json:"file" url:"file"` } // CustomVirtualIODevices handles QEMU VirtIO device parameters. @@ -223,89 +222,89 @@ type CustomWatchdogDevice struct { // CloneRequestBody contains the data for an virtual machine clone request. type CloneRequestBody struct { - BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` - Description *string `json:"description,omitempty" url:"description,omitempty"` - FullCopy *types2.CustomBool `json:"full,omitempty" url:"full,omitempty,int"` - Name *string `json:"name,omitempty" url:"name,omitempty"` - PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` - SnapshotName *string `json:"snapname,omitempty" url:"snapname,omitempty"` - TargetNodeName *string `json:"target,omitempty" url:"target,omitempty"` - TargetStorage *string `json:"storage,omitempty" url:"storage,omitempty"` - TargetStorageFormat *string `json:"format,omitempty" url:"format,omitempty"` - VMIDNew int `json:"newid" url:"newid"` + BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` + Description *string `json:"description,omitempty" url:"description,omitempty"` + FullCopy *types.CustomBool `json:"full,omitempty" url:"full,omitempty,int"` + Name *string `json:"name,omitempty" url:"name,omitempty"` + PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` + SnapshotName *string `json:"snapname,omitempty" url:"snapname,omitempty"` + TargetNodeName *string `json:"target,omitempty" url:"target,omitempty"` + TargetStorage *string `json:"storage,omitempty" url:"storage,omitempty"` + TargetStorageFormat *string `json:"format,omitempty" url:"format,omitempty"` + VMIDNew int `json:"newid" url:"newid"` } // CreateRequestBody contains the data for a virtual machine create request. type CreateRequestBody struct { - ACPI *types2.CustomBool `json:"acpi,omitempty" url:"acpi,omitempty,int"` - Agent *CustomAgent `json:"agent,omitempty" url:"agent,omitempty"` - AllowReboot *types2.CustomBool `json:"reboot,omitempty" url:"reboot,omitempty,int"` - AudioDevices CustomAudioDevices `json:"audio,omitempty" url:"audio,omitempty"` - Autostart *types2.CustomBool `json:"autostart,omitempty" url:"autostart,omitempty,int"` - BackupFile *string `json:"archive,omitempty" url:"archive,omitempty"` - BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` - BIOS *string `json:"bios,omitempty" url:"bios,omitempty"` - Boot *CustomBoot `json:"boot,omitempty" url:"boot,omitempty"` - CDROM *string `json:"cdrom,omitempty" url:"cdrom,omitempty"` - CloudInitConfig *CustomCloudInitConfig `json:"cloudinit,omitempty" url:"cloudinit,omitempty"` - CPUArchitecture *string `json:"arch,omitempty" url:"arch,omitempty"` - CPUCores *int `json:"cores,omitempty" url:"cores,omitempty"` - CPUEmulation *CustomCPUEmulation `json:"cpu,omitempty" url:"cpu,omitempty"` - CPULimit *int `json:"cpulimit,omitempty" url:"cpulimit,omitempty"` - CPUSockets *int `json:"sockets,omitempty" url:"sockets,omitempty"` - CPUUnits *int `json:"cpuunits,omitempty" url:"cpuunits,omitempty"` - DedicatedMemory *int `json:"memory,omitempty" url:"memory,omitempty"` - Delete []string `json:"delete,omitempty" url:"delete,omitempty,comma"` - DeletionProtection *types2.CustomBool `json:"protection,omitempty" url:"force,omitempty,int"` - Description *string `json:"description,omitempty" url:"description,omitempty"` - EFIDisk *CustomEFIDisk `json:"efidisk0,omitempty" url:"efidisk0,omitempty"` - FloatingMemory *int `json:"balloon,omitempty" url:"balloon,omitempty"` - FloatingMemoryShares *int `json:"shares,omitempty" url:"shares,omitempty"` - Freeze *types2.CustomBool `json:"freeze,omitempty" url:"freeze,omitempty,int"` - HookScript *string `json:"hookscript,omitempty" url:"hookscript,omitempty"` - Hotplug types2.CustomCommaSeparatedList `json:"hotplug,omitempty" url:"hotplug,omitempty,comma"` - Hugepages *string `json:"hugepages,omitempty" url:"hugepages,omitempty"` - IDEDevices CustomStorageDevices `json:"ide,omitempty" url:",omitempty"` - KeyboardLayout *string `json:"keyboard,omitempty" url:"keyboard,omitempty"` - KVMArguments *string `json:"args,omitempty" url:"args,omitempty,space"` - KVMEnabled *types2.CustomBool `json:"kvm,omitempty" url:"kvm,omitempty,int"` - LocalTime *types2.CustomBool `json:"localtime,omitempty" url:"localtime,omitempty,int"` - Lock *string `json:"lock,omitempty" url:"lock,omitempty"` - Machine *string `json:"machine,omitempty" url:"machine,omitempty"` - MigrateDowntime *float64 `json:"migrate_downtime,omitempty" url:"migrate_downtime,omitempty"` - MigrateSpeed *int `json:"migrate_speed,omitempty" url:"migrate_speed,omitempty"` - Name *string `json:"name,omitempty" url:"name,omitempty"` - NetworkDevices CustomNetworkDevices `json:"net,omitempty" url:"net,omitempty"` - NUMADevices CustomNUMADevices `json:"numa_devices,omitempty" url:"numa,omitempty"` - NUMAEnabled *types2.CustomBool `json:"numa,omitempty" url:"numa,omitempty,int"` - OSType *string `json:"ostype,omitempty" url:"ostype,omitempty"` - Overwrite *types2.CustomBool `json:"force,omitempty" url:"force,omitempty,int"` - PCIDevices CustomPCIDevices `json:"hostpci,omitempty" url:"hostpci,omitempty"` - PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` - Revert *string `json:"revert,omitempty" url:"revert,omitempty"` - SATADevices CustomStorageDevices `json:"sata,omitempty" url:"sata,omitempty"` - SCSIDevices CustomStorageDevices `json:"scsi,omitempty" url:"scsi,omitempty"` - SCSIHardware *string `json:"scsihw,omitempty" url:"scsihw,omitempty"` - SerialDevices CustomSerialDevices `json:"serial,omitempty" url:"serial,omitempty"` - SharedMemory *CustomSharedMemory `json:"ivshmem,omitempty" url:"ivshmem,omitempty"` - SkipLock *types2.CustomBool `json:"skiplock,omitempty" url:"skiplock,omitempty,int"` - SMBIOS *CustomSMBIOS `json:"smbios1,omitempty" url:"smbios1,omitempty"` - SpiceEnhancements *CustomSpiceEnhancements `json:"spice_enhancements,omitempty" url:"spice_enhancements,omitempty"` - StartDate *string `json:"startdate,omitempty" url:"startdate,omitempty"` - StartOnBoot *types2.CustomBool `json:"onboot,omitempty" url:"onboot,omitempty,int"` - StartupOrder *CustomStartupOrder `json:"startup,omitempty" url:"startup,omitempty"` - TabletDeviceEnabled *types2.CustomBool `json:"tablet,omitempty" url:"tablet,omitempty,int"` - Tags *string `json:"tags,omitempty" url:"tags,omitempty"` - Template *types2.CustomBool `json:"template,omitempty" url:"template,omitempty,int"` - TimeDriftFixEnabled *types2.CustomBool `json:"tdf,omitempty" url:"tdf,omitempty,int"` - USBDevices CustomUSBDevices `json:"usb,omitempty" url:"usb,omitempty"` - VGADevice *CustomVGADevice `json:"vga,omitempty" url:"vga,omitempty"` - VirtualCPUCount *int `json:"vcpus,omitempty" url:"vcpus,omitempty"` - VirtualIODevices CustomStorageDevices `json:"virtio,omitempty" url:"virtio,omitempty"` - VMGenerationID *string `json:"vmgenid,omitempty" url:"vmgenid,omitempty"` - VMID *int `json:"vmid,omitempty" url:"vmid,omitempty"` - VMStateDatastoreID *string `json:"vmstatestorage,omitempty" url:"vmstatestorage,omitempty"` - WatchdogDevice *CustomWatchdogDevice `json:"watchdog,omitempty" url:"watchdog,omitempty"` + ACPI *types.CustomBool `json:"acpi,omitempty" url:"acpi,omitempty,int"` + Agent *CustomAgent `json:"agent,omitempty" url:"agent,omitempty"` + AllowReboot *types.CustomBool `json:"reboot,omitempty" url:"reboot,omitempty,int"` + AudioDevices CustomAudioDevices `json:"audio,omitempty" url:"audio,omitempty"` + Autostart *types.CustomBool `json:"autostart,omitempty" url:"autostart,omitempty,int"` + BackupFile *string `json:"archive,omitempty" url:"archive,omitempty"` + BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` + BIOS *string `json:"bios,omitempty" url:"bios,omitempty"` + Boot *CustomBoot `json:"boot,omitempty" url:"boot,omitempty"` + CDROM *string `json:"cdrom,omitempty" url:"cdrom,omitempty"` + CloudInitConfig *CustomCloudInitConfig `json:"cloudinit,omitempty" url:"cloudinit,omitempty"` + CPUArchitecture *string `json:"arch,omitempty" url:"arch,omitempty"` + CPUCores *int `json:"cores,omitempty" url:"cores,omitempty"` + CPUEmulation *CustomCPUEmulation `json:"cpu,omitempty" url:"cpu,omitempty"` + CPULimit *int `json:"cpulimit,omitempty" url:"cpulimit,omitempty"` + CPUSockets *int `json:"sockets,omitempty" url:"sockets,omitempty"` + CPUUnits *int `json:"cpuunits,omitempty" url:"cpuunits,omitempty"` + DedicatedMemory *int `json:"memory,omitempty" url:"memory,omitempty"` + Delete []string `json:"delete,omitempty" url:"delete,omitempty,comma"` + DeletionProtection *types.CustomBool `json:"protection,omitempty" url:"force,omitempty,int"` + Description *string `json:"description,omitempty" url:"description,omitempty"` + EFIDisk *CustomEFIDisk `json:"efidisk0,omitempty" url:"efidisk0,omitempty"` + FloatingMemory *int `json:"balloon,omitempty" url:"balloon,omitempty"` + FloatingMemoryShares *int `json:"shares,omitempty" url:"shares,omitempty"` + Freeze *types.CustomBool `json:"freeze,omitempty" url:"freeze,omitempty,int"` + HookScript *string `json:"hookscript,omitempty" url:"hookscript,omitempty"` + Hotplug types.CustomCommaSeparatedList `json:"hotplug,omitempty" url:"hotplug,omitempty,comma"` + Hugepages *string `json:"hugepages,omitempty" url:"hugepages,omitempty"` + IDEDevices CustomStorageDevices `json:"ide,omitempty" url:",omitempty"` + KeyboardLayout *string `json:"keyboard,omitempty" url:"keyboard,omitempty"` + KVMArguments *string `json:"args,omitempty" url:"args,omitempty,space"` + KVMEnabled *types.CustomBool `json:"kvm,omitempty" url:"kvm,omitempty,int"` + LocalTime *types.CustomBool `json:"localtime,omitempty" url:"localtime,omitempty,int"` + Lock *string `json:"lock,omitempty" url:"lock,omitempty"` + Machine *string `json:"machine,omitempty" url:"machine,omitempty"` + MigrateDowntime *float64 `json:"migrate_downtime,omitempty" url:"migrate_downtime,omitempty"` + MigrateSpeed *int `json:"migrate_speed,omitempty" url:"migrate_speed,omitempty"` + Name *string `json:"name,omitempty" url:"name,omitempty"` + NetworkDevices CustomNetworkDevices `json:"net,omitempty" url:"net,omitempty"` + NUMADevices CustomNUMADevices `json:"numa_devices,omitempty" url:"numa,omitempty"` + NUMAEnabled *types.CustomBool `json:"numa,omitempty" url:"numa,omitempty,int"` + OSType *string `json:"ostype,omitempty" url:"ostype,omitempty"` + Overwrite *types.CustomBool `json:"force,omitempty" url:"force,omitempty,int"` + PCIDevices CustomPCIDevices `json:"hostpci,omitempty" url:"hostpci,omitempty"` + PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` + Revert *string `json:"revert,omitempty" url:"revert,omitempty"` + SATADevices CustomStorageDevices `json:"sata,omitempty" url:"sata,omitempty"` + SCSIDevices CustomStorageDevices `json:"scsi,omitempty" url:"scsi,omitempty"` + SCSIHardware *string `json:"scsihw,omitempty" url:"scsihw,omitempty"` + SerialDevices CustomSerialDevices `json:"serial,omitempty" url:"serial,omitempty"` + SharedMemory *CustomSharedMemory `json:"ivshmem,omitempty" url:"ivshmem,omitempty"` + SkipLock *types.CustomBool `json:"skiplock,omitempty" url:"skiplock,omitempty,int"` + SMBIOS *CustomSMBIOS `json:"smbios1,omitempty" url:"smbios1,omitempty"` + SpiceEnhancements *CustomSpiceEnhancements `json:"spice_enhancements,omitempty" url:"spice_enhancements,omitempty"` + StartDate *string `json:"startdate,omitempty" url:"startdate,omitempty"` + StartOnBoot *types.CustomBool `json:"onboot,omitempty" url:"onboot,omitempty,int"` + StartupOrder *CustomStartupOrder `json:"startup,omitempty" url:"startup,omitempty"` + TabletDeviceEnabled *types.CustomBool `json:"tablet,omitempty" url:"tablet,omitempty,int"` + Tags *string `json:"tags,omitempty" url:"tags,omitempty"` + Template *types.CustomBool `json:"template,omitempty" url:"template,omitempty,int"` + TimeDriftFixEnabled *types.CustomBool `json:"tdf,omitempty" url:"tdf,omitempty,int"` + USBDevices CustomUSBDevices `json:"usb,omitempty" url:"usb,omitempty"` + VGADevice *CustomVGADevice `json:"vga,omitempty" url:"vga,omitempty"` + VirtualCPUCount *int `json:"vcpus,omitempty" url:"vcpus,omitempty"` + VirtualIODevices CustomStorageDevices `json:"virtio,omitempty" url:"virtio,omitempty"` + VMGenerationID *string `json:"vmgenid,omitempty" url:"vmgenid,omitempty"` + VMID *int `json:"vmid,omitempty" url:"vmid,omitempty"` + VMStateDatastoreID *string `json:"vmstatestorage,omitempty" url:"vmstatestorage,omitempty"` + WatchdogDevice *CustomWatchdogDevice `json:"watchdog,omitempty" url:"watchdog,omitempty"` } // CreateResponseBody contains the body from a create response. @@ -357,137 +356,137 @@ type GetResponseBody struct { // GetResponseData contains the data from an virtual machine get response. type GetResponseData struct { - ACPI *types2.CustomBool `json:"acpi,omitempty"` - Agent *CustomAgent `json:"agent,omitempty"` - AllowReboot *types2.CustomBool `json:"reboot,omitempty"` - AudioDevice *CustomAudioDevice `json:"audio0,omitempty"` - Autostart *types2.CustomBool `json:"autostart,omitempty"` - BackupFile *string `json:"archive,omitempty"` - BandwidthLimit *int `json:"bwlimit,omitempty"` - BIOS *string `json:"bios,omitempty"` - BootDisk *string `json:"bootdisk,omitempty"` - BootOrder *string `json:"boot,omitempty"` - CDROM *string `json:"cdrom,omitempty"` - CloudInitDNSDomain *string `json:"searchdomain,omitempty"` - CloudInitDNSServer *string `json:"nameserver,omitempty"` - CloudInitFiles *CustomCloudInitFiles `json:"cicustom,omitempty"` - CloudInitPassword *string `json:"cipassword,omitempty"` - CloudInitSSHKeys *CustomCloudInitSSHKeys `json:"sshkeys,omitempty"` - CloudInitType *string `json:"citype,omitempty"` - CloudInitUsername *string `json:"ciuser,omitempty"` - CPUArchitecture *string `json:"arch,omitempty"` - CPUCores *int `json:"cores,omitempty"` - CPUEmulation *CustomCPUEmulation `json:"cpu,omitempty"` - CPULimit *int `json:"cpulimit,omitempty"` - CPUSockets *int `json:"sockets,omitempty"` - CPUUnits *int `json:"cpuunits,omitempty"` - DedicatedMemory *int `json:"memory,omitempty"` - DeletionProtection *types2.CustomBool `json:"protection,omitempty"` - Description *string `json:"description,omitempty"` - EFIDisk *CustomEFIDisk `json:"efidisk0,omitempty"` - FloatingMemory *int `json:"balloon,omitempty"` - FloatingMemoryShares *int `json:"shares,omitempty"` - Freeze *types2.CustomBool `json:"freeze,omitempty"` - HookScript *string `json:"hookscript,omitempty"` - Hotplug *types2.CustomCommaSeparatedList `json:"hotplug,omitempty"` - Hugepages *string `json:"hugepages,omitempty"` - IDEDevice0 *CustomStorageDevice `json:"ide0,omitempty"` - IDEDevice1 *CustomStorageDevice `json:"ide1,omitempty"` - IDEDevice2 *CustomStorageDevice `json:"ide2,omitempty"` - IDEDevice3 *CustomStorageDevice `json:"ide3,omitempty"` - IPConfig0 *CustomCloudInitIPConfig `json:"ipconfig0,omitempty"` - IPConfig1 *CustomCloudInitIPConfig `json:"ipconfig1,omitempty"` - IPConfig2 *CustomCloudInitIPConfig `json:"ipconfig2,omitempty"` - IPConfig3 *CustomCloudInitIPConfig `json:"ipconfig3,omitempty"` - IPConfig4 *CustomCloudInitIPConfig `json:"ipconfig4,omitempty"` - IPConfig5 *CustomCloudInitIPConfig `json:"ipconfig5,omitempty"` - IPConfig6 *CustomCloudInitIPConfig `json:"ipconfig6,omitempty"` - IPConfig7 *CustomCloudInitIPConfig `json:"ipconfig7,omitempty"` - KeyboardLayout *string `json:"keyboard,omitempty"` - KVMArguments *string `json:"args,omitempty"` - KVMEnabled *types2.CustomBool `json:"kvm,omitempty"` - LocalTime *types2.CustomBool `json:"localtime,omitempty"` - Lock *string `json:"lock,omitempty"` - Machine *string `json:"machine,omitempty"` - MigrateDowntime *float64 `json:"migrate_downtime,omitempty"` - MigrateSpeed *int `json:"migrate_speed,omitempty"` - Name *string `json:"name,omitempty"` - NetworkDevice0 *CustomNetworkDevice `json:"net0,omitempty"` - NetworkDevice1 *CustomNetworkDevice `json:"net1,omitempty"` - NetworkDevice2 *CustomNetworkDevice `json:"net2,omitempty"` - NetworkDevice3 *CustomNetworkDevice `json:"net3,omitempty"` - NetworkDevice4 *CustomNetworkDevice `json:"net4,omitempty"` - NetworkDevice5 *CustomNetworkDevice `json:"net5,omitempty"` - NetworkDevice6 *CustomNetworkDevice `json:"net6,omitempty"` - NetworkDevice7 *CustomNetworkDevice `json:"net7,omitempty"` - NUMADevices *CustomNUMADevices `json:"numa_devices,omitempty"` - NUMAEnabled *types2.CustomBool `json:"numa,omitempty"` - OSType *string `json:"ostype,omitempty"` - Overwrite *types2.CustomBool `json:"force,omitempty"` - PCIDevice0 *CustomPCIDevice `json:"hostpci0,omitempty"` - PCIDevice1 *CustomPCIDevice `json:"hostpci1,omitempty"` - PCIDevice2 *CustomPCIDevice `json:"hostpci2,omitempty"` - PCIDevice3 *CustomPCIDevice `json:"hostpci3,omitempty"` - PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` - Revert *string `json:"revert,omitempty"` - SATADevice0 *CustomStorageDevice `json:"sata0,omitempty"` - SATADevice1 *CustomStorageDevice `json:"sata1,omitempty"` - SATADevice2 *CustomStorageDevice `json:"sata2,omitempty"` - SATADevice3 *CustomStorageDevice `json:"sata3,omitempty"` - SATADevice4 *CustomStorageDevice `json:"sata4,omitempty"` - SATADevice5 *CustomStorageDevice `json:"sata5,omitempty"` - SCSIDevice0 *CustomStorageDevice `json:"scsi0,omitempty"` - SCSIDevice1 *CustomStorageDevice `json:"scsi1,omitempty"` - SCSIDevice2 *CustomStorageDevice `json:"scsi2,omitempty"` - SCSIDevice3 *CustomStorageDevice `json:"scsi3,omitempty"` - SCSIDevice4 *CustomStorageDevice `json:"scsi4,omitempty"` - SCSIDevice5 *CustomStorageDevice `json:"scsi5,omitempty"` - SCSIDevice6 *CustomStorageDevice `json:"scsi6,omitempty"` - SCSIDevice7 *CustomStorageDevice `json:"scsi7,omitempty"` - SCSIDevice8 *CustomStorageDevice `json:"scsi8,omitempty"` - SCSIDevice9 *CustomStorageDevice `json:"scsi9,omitempty"` - SCSIDevice10 *CustomStorageDevice `json:"scsi10,omitempty"` - SCSIDevice11 *CustomStorageDevice `json:"scsi11,omitempty"` - SCSIDevice12 *CustomStorageDevice `json:"scsi12,omitempty"` - SCSIDevice13 *CustomStorageDevice `json:"scsi13,omitempty"` - SCSIHardware *string `json:"scsihw,omitempty"` - SerialDevice0 *string `json:"serial0,omitempty"` - SerialDevice1 *string `json:"serial1,omitempty"` - SerialDevice2 *string `json:"serial2,omitempty"` - SerialDevice3 *string `json:"serial3,omitempty"` - SharedMemory *CustomSharedMemory `json:"ivshmem,omitempty"` - SkipLock *types2.CustomBool `json:"skiplock,omitempty"` - SMBIOS *CustomSMBIOS `json:"smbios1,omitempty"` - SpiceEnhancements *CustomSpiceEnhancements `json:"spice_enhancements,omitempty"` - StartDate *string `json:"startdate,omitempty"` - StartOnBoot *types2.CustomBool `json:"onboot,omitempty"` - StartupOrder *CustomStartupOrder `json:"startup,omitempty"` - TabletDeviceEnabled *types2.CustomBool `json:"tablet,omitempty"` - Tags *string `json:"tags,omitempty"` - Template *types2.CustomBool `json:"template,omitempty"` - TimeDriftFixEnabled *types2.CustomBool `json:"tdf,omitempty"` - USBDevices *CustomUSBDevices `json:"usb,omitempty"` - VGADevice *CustomVGADevice `json:"vga,omitempty"` - VirtualCPUCount *int `json:"vcpus,omitempty"` - VirtualIODevice0 *CustomStorageDevice `json:"virtio0,omitempty"` - VirtualIODevice1 *CustomStorageDevice `json:"virtio1,omitempty"` - VirtualIODevice2 *CustomStorageDevice `json:"virtio2,omitempty"` - VirtualIODevice3 *CustomStorageDevice `json:"virtio3,omitempty"` - VirtualIODevice4 *CustomStorageDevice `json:"virtio4,omitempty"` - VirtualIODevice5 *CustomStorageDevice `json:"virtio5,omitempty"` - VirtualIODevice6 *CustomStorageDevice `json:"virtio6,omitempty"` - VirtualIODevice7 *CustomStorageDevice `json:"virtio7,omitempty"` - VirtualIODevice8 *CustomStorageDevice `json:"virtio8,omitempty"` - VirtualIODevice9 *CustomStorageDevice `json:"virtio9,omitempty"` - VirtualIODevice10 *CustomStorageDevice `json:"virtio10,omitempty"` - VirtualIODevice11 *CustomStorageDevice `json:"virtio11,omitempty"` - VirtualIODevice12 *CustomStorageDevice `json:"virtio12,omitempty"` - VirtualIODevice13 *CustomStorageDevice `json:"virtio13,omitempty"` - VirtualIODevice14 *CustomStorageDevice `json:"virtio14,omitempty"` - VirtualIODevice15 *CustomStorageDevice `json:"virtio15,omitempty"` - VMGenerationID *string `json:"vmgenid,omitempty"` - VMStateDatastoreID *string `json:"vmstatestorage,omitempty"` - WatchdogDevice *CustomWatchdogDevice `json:"watchdog,omitempty"` + ACPI *types.CustomBool `json:"acpi,omitempty"` + Agent *CustomAgent `json:"agent,omitempty"` + AllowReboot *types.CustomBool `json:"reboot,omitempty"` + AudioDevice *CustomAudioDevice `json:"audio0,omitempty"` + Autostart *types.CustomBool `json:"autostart,omitempty"` + BackupFile *string `json:"archive,omitempty"` + BandwidthLimit *int `json:"bwlimit,omitempty"` + BIOS *string `json:"bios,omitempty"` + BootDisk *string `json:"bootdisk,omitempty"` + BootOrder *string `json:"boot,omitempty"` + CDROM *string `json:"cdrom,omitempty"` + CloudInitDNSDomain *string `json:"searchdomain,omitempty"` + CloudInitDNSServer *string `json:"nameserver,omitempty"` + CloudInitFiles *CustomCloudInitFiles `json:"cicustom,omitempty"` + CloudInitPassword *string `json:"cipassword,omitempty"` + CloudInitSSHKeys *CustomCloudInitSSHKeys `json:"sshkeys,omitempty"` + CloudInitType *string `json:"citype,omitempty"` + CloudInitUsername *string `json:"ciuser,omitempty"` + CPUArchitecture *string `json:"arch,omitempty"` + CPUCores *int `json:"cores,omitempty"` + CPUEmulation *CustomCPUEmulation `json:"cpu,omitempty"` + CPULimit *int `json:"cpulimit,omitempty"` + CPUSockets *int `json:"sockets,omitempty"` + CPUUnits *int `json:"cpuunits,omitempty"` + DedicatedMemory *int `json:"memory,omitempty"` + DeletionProtection *types.CustomBool `json:"protection,omitempty"` + Description *string `json:"description,omitempty"` + EFIDisk *CustomEFIDisk `json:"efidisk0,omitempty"` + FloatingMemory *int `json:"balloon,omitempty"` + FloatingMemoryShares *int `json:"shares,omitempty"` + Freeze *types.CustomBool `json:"freeze,omitempty"` + HookScript *string `json:"hookscript,omitempty"` + Hotplug *types.CustomCommaSeparatedList `json:"hotplug,omitempty"` + Hugepages *string `json:"hugepages,omitempty"` + IDEDevice0 *CustomStorageDevice `json:"ide0,omitempty"` + IDEDevice1 *CustomStorageDevice `json:"ide1,omitempty"` + IDEDevice2 *CustomStorageDevice `json:"ide2,omitempty"` + IDEDevice3 *CustomStorageDevice `json:"ide3,omitempty"` + IPConfig0 *CustomCloudInitIPConfig `json:"ipconfig0,omitempty"` + IPConfig1 *CustomCloudInitIPConfig `json:"ipconfig1,omitempty"` + IPConfig2 *CustomCloudInitIPConfig `json:"ipconfig2,omitempty"` + IPConfig3 *CustomCloudInitIPConfig `json:"ipconfig3,omitempty"` + IPConfig4 *CustomCloudInitIPConfig `json:"ipconfig4,omitempty"` + IPConfig5 *CustomCloudInitIPConfig `json:"ipconfig5,omitempty"` + IPConfig6 *CustomCloudInitIPConfig `json:"ipconfig6,omitempty"` + IPConfig7 *CustomCloudInitIPConfig `json:"ipconfig7,omitempty"` + KeyboardLayout *string `json:"keyboard,omitempty"` + KVMArguments *string `json:"args,omitempty"` + KVMEnabled *types.CustomBool `json:"kvm,omitempty"` + LocalTime *types.CustomBool `json:"localtime,omitempty"` + Lock *string `json:"lock,omitempty"` + Machine *string `json:"machine,omitempty"` + MigrateDowntime *float64 `json:"migrate_downtime,omitempty"` + MigrateSpeed *int `json:"migrate_speed,omitempty"` + Name *string `json:"name,omitempty"` + NetworkDevice0 *CustomNetworkDevice `json:"net0,omitempty"` + NetworkDevice1 *CustomNetworkDevice `json:"net1,omitempty"` + NetworkDevice2 *CustomNetworkDevice `json:"net2,omitempty"` + NetworkDevice3 *CustomNetworkDevice `json:"net3,omitempty"` + NetworkDevice4 *CustomNetworkDevice `json:"net4,omitempty"` + NetworkDevice5 *CustomNetworkDevice `json:"net5,omitempty"` + NetworkDevice6 *CustomNetworkDevice `json:"net6,omitempty"` + NetworkDevice7 *CustomNetworkDevice `json:"net7,omitempty"` + NUMADevices *CustomNUMADevices `json:"numa_devices,omitempty"` + NUMAEnabled *types.CustomBool `json:"numa,omitempty"` + OSType *string `json:"ostype,omitempty"` + Overwrite *types.CustomBool `json:"force,omitempty"` + PCIDevice0 *CustomPCIDevice `json:"hostpci0,omitempty"` + PCIDevice1 *CustomPCIDevice `json:"hostpci1,omitempty"` + PCIDevice2 *CustomPCIDevice `json:"hostpci2,omitempty"` + PCIDevice3 *CustomPCIDevice `json:"hostpci3,omitempty"` + PoolID *string `json:"pool,omitempty" url:"pool,omitempty"` + Revert *string `json:"revert,omitempty"` + SATADevice0 *CustomStorageDevice `json:"sata0,omitempty"` + SATADevice1 *CustomStorageDevice `json:"sata1,omitempty"` + SATADevice2 *CustomStorageDevice `json:"sata2,omitempty"` + SATADevice3 *CustomStorageDevice `json:"sata3,omitempty"` + SATADevice4 *CustomStorageDevice `json:"sata4,omitempty"` + SATADevice5 *CustomStorageDevice `json:"sata5,omitempty"` + SCSIDevice0 *CustomStorageDevice `json:"scsi0,omitempty"` + SCSIDevice1 *CustomStorageDevice `json:"scsi1,omitempty"` + SCSIDevice2 *CustomStorageDevice `json:"scsi2,omitempty"` + SCSIDevice3 *CustomStorageDevice `json:"scsi3,omitempty"` + SCSIDevice4 *CustomStorageDevice `json:"scsi4,omitempty"` + SCSIDevice5 *CustomStorageDevice `json:"scsi5,omitempty"` + SCSIDevice6 *CustomStorageDevice `json:"scsi6,omitempty"` + SCSIDevice7 *CustomStorageDevice `json:"scsi7,omitempty"` + SCSIDevice8 *CustomStorageDevice `json:"scsi8,omitempty"` + SCSIDevice9 *CustomStorageDevice `json:"scsi9,omitempty"` + SCSIDevice10 *CustomStorageDevice `json:"scsi10,omitempty"` + SCSIDevice11 *CustomStorageDevice `json:"scsi11,omitempty"` + SCSIDevice12 *CustomStorageDevice `json:"scsi12,omitempty"` + SCSIDevice13 *CustomStorageDevice `json:"scsi13,omitempty"` + SCSIHardware *string `json:"scsihw,omitempty"` + SerialDevice0 *string `json:"serial0,omitempty"` + SerialDevice1 *string `json:"serial1,omitempty"` + SerialDevice2 *string `json:"serial2,omitempty"` + SerialDevice3 *string `json:"serial3,omitempty"` + SharedMemory *CustomSharedMemory `json:"ivshmem,omitempty"` + SkipLock *types.CustomBool `json:"skiplock,omitempty"` + SMBIOS *CustomSMBIOS `json:"smbios1,omitempty"` + SpiceEnhancements *CustomSpiceEnhancements `json:"spice_enhancements,omitempty"` + StartDate *string `json:"startdate,omitempty"` + StartOnBoot *types.CustomBool `json:"onboot,omitempty"` + StartupOrder *CustomStartupOrder `json:"startup,omitempty"` + TabletDeviceEnabled *types.CustomBool `json:"tablet,omitempty"` + Tags *string `json:"tags,omitempty"` + Template *types.CustomBool `json:"template,omitempty"` + TimeDriftFixEnabled *types.CustomBool `json:"tdf,omitempty"` + USBDevices *CustomUSBDevices `json:"usb,omitempty"` + VGADevice *CustomVGADevice `json:"vga,omitempty"` + VirtualCPUCount *int `json:"vcpus,omitempty"` + VirtualIODevice0 *CustomStorageDevice `json:"virtio0,omitempty"` + VirtualIODevice1 *CustomStorageDevice `json:"virtio1,omitempty"` + VirtualIODevice2 *CustomStorageDevice `json:"virtio2,omitempty"` + VirtualIODevice3 *CustomStorageDevice `json:"virtio3,omitempty"` + VirtualIODevice4 *CustomStorageDevice `json:"virtio4,omitempty"` + VirtualIODevice5 *CustomStorageDevice `json:"virtio5,omitempty"` + VirtualIODevice6 *CustomStorageDevice `json:"virtio6,omitempty"` + VirtualIODevice7 *CustomStorageDevice `json:"virtio7,omitempty"` + VirtualIODevice8 *CustomStorageDevice `json:"virtio8,omitempty"` + VirtualIODevice9 *CustomStorageDevice `json:"virtio9,omitempty"` + VirtualIODevice10 *CustomStorageDevice `json:"virtio10,omitempty"` + VirtualIODevice11 *CustomStorageDevice `json:"virtio11,omitempty"` + VirtualIODevice12 *CustomStorageDevice `json:"virtio12,omitempty"` + VirtualIODevice13 *CustomStorageDevice `json:"virtio13,omitempty"` + VirtualIODevice14 *CustomStorageDevice `json:"virtio14,omitempty"` + VirtualIODevice15 *CustomStorageDevice `json:"virtio15,omitempty"` + VMGenerationID *string `json:"vmgenid,omitempty"` + VMStateDatastoreID *string `json:"vmstatestorage,omitempty"` + WatchdogDevice *CustomWatchdogDevice `json:"watchdog,omitempty"` } // GetStatusResponseBody contains the body from a VM get status response. @@ -497,19 +496,19 @@ type GetStatusResponseBody struct { // GetStatusResponseData contains the data from a VM get status response. type GetStatusResponseData struct { - AgentEnabled *types2.CustomBool `json:"agent,omitempty"` - CPUCount *float64 `json:"cpus,omitempty"` - Lock *string `json:"lock,omitempty"` - MemoryAllocation *int `json:"maxmem,omitempty"` - Name *string `json:"name,omitempty"` - PID *int `json:"pid,omitempty"` - QMPStatus *string `json:"qmpstatus,omitempty"` - RootDiskSize *int `json:"maxdisk,omitempty"` - SpiceSupport *types2.CustomBool `json:"spice,omitempty"` - Status string `json:"status,omitempty"` - Tags *string `json:"tags,omitempty"` - Uptime *int `json:"uptime,omitempty"` - VMID *int `json:"vmid,omitempty"` + AgentEnabled *types.CustomBool `json:"agent,omitempty"` + CPUCount *float64 `json:"cpus,omitempty"` + Lock *string `json:"lock,omitempty"` + MemoryAllocation *int `json:"maxmem,omitempty"` + Name *string `json:"name,omitempty"` + PID *int `json:"pid,omitempty"` + QMPStatus *string `json:"qmpstatus,omitempty"` + RootDiskSize *int `json:"maxdisk,omitempty"` + SpiceSupport *types.CustomBool `json:"spice,omitempty"` + Status string `json:"status,omitempty"` + Tags *string `json:"tags,omitempty"` + Uptime *int `json:"uptime,omitempty"` + VMID *int `json:"vmid,omitempty"` } // ListResponseBody contains the body from a virtual machine list response. @@ -526,10 +525,10 @@ type ListResponseData struct { // MigrateRequestBody contains the body for a VM migration request. type MigrateRequestBody struct { - OnlineMigration *types2.CustomBool `json:"online,omitempty" url:"online,omitempty"` - TargetNode string `json:"target" url:"target"` - TargetStorage *string `json:"targetstorage,omitempty" url:"targetstorage,omitempty"` - WithLocalDisks *types2.CustomBool `json:"with-local-disks,omitempty" url:"with-local-disks,omitempty,int"` + OnlineMigration *types.CustomBool `json:"online,omitempty" url:"online,omitempty"` + TargetNode string `json:"target" url:"target"` + TargetStorage *string `json:"targetstorage,omitempty" url:"targetstorage,omitempty"` + WithLocalDisks *types.CustomBool `json:"with-local-disks,omitempty" url:"with-local-disks,omitempty,int"` } // MigrateResponseBody contains the body from a VM migrate response. @@ -539,12 +538,12 @@ type MigrateResponseBody struct { // MoveDiskRequestBody contains the body for a VM move disk request. type MoveDiskRequestBody struct { - BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` - DeleteOriginalDisk *types2.CustomBool `json:"delete,omitempty" url:"delete,omitempty,int"` - Digest *string `json:"digest,omitempty" url:"digest,omitempty"` - Disk string `json:"disk" url:"disk"` - TargetStorage string `json:"storage" url:"storage"` - TargetStorageFormat *string `json:"format,omitempty" url:"format,omitempty"` + BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` + DeleteOriginalDisk *types.CustomBool `json:"delete,omitempty" url:"delete,omitempty,int"` + Digest *string `json:"digest,omitempty" url:"digest,omitempty"` + Disk string `json:"disk" url:"disk"` + TargetStorage string `json:"storage" url:"storage"` + TargetStorageFormat *string `json:"format,omitempty" url:"format,omitempty"` } // MoveDiskResponseBody contains the body from a VM move disk response. @@ -564,18 +563,18 @@ type RebootResponseBody struct { // ResizeDiskRequestBody contains the body for a VM resize disk request. type ResizeDiskRequestBody struct { - Digest *string `json:"digest,omitempty" url:"digest,omitempty"` - Disk string `json:"disk" url:"disk"` - Size types.DiskSize `json:"size" url:"size"` - SkipLock *types2.CustomBool `json:"skiplock,omitempty" url:"skiplock,omitempty,int"` + Digest *string `json:"digest,omitempty" url:"digest,omitempty"` + Disk string `json:"disk" url:"disk"` + Size types.DiskSize `json:"size" url:"size"` + SkipLock *types.CustomBool `json:"skiplock,omitempty" url:"skiplock,omitempty,int"` } // ShutdownRequestBody contains the body for a VM shutdown request. type ShutdownRequestBody struct { - ForceStop *types2.CustomBool `json:"forceStop,omitempty" url:"forceStop,omitempty,int"` - KeepActive *types2.CustomBool `json:"keepActive,omitempty" url:"keepActive,omitempty,int"` - SkipLock *types2.CustomBool `json:"skipLock,omitempty" url:"skipLock,omitempty,int"` - Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` + ForceStop *types.CustomBool `json:"forceStop,omitempty" url:"forceStop,omitempty,int"` + KeepActive *types.CustomBool `json:"keepActive,omitempty" url:"keepActive,omitempty,int"` + SkipLock *types.CustomBool `json:"skipLock,omitempty" url:"skipLock,omitempty,int"` + Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` } // ShutdownResponseBody contains the body from a VM shutdown response. @@ -1277,15 +1276,15 @@ func (r *CustomAgent) UnmarshalJSON(b []byte) error { v := strings.Split(strings.TrimSpace(p), "=") if len(v) == 1 { - enabled := types2.CustomBool(v[0] == "1") + enabled := types.CustomBool(v[0] == "1") r.Enabled = &enabled } else if len(v) == 2 { switch v[0] { case "enabled": - enabled := types2.CustomBool(v[1] == "1") + enabled := types.CustomBool(v[1] == "1") r.Enabled = &enabled case "fstrim_cloned_disks": - fstrim := types2.CustomBool(v[1] == "1") + fstrim := types.CustomBool(v[1] == "1") r.TrimClonedDisks = &fstrim case "type": r.Type = &v[1] @@ -1460,7 +1459,7 @@ func (r *CustomCPUEmulation) UnmarshalJSON(b []byte) error { r.Flags = &f } case "hidden": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Hidden = &bv case "hv-vendor-id": r.HVVendorID = &v[1] @@ -1498,7 +1497,7 @@ func (r *CustomEFIDisk) UnmarshalJSON(b []byte) error { t := strings.ToLower(v[1]) r.Type = &t case "pre-enrolled-keys": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.PreEnrolledKeys = &bv } } @@ -1526,10 +1525,10 @@ func (r *CustomNetworkDevice) UnmarshalJSON(b []byte) error { case "bridge": r.Bridge = &v[1] case "firewall": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.Firewall = &bv case "link_down": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.LinkDown = &bv case "macaddr": r.MACAddress = &v[1] @@ -1610,15 +1609,15 @@ func (r *CustomPCIDevice) UnmarshalJSON(b []byte) error { case "mdev": r.MDev = &v[1] case "pcie": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.PCIExpress = &bv case "rombar": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.ROMBAR = &bv case "romfile": r.ROMFile = &v[1] case "x-vga": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.XVGA = &bv } } @@ -1674,7 +1673,7 @@ func (r *CustomSMBIOS) UnmarshalJSON(b []byte) error { if len(v) == 2 { switch v[0] { case "base64": - base64 := types2.CustomBool(v[1] == "1") + base64 := types.CustomBool(v[1] == "1") r.Base64 = &base64 case "family": r.Family = &v[1] @@ -1724,7 +1723,7 @@ func (r *CustomStorageDevice) UnmarshalJSON(b []byte) error { case "aio": r.AIO = &v[1] case "backup": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.BackupEnabled = &bv case "file": r.FileVolume = v[1] @@ -1767,10 +1766,10 @@ func (r *CustomStorageDevice) UnmarshalJSON(b []byte) error { case "format": r.Format = &v[1] case "iothread": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.IOThread = &bv case "ssd": - bv := types2.CustomBool(v[1] == "1") + bv := types.CustomBool(v[1] == "1") r.SSD = &bv case "discard": r.Discard = &v[1] diff --git a/proxmox/nodes/vms/vms_types_test.go b/proxmox/nodes/vms/vms_types_test.go index beda96f43..a5a04c4e1 100644 --- a/proxmox/nodes/vms/vms_types_test.go +++ b/proxmox/nodes/vms/vms_types_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bpg/terraform-provider-proxmox/proxmox/types" + "github.com/bpg/terraform-provider-proxmox/internal/types" ) func TestCustomStorageDevice_UnmarshalJSON(t *testing.T) { diff --git a/proxmoxtf/resource/utils.go b/proxmoxtf/resource/utils.go index 5f3c4e6cd..a384b3634 100644 --- a/proxmoxtf/resource/utils.go +++ b/proxmoxtf/resource/utils.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/bpg/terraform-provider-proxmox/internal/types" "github.com/bpg/terraform-provider-proxmox/proxmox/nodes/vms" - "github.com/bpg/terraform-provider-proxmox/proxmox/types" ) func getBIOSValidator() schema.SchemaValidateDiagFunc { diff --git a/proxmoxtf/resource/vm.go b/proxmoxtf/resource/vm.go index 6e471d9e8..f65ba1690 100644 --- a/proxmoxtf/resource/vm.go +++ b/proxmoxtf/resource/vm.go @@ -20,10 +20,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - types2 "github.com/bpg/terraform-provider-proxmox/internal/types" + "github.com/bpg/terraform-provider-proxmox/internal/types" "github.com/bpg/terraform-provider-proxmox/proxmox/cluster" "github.com/bpg/terraform-provider-proxmox/proxmox/nodes/vms" - "github.com/bpg/terraform-provider-proxmox/proxmox/types" "github.com/bpg/terraform-provider-proxmox/proxmoxtf" ) @@ -1396,7 +1395,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d } } - fullCopy := types2.CustomBool(cloneFull) + fullCopy := types.CustomBool(cloneFull) cloneBody := &vms.CloneRequestBody{ FullCopy: &fullCopy, @@ -1477,7 +1476,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d } // Migrate to target node - withLocalDisks := types2.CustomBool(true) + withLocalDisks := types.CustomBool(true) migrateBody := &vms.MigrateRequestBody{ TargetNode: nodeName, WithLocalDisks: &withLocalDisks, @@ -1511,7 +1510,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d } // Now that the virtual machine has been cloned, we need to perform some modifications. - acpi := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMACPI).(bool)) + acpi := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMACPI).(bool)) agent := d.Get(mkResourceVirtualEnvironmentVMAgent).([]interface{}) audioDevices := vmGetAudioDeviceList(d) @@ -1527,9 +1526,9 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d networkDevice := d.Get(mkResourceVirtualEnvironmentVMNetworkDevice).([]interface{}) operatingSystem := d.Get(mkResourceVirtualEnvironmentVMOperatingSystem).([]interface{}) serialDevice := d.Get(mkResourceVirtualEnvironmentVMSerialDevice).([]interface{}) - onBoot := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) - tabletDevice := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) - template := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) + onBoot := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) + tabletDevice := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) + template := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) vga := d.Get(mkResourceVirtualEnvironmentVMVGA).([]interface{}) updateBody := &vms.UpdateRequestBody{ @@ -1548,10 +1547,10 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d if len(agent) > 0 { agentBlock := agent[0].(map[string]interface{}) - agentEnabled := types2.CustomBool( + agentEnabled := types.CustomBool( agentBlock[mkResourceVirtualEnvironmentVMAgentEnabled].(bool), ) - agentTrim := types2.CustomBool(agentBlock[mkResourceVirtualEnvironmentVMAgentTrim].(bool)) + agentTrim := types.CustomBool(agentBlock[mkResourceVirtualEnvironmentVMAgentTrim].(bool)) agentType := agentBlock[mkResourceVirtualEnvironmentVMAgentType].(string) updateBody.Agent = &vms.CustomAgent{ @@ -1618,7 +1617,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d cpuCores := cpuBlock[mkResourceVirtualEnvironmentVMCPUCores].(int) cpuFlags := cpuBlock[mkResourceVirtualEnvironmentVMCPUFlags].([]interface{}) cpuHotplugged := cpuBlock[mkResourceVirtualEnvironmentVMCPUHotplugged].(int) - cpuNUMA := types2.CustomBool(cpuBlock[mkResourceVirtualEnvironmentVMCPUNUMA].(bool)) + cpuNUMA := types.CustomBool(cpuBlock[mkResourceVirtualEnvironmentVMCPUNUMA].(bool)) cpuSockets := cpuBlock[mkResourceVirtualEnvironmentVMCPUSockets].(int) cpuType := cpuBlock[mkResourceVirtualEnvironmentVMCPUType].(string) cpuUnits := cpuBlock[mkResourceVirtualEnvironmentVMCPUUnits].(int) @@ -1841,7 +1840,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d ) } - deleteOriginalDisk := types2.CustomBool(true) + deleteOriginalDisk := types.CustomBool(true) diskMoveBody := &vms.MoveDiskRequestBody{ DeleteOriginalDisk: &deleteOriginalDisk, @@ -1912,7 +1911,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d ) } - deleteOriginalDisk := types2.CustomBool(true) + deleteOriginalDisk := types.CustomBool(true) diskMoveBody := &vms.MoveDiskRequestBody{ DeleteOriginalDisk: &deleteOriginalDisk, @@ -1953,7 +1952,7 @@ func vmCreateCustom(ctx context.Context, d *schema.ResourceData, m interface{}) resource := VM() - acpi := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMACPI).(bool)) + acpi := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMACPI).(bool)) agentBlock, err := getSchemaBlock( resource, @@ -1966,10 +1965,10 @@ func vmCreateCustom(ctx context.Context, d *schema.ResourceData, m interface{}) return diag.FromErr(err) } - agentEnabled := types2.CustomBool( + agentEnabled := types.CustomBool( agentBlock[mkResourceVirtualEnvironmentVMAgentEnabled].(bool), ) - agentTrim := types2.CustomBool(agentBlock[mkResourceVirtualEnvironmentVMAgentTrim].(bool)) + agentTrim := types.CustomBool(agentBlock[mkResourceVirtualEnvironmentVMAgentTrim].(bool)) agentType := agentBlock[mkResourceVirtualEnvironmentVMAgentType].(string) kvmArguments := d.Get(mkResourceVirtualEnvironmentVMKVMArguments).(string) @@ -2015,7 +2014,7 @@ func vmCreateCustom(ctx context.Context, d *schema.ResourceData, m interface{}) cpuFlags := cpuBlock[mkResourceVirtualEnvironmentVMCPUFlags].([]interface{}) cpuHotplugged := cpuBlock[mkResourceVirtualEnvironmentVMCPUHotplugged].(int) cpuSockets := cpuBlock[mkResourceVirtualEnvironmentVMCPUSockets].(int) - cpuNUMA := types2.CustomBool(cpuBlock[mkResourceVirtualEnvironmentVMCPUNUMA].(bool)) + cpuNUMA := types.CustomBool(cpuBlock[mkResourceVirtualEnvironmentVMCPUNUMA].(bool)) cpuType := cpuBlock[mkResourceVirtualEnvironmentVMCPUType].(string) cpuUnits := cpuBlock[mkResourceVirtualEnvironmentVMCPUUnits].(int) @@ -2034,7 +2033,7 @@ func vmCreateCustom(ctx context.Context, d *schema.ResourceData, m interface{}) datastoreID, _ := block[mkResourceVirtualEnvironmentVMEFIDiskDatastoreID].(string) fileFormat, _ := block[mkResourceVirtualEnvironmentVMEFIDiskFileFormat].(string) efiType, _ := block[mkResourceVirtualEnvironmentVMEFIDiskType].(string) - preEnrolledKeys := types2.CustomBool(block[mkResourceVirtualEnvironmentVMEFIDiskPreEnrolledKeys].(bool)) + preEnrolledKeys := types.CustomBool(block[mkResourceVirtualEnvironmentVMEFIDiskPreEnrolledKeys].(bool)) if fileFormat == "" { fileFormat = dvResourceVirtualEnvironmentVMEFIDiskFileFormat @@ -2107,9 +2106,9 @@ func vmCreateCustom(ctx context.Context, d *schema.ResourceData, m interface{}) serialDevices := vmGetSerialDeviceList(d) - onBoot := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) - tabletDevice := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) - template := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) + onBoot := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) + tabletDevice := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) + template := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) vgaDevice, err := vmGetVGADeviceObject(d) if err != nil { @@ -2334,8 +2333,8 @@ func vmCreateCustomDisks(ctx context.Context, d *schema.ResourceData, m interfac size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int) speed := block[mkResourceVirtualEnvironmentVMDiskSpeed].([]interface{}) diskInterface, _ := block[mkResourceVirtualEnvironmentVMDiskInterface].(string) - ioThread := types2.CustomBool(block[mkResourceVirtualEnvironmentVMDiskIOThread].(bool)) - ssd := types2.CustomBool(block[mkResourceVirtualEnvironmentVMDiskSSD].(bool)) + ioThread := types.CustomBool(block[mkResourceVirtualEnvironmentVMDiskIOThread].(bool)) + ssd := types.CustomBool(block[mkResourceVirtualEnvironmentVMDiskSSD].(bool)) discard, _ := block[mkResourceVirtualEnvironmentVMDiskDiscard].(string) if fileFormat == "" { @@ -2696,8 +2695,8 @@ func vmGetDiskDeviceObjects( fileID, _ := block[mkResourceVirtualEnvironmentVMDiskFileID].(string) size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int) diskInterface, _ := block[mkResourceVirtualEnvironmentVMDiskInterface].(string) - ioThread := types2.CustomBool(block[mkResourceVirtualEnvironmentVMDiskIOThread].(bool)) - ssd := types2.CustomBool(block[mkResourceVirtualEnvironmentVMDiskSSD].(bool)) + ioThread := types.CustomBool(block[mkResourceVirtualEnvironmentVMDiskIOThread].(bool)) + ssd := types.CustomBool(block[mkResourceVirtualEnvironmentVMDiskSSD].(bool)) discard := block[mkResourceVirtualEnvironmentVMDiskDiscard].(string) speedBlock, err := getSchemaBlock( @@ -2796,7 +2795,7 @@ func vmGetEfiDisk(d *schema.ResourceData, disk []interface{}) *vms.CustomEFIDisk datastoreID, _ := block[mkResourceVirtualEnvironmentVMEFIDiskDatastoreID].(string) fileFormat, _ := block[mkResourceVirtualEnvironmentVMEFIDiskFileFormat].(string) efiType, _ := block[mkResourceVirtualEnvironmentVMEFIDiskType].(string) - preEnrolledKeys := types2.CustomBool(block[mkResourceVirtualEnvironmentVMEFIDiskPreEnrolledKeys].(bool)) + preEnrolledKeys := types.CustomBool(block[mkResourceVirtualEnvironmentVMEFIDiskPreEnrolledKeys].(bool)) // special case for efi disk, the size is ignored, see docs for more info efiDiskConfig.FileVolume = fmt.Sprintf("%s:1", datastoreID) @@ -2850,12 +2849,12 @@ func vmGetHostPCIDeviceObjects(d *schema.ResourceData) vms.CustomPCIDevices { ids, _ := block[mkResourceVirtualEnvironmentVMHostPCIDeviceID].(string) mdev, _ := block[mkResourceVirtualEnvironmentVMHostPCIDeviceMDev].(string) - pcie := types2.CustomBool(block[mkResourceVirtualEnvironmentVMHostPCIDevicePCIE].(bool)) - rombar := types2.CustomBool( + pcie := types.CustomBool(block[mkResourceVirtualEnvironmentVMHostPCIDevicePCIE].(bool)) + rombar := types.CustomBool( block[mkResourceVirtualEnvironmentVMHostPCIDeviceROMBAR].(bool), ) romfile, _ := block[mkResourceVirtualEnvironmentVMHostPCIDeviceROMFile].(string) - xvga := types2.CustomBool(block[mkResourceVirtualEnvironmentVMHostPCIDeviceXVGA].(bool)) + xvga := types.CustomBool(block[mkResourceVirtualEnvironmentVMHostPCIDeviceXVGA].(bool)) device := vms.CustomPCIDevice{ DeviceIDs: strings.Split(ids, ";"), @@ -2890,7 +2889,7 @@ func vmGetNetworkDeviceObjects(d *schema.ResourceData) vms.CustomNetworkDevices bridge := block[mkResourceVirtualEnvironmentVMNetworkDeviceBridge].(string) enabled := block[mkResourceVirtualEnvironmentVMNetworkDeviceEnabled].(bool) - firewall := types2.CustomBool(block[mkResourceVirtualEnvironmentVMNetworkDeviceFirewall].(bool)) + firewall := types.CustomBool(block[mkResourceVirtualEnvironmentVMNetworkDeviceFirewall].(bool)) macAddress := block[mkResourceVirtualEnvironmentVMNetworkDeviceMACAddress].(string) model := block[mkResourceVirtualEnvironmentVMNetworkDeviceModel].(string) rateLimit := block[mkResourceVirtualEnvironmentVMNetworkDeviceRateLimit].(float64) @@ -3006,7 +3005,7 @@ func vmGetVGADeviceObject(d *schema.ResourceData) (*vms.CustomVGADevice, error) return nil, err } - vgaEnabled := types2.CustomBool(vgaBlock[mkResourceVirtualEnvironmentVMAgentEnabled].(bool)) + vgaEnabled := types.CustomBool(vgaBlock[mkResourceVirtualEnvironmentVMAgentEnabled].(bool)) vgaMemory := vgaBlock[mkResourceVirtualEnvironmentVMVGAMemory].(int) vgaType := vgaBlock[mkResourceVirtualEnvironmentVMVGAType].(string) @@ -4346,7 +4345,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D // Prepare the new primitive configuration values. if d.HasChange(mkResourceVirtualEnvironmentVMACPI) { - acpi := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMACPI).(bool)) + acpi := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMACPI).(bool)) updateBody.ACPI = &acpi rebootRequired = true } @@ -4369,7 +4368,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D } if d.HasChange(mkResourceVirtualEnvironmentVMOnBoot) { - startOnBoot := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) + startOnBoot := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) updateBody.StartOnBoot = &startOnBoot } @@ -4399,12 +4398,12 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D } if d.HasChange(mkResourceVirtualEnvironmentVMTabletDevice) { - tabletDevice := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) + tabletDevice := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) updateBody.TabletDeviceEnabled = &tabletDevice rebootRequired = true } - template := types2.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) + template := types.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) if d.HasChange(mkResourceVirtualEnvironmentVMTemplate) { updateBody.Template = &template @@ -4424,10 +4423,10 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D return diag.FromErr(err) } - agentEnabled := types2.CustomBool( + agentEnabled := types.CustomBool( agentBlock[mkResourceVirtualEnvironmentVMAgentEnabled].(bool), ) - agentTrim := types2.CustomBool(agentBlock[mkResourceVirtualEnvironmentVMAgentTrim].(bool)) + agentTrim := types.CustomBool(agentBlock[mkResourceVirtualEnvironmentVMAgentTrim].(bool)) agentType := agentBlock[mkResourceVirtualEnvironmentVMAgentType].(string) updateBody.Agent = &vms.CustomAgent{ @@ -4521,7 +4520,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D cpuCores := cpuBlock[mkResourceVirtualEnvironmentVMCPUCores].(int) cpuFlags := cpuBlock[mkResourceVirtualEnvironmentVMCPUFlags].([]interface{}) cpuHotplugged := cpuBlock[mkResourceVirtualEnvironmentVMCPUHotplugged].(int) - cpuNUMA := types2.CustomBool(cpuBlock[mkResourceVirtualEnvironmentVMCPUNUMA].(bool)) + cpuNUMA := types.CustomBool(cpuBlock[mkResourceVirtualEnvironmentVMCPUNUMA].(bool)) cpuSockets := cpuBlock[mkResourceVirtualEnvironmentVMCPUSockets].(int) cpuType := cpuBlock[mkResourceVirtualEnvironmentVMCPUType].(string) cpuUnits := cpuBlock[mkResourceVirtualEnvironmentVMCPUUnits].(int) @@ -4784,7 +4783,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D return diag.FromErr(e) } } else { - forceStop := types2.CustomBool(true) + forceStop := types.CustomBool(true) shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) e = vmAPI.ShutdownVM(ctx, &vms.ShutdownRequestBody{ @@ -4897,7 +4896,7 @@ func vmUpdateDiskLocationAndSize( } if *oldDisk.ID != *diskNewEntries[prefix][oldKey].ID { - deleteOriginalDisk := types2.CustomBool(true) + deleteOriginalDisk := types.CustomBool(true) diskMoveBodies = append( diskMoveBodies, @@ -4925,7 +4924,7 @@ func vmUpdateDiskLocationAndSize( } if shutdownForDisksRequired && !template { - forceStop := types2.CustomBool(true) + forceStop := types.CustomBool(true) shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = vmAPI.ShutdownVM( @@ -5009,7 +5008,7 @@ func vmDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D } if status.Status != "stopped" { - forceStop := types2.CustomBool(true) + forceStop := types.CustomBool(true) shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = vmAPI.ShutdownVM(