You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
264 lines
9.6 KiB
264 lines
9.6 KiB
4 months ago
|
package requests
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
// ListVMRequest struct to get list of virtual machines
|
||
|
type ListVMRequest struct {
|
||
|
// Find by partial name match. Ignored if NameExact is provided.
|
||
|
// Required: false
|
||
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||
|
|
||
|
// Find by exact VM name.
|
||
|
// Required: false
|
||
|
NameExact string `url:"name_exact,omitempty" json:"name_exact,omitempty"`
|
||
|
|
||
|
// Find by UUID.
|
||
|
// Required: false
|
||
|
UUID string `url:"uuid,omitempty" json:"uuid,omitempty"`
|
||
|
|
||
|
// Find by virtualization type. Possible values: "VM", "CT".
|
||
|
// Required: false
|
||
|
VirtType string `url:"virt_type,omitempty" json:"virt_type,omitempty" validate:"omitempty,virt_type"`
|
||
|
|
||
|
// Find by Node identifier.
|
||
|
// Required: false
|
||
|
NodeID string `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||
|
|
||
|
// Filter by OS installation.
|
||
|
// Required: false
|
||
|
InstallOS interface{} `url:"install_os,omitempty" json:"install_os,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by name of node.
|
||
|
// Required: false
|
||
|
NodeName string `url:"node_name,omitempty" json:"node_name,omitempty"`
|
||
|
|
||
|
// Filter VMs by description.
|
||
|
// Required: false
|
||
|
Description string `url:"description,omitempty" json:"description,omitempty"`
|
||
|
|
||
|
// Filter VMs by IP address.
|
||
|
// Required: false
|
||
|
IPAddress string `url:"ip_address,omitempty" json:"ip_address,omitempty"`
|
||
|
|
||
|
// Filter VMs by MAC address.
|
||
|
// Required: false
|
||
|
MACAddress string `url:"mac_address,omitempty" json:"mac_address,omitempty"`
|
||
|
|
||
|
// Filter VMs by system hostname.
|
||
|
// Required: false
|
||
|
Hostname string `url:"hostname,omitempty" json:"hostname,omitempty"`
|
||
|
|
||
|
// Filter VMs by Windows domain.
|
||
|
// Required: false
|
||
|
Domain string `url:"domain,omitempty" json:"domain,omitempty"`
|
||
|
|
||
|
// Filter VMs by status. Possible values: "RUNNING", "PAUSED", "STOPPED", "SUSPENDED", "ERROR", "DELETED", "CREATING", "FAILED_TO_CREATE", "NODE_OFFLINE".
|
||
|
// Required: false
|
||
|
Status string `url:"status,omitempty" json:"status,omitempty" validate:"omitempty,vm_status"`
|
||
|
|
||
|
// Filter VMs by CPU count.
|
||
|
// Required: false
|
||
|
CPUCount int `url:"cpu_count,omitempty" json:"cpu_count,omitempty"`
|
||
|
|
||
|
// Filter VMs by CPU units (2-262144).
|
||
|
// Required: false
|
||
|
CPUUnits int `url:"cpu_units,omitempty" json:"cpu_units,omitempty" validate:"omitempty,cpu_units"`
|
||
|
|
||
|
// Filter VMs by CPU limit (0-100) * number of cores on server.
|
||
|
// Required: false
|
||
|
CPULimit int `url:"cpu_limit,omitempty" json:"cpu_limit,omitempty" validate:"omitempty,cpu_limit"`
|
||
|
|
||
|
// Set CPU hotplug mode for the specified VM.
|
||
|
// Required: false
|
||
|
CPUHotplug interface{} `url:"cpu_hotplug,omitempty" json:"cpu_hotplug,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Set CPU affinity mask for the specified VM.
|
||
|
// Required: false
|
||
|
CPUMask string `url:"cpu_mask,omitempty" json:"cpu_mask,omitempty"`
|
||
|
|
||
|
// Set NUMA node mask for the specified VM.
|
||
|
// Required: false
|
||
|
NodeMask string `url:"node_mask,omitempty" json:"node_mask,omitempty"`
|
||
|
|
||
|
// Filter VMs by CPU sockets.
|
||
|
// Required: false
|
||
|
CPUSockets int `url:"cpu_sockets,omitempty" json:"cpu_sockets,omitempty"`
|
||
|
|
||
|
// Filter VMs by total CPU cores.
|
||
|
// Required: false
|
||
|
CoresCount int `url:"cores_count,omitempty" json:"cores_count,omitempty"`
|
||
|
|
||
|
// Filter VMs by RAM size in Megabytes.
|
||
|
// Required: false
|
||
|
RAMSize int `url:"ram_size,omitempty" json:"ram_size,omitempty"`
|
||
|
|
||
|
// Filter VMs by maximum RAM size in Megabytes.
|
||
|
// Required: false
|
||
|
MaxRAMSize int `url:"max_ram_size,omitempty" json:"max_ram_size,omitempty"`
|
||
|
|
||
|
// Set memory hotplugging mode for the specified VM.
|
||
|
// Required: false
|
||
|
RAMHotplugEnabled bool `url:"ram_hotplug_enabled" json:"ram_hotplug_enabled"`
|
||
|
|
||
|
// Set memory guarantee size as a percentage of VM RAM.
|
||
|
// Required: false
|
||
|
MemGuaranteeSize int `url:"mem_guarantee_size,omitempty" json:"mem_guarantee_size,omitempty" validate:"omitempty,mem_guarantee_size"`
|
||
|
|
||
|
// Filter VMs by video RAM size in Megabytes.
|
||
|
// Required: false
|
||
|
VideoRAMSize int `url:"video_ram_size,omitempty" json:"video_ram_size,omitempty"`
|
||
|
|
||
|
// Filter VMs by Guest OS version.
|
||
|
// Required: false
|
||
|
GuestOSVersion string `url:"guest_os_version,omitempty" json:"guest_os_version,omitempty"`
|
||
|
|
||
|
// Filter VMs by location.
|
||
|
// Required: false
|
||
|
Location string `url:"location,omitempty" json:"location,omitempty"`
|
||
|
|
||
|
// Filter VMs by EFI usage.
|
||
|
// Required: false
|
||
|
EFIEnabled interface{} `url:"efi_enabled,omitempty" json:"efi_enabled,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by Cluster ID.
|
||
|
// Required: false
|
||
|
ClusterID int `url:"cluster_id,omitempty" json:"cluster_id,omitempty"`
|
||
|
|
||
|
// Filter VMs by folder ID.
|
||
|
// Required: false
|
||
|
FolderID int `url:"folder_id,omitempty" json:"folder_id,omitempty"`
|
||
|
|
||
|
// Filter VMs in all folder subtree.
|
||
|
// Required: false
|
||
|
// Default: true
|
||
|
FolderSubtree interface{} `url:"folder_subtree,omitempty" json:"folder_subtree,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by resource pool ID.
|
||
|
// Required: false
|
||
|
ResourcePoolID int `url:"resource_pool_id,omitempty" json:"resource_pool_id,omitempty"`
|
||
|
|
||
|
// Filter VMs by external resource ID.
|
||
|
// Required: false
|
||
|
ExternalResourceID int `url:"external_resource_id,omitempty" json:"external_resource_id,omitempty"`
|
||
|
|
||
|
// Filter VMs by external storage ID.
|
||
|
// Required: false
|
||
|
ExternalStorageID int `url:"external_storage_id,omitempty" json:"external_storage_id,omitempty"`
|
||
|
|
||
|
// Filter VMs by external storage name.
|
||
|
// Required: false
|
||
|
ExternalStorageName string `url:"external_storage_name,omitempty" json:"external_storage_name,omitempty"`
|
||
|
|
||
|
// Filter VMs by external resource name.
|
||
|
// Required: false
|
||
|
ExternalResourceName string `url:"external_resource_name,omitempty" json:"external_resource_name,omitempty"`
|
||
|
|
||
|
// Include external resource pools for filtering.
|
||
|
// Required: false
|
||
|
IncludeExternal bool `url:"include_external" json:"include_external"`
|
||
|
|
||
|
// Filter VMs by virtual network ID.
|
||
|
// Required: false
|
||
|
VirtualNetworkID int `url:"virtual_network_id,omitempty" json:"virtual_network_id,omitempty"`
|
||
|
|
||
|
// Filter VMs by HA status. Possible values: "ACTIVE", "INACTIVE", "ERROR", "UNKNOWN", "NO LICENSE".
|
||
|
// Required: false
|
||
|
HAStatus string `url:"ha_status,omitempty" json:"ha_status,omitempty" validate:"omitempty,ha_status"`
|
||
|
|
||
|
// Filter VMs by imported status from Virtuozzo.
|
||
|
// Required: false
|
||
|
Imported interface{} `url:"imported,omitempty" json:"imported,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by lock status.
|
||
|
// Required: false
|
||
|
Lock interface{} `url:"lock,omitempty" json:"lock,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by usage in VDI desktops.
|
||
|
// Required: false
|
||
|
UsedByDesktop interface{} `url:"used_by_desktop,omitempty" json:"used_by_desktop,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs that are out of any folder.
|
||
|
// Required: false
|
||
|
NoFolder interface{} `url:"no_folder,omitempty" json:"no_folder,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by parent UUID.
|
||
|
// Required: false
|
||
|
ParentUUID string `url:"parent_uuid,omitempty" json:"parent_uuid,omitempty"`
|
||
|
|
||
|
// Filter VMs by linked VM ID.
|
||
|
// Required: false
|
||
|
LinkedVMID int `url:"linked_vm_id,omitempty" json:"linked_vm_id,omitempty"`
|
||
|
|
||
|
// Filter VMs by template flag.
|
||
|
// Required: false
|
||
|
IsVZTemplate interface{} `url:"is_vz_template,omitempty" json:"is_vz_template,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by linked clone status.
|
||
|
// Required: false
|
||
|
IsLinkedClone interface{} `url:"is_linked_clone,omitempty" json:"is_linked_clone,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// Filter VMs by infrastructure flag.
|
||
|
// Required: false
|
||
|
IsInfrastructure interface{} `url:"is_infrastructure,omitempty" json:"is_infrastructure,omitempty" validate:"omitempty,is_bool"`
|
||
|
|
||
|
// List of VM IDs to exclude from listing.
|
||
|
// Required: false
|
||
|
ExcludeIDs []int `url:"exclude_ids,omitempty" json:"exclude_ids,omitempty"`
|
||
|
|
||
|
// Filter to search in all text fields.
|
||
|
// Required: false
|
||
|
FilterText string `url:"filter_text,omitempty" json:"filter_text,omitempty"`
|
||
|
|
||
|
// Filter VMs deleted before this date.
|
||
|
// Required: false
|
||
|
DeletedBefore time.Time `url:"deleted_before,omitempty" json:"deleted_before,omitempty"`
|
||
|
|
||
|
// Filter VMs deleted after this date.
|
||
|
// Required: false
|
||
|
DeletedAfter time.Time `url:"deleted_after,omitempty" json:"deleted_after,omitempty"`
|
||
|
|
||
|
// Filter VMs created before this date.
|
||
|
// Required: false
|
||
|
CreatedBefore time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
|
||
|
|
||
|
// Filter VMs created after this date.
|
||
|
// Required: false
|
||
|
CreatedAfter time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
|
||
|
|
||
|
// Filter VMs created in Virtuozzo before this date.
|
||
|
// Required: false
|
||
|
CreationDateBefore time.Time `url:"creation_date_before,omitempty" json:"creation_date_before,omitempty"`
|
||
|
|
||
|
// Filter VMs created in Virtuozzo after this date.
|
||
|
// Required: false
|
||
|
CreationDateAfter time.Time `url:"creation_date_after,omitempty" json:"creation_date_after,omitempty"`
|
||
|
|
||
|
// List columns which will be used by FilterText.
|
||
|
// Required: false
|
||
|
FilterColumns string `url:"filter_columns,omitempty" json:"filter_columns,omitempty"`
|
||
|
|
||
|
// Column sorting, format +|-(field).
|
||
|
// Required: false
|
||
|
Sort []string `url:"sort,omitempty" json:"sort,omitempty"`
|
||
|
|
||
|
// Add disk size info to output.
|
||
|
// Required: false
|
||
|
WithDisksSize bool `url:"with_disks_size,omitempty" json:"with_disks_size,omitempty"`
|
||
|
|
||
|
// Filter VMs by SMBIOS UUID.
|
||
|
// Required: false
|
||
|
SMBIOSUUID string `url:"smbios_uuid,omitempty" json:"smbios_uuid,omitempty"`
|
||
|
|
||
|
// Number of returning page.
|
||
|
// Required: false
|
||
|
Page int `url:"page,omitempty" json:"page,omitempty"`
|
||
|
|
||
|
// Number of items on page.
|
||
|
// Required: false
|
||
|
Limit int `url:"limit,omitempty" json:"limit,omitempty"`
|
||
|
|
||
|
// Filter VMs by visibility. Possible values: "visible", "deleted", "all".
|
||
|
// Required: false
|
||
|
Visibility string `url:"visibility,omitempty" json:"visibility,omitempty" validate:"omitempty,visibility"`
|
||
|
}
|