This commit is contained in:
asteam
2024-10-01 11:15:36 +03:00
commit a25a3c2e5c
81 changed files with 5143 additions and 0 deletions

View File

@@ -0,0 +1,404 @@
package requests
import "time"
// CreateVMRequest struct to create a virtual machine.
type CreateVMRequest struct {
// Parent template or VM uuid
// Required: false
ParentUUID string `url:"parent_uuid,omitempty" json:"parent_uuid,omitempty"`
// VM name
// Required: true
Name string `url:"name" json:"name" validate:"required"`
// VM description
// Required: false
Description string `url:"description,omitempty" json:"description,omitempty"`
// VM location on server
// Required: false
Location string `url:"location,omitempty" json:"location,omitempty"`
// Is HA mode enabled on VM
// Required: false
HaEnabled bool `url:"ha_enabled" json:"ha_enabled"`
// Current HA priority of VM
// Required: false
HaPriority int `url:"ha_priority" json:"ha_priority"`
// VM is infrastructure; specify ``True`` to mark VM as infrastructure
// Required: false
IsInfrastructure bool `url:"is_infrastructure" json:"is_infrastructure"`
// Is a monitoring via guest tools enabled on VM
// Required: false
MonitoringEnabled bool `url:"monitoring_enabled" json:"monitoring_enabled"`
// VM CPU units
// Required: false
CPUUnits int `url:"cpu_units,omitempty" json:"cpu_units,omitempty" validate:"omitempty,cpu_units"`
// VM CPU limit
// Required: false
CPULimit int `url:"cpu_limit" json:"cpu_limit"`
// Is CPU hotplug mode enabled
// Required: false
CPUHotplug bool `url:"cpu_hotplug,omitempty" json:"cpu_hotplug,omitempty"`
// CPU sockets
// Required: true
CPUSockets int `url:"cpu_sockets" json:"cpu_sockets" validate:"required"`
// CPU mask for a virtual machine
// Required: false
CPUMask string `url:"cpu_mask,omitempty" json:"cpu_mask,omitempty"`
// NUMA node mask for a virtual machine
// Required: false
NodeMask string `url:"node_mask,omitempty" json:"node_mask,omitempty"`
// Affinity rule type
// Required: false
Affinity string `url:"affinity,omitempty" json:"affinity,omitempty" validate:"omitempty,affinity"`
// Time delay used during the virtual machine automatic startup
// Required: false
AutoStartDelay int `url:"auto_start_delay,omitempty" json:"auto_start_delay,omitempty"`
// RAM size in Megabytes
// Required: true
RAMSize int `url:"ram_size,omitempty" json:"ram_size,omitempty" validate:"required"`
// Required guarantee memory in percent
// Required: false default -1
MemGuaranteeSize int `url:"mem_guarantee_size,omitempty" json:"mem_guarantee_size,omitempty" validate:"omitempty,mem_guarantee_size"`
// Is RAM hotplug enabled
// Required: false
RAMHotplugEnabled bool `url:"ram_hotplug_enabled,omitempty" json:"ram_hotplug_enabled,omitempty"`
// Video RAM size in Megabytes
// Required: true
VideoRAMSize int `url:"video_ram_size,omitempty" json:"video_ram_size,omitempty" validate:"required,video_ram"`
// VM guest OS type
// Required: false //validation
GuestOs string `url:"guest_os,omitempty" json:"guest_os,omitempty" validate:"omitempty,guest_os"`
// Is VM uses EFI instead of BIOS
// Required: false
EfiEnabled bool `url:"efi_enabled" json:"efi_enabled"`
// Enabled TMP
// Required: false
TpmEnabled bool `url:"tpm_enabled" json:"tpm_enabled"`
// is VM uses Secure Boot
// Required: false
SecureBoot bool `url:"secure_boot" json:"secure_boot"`
// VM disk I/O priority level
// Required: false ///0-7
IoPriority int `url:"io_priority,omitempty" json:"io_priority,omitempty" validate:"omitempty,io_priority"`
// Allowed bandwidth for VM disk I/O operations in bytes
// Required: false
IoLimit int `url:"io_limit,omitempty" json:"io_limit,omitempty"`
// IOPS limit for VM disk I/O operations
// Required: false
IopsLimit int `url:"iops_limit,omitempty" json:"iops_limit,omitempty"`
// If True don't move this VM by DRS auto balancing
// Required: false
DisableAutobalance bool `url:"disable_autobalance" json:"disable_autobalance"`
// If ``True``, the bandwidth guarantee (the global rate parameter) is also the limit for the virtual machine or container
// Required: false
Ratebound bool `url:"ratebound" json:"ratebound"`
// Boot devices order list
// Required: false
BootDeviceList []BootDevice `url:"-" json:"boot_device_list,omitempty"`
// VM CPU units
// Required: false
IPAddress any `url:"ip_address,omitempty" json:"ip_address,omitempty"`
// Guest Tools State
// Required: false
GuestToolsState string `url:"guest_tools_state,omitempty" json:"guest_tools_state,omitempty"`
// Should OS be installed after creation
// Required: false
InstallOs bool `url:"install_os,omitempty" json:"install_os,omitempty"`
// VNC server password
// Required: false
VncPassword string `url:"vnc_password,omitempty" json:"vnc_password,omitempty"`
// External storage name
// Required: false
ExternalStorageName string `url:"external_storage_name,omitempty" json:"external_storage_name,omitempty"`
// Linked vm uuid
// Required: false
LinkedVMUUID any `url:"linked_vm_uuid,omitempty" json:"linked_vm_uuid,omitempty"`
// Creation_date
// Required: false
CreationDate time.Time `url:"creation_date,omitempty" json:"creation_date,omitempty"`
// Imported
// Required: false
Imported bool `url:"imported,omitempty" json:"imported,omitempty"`
// Type of virtualization
// Required: false
VirtType string `url:"virt_type,omitempty" json:"virt_type,omitempty" validation:"omitempty,virt_type"`
// Used by dekstop
// Required: false
UsedByDesktop bool `url:"used_by_desktop,omitempty" json:"used_by_desktop,omitempty"`
// VNC server hostname
// Required: false
VncHostname string `url:"vnc_hostname,omitempty" json:"vnc_hostname,omitempty"`
// Ram total hotplug flag
// Required: false
RAMTotalHotplug any `url:"ram_total_hotplug,omitempty" json:"ram_total_hotplug,omitempty"`
// Linked VM ID
// Required: false
LinkedVMID any `url:"linked_vm_id,omitempty" json:"linked_vm_id,omitempty"`
// Ram balloon actual hotplug
// Required: false
RAMBalloonActualHotplug any `url:"ram_balloon_actual_hotplug,omitempty" json:"ram_balloon_actual_hotplug,omitempty"`
// Smbios uuid
// Required: false
SmbiosUUID string `url:"smbios_uuid,omitempty" json:"smbios_uuid,omitempty"`
// Parent template or VM uuid
// Required: false
UUID string `url:"uuid,omitempty" json:"uuid,omitempty"`
// Name of external resource
// Required: false
ExternalResourceName string `url:"external_resource_name,omitempty" json:"external_resource_name,omitempty"`
// HA Status
// Required: false
HaStatus string `url:"ha_status,omitempty" json:"ha_status,omitempty"`
// External uuid
// Required: false
ExternalUUID any `url:"external_uuid,omitempty" json:"external_uuid,omitempty"`
// Time of deleted
// Required: false
Deleted any `url:"deleted,omitempty" json:"deleted,omitempty"`
// VM's System flags
// Required: false
SystemFlags string `url:"system_flags,omitempty" json:"system_flags,omitempty"`
// VM is template; specify ``True`` to create master for linked clone VM
// Required: false
IsVzTemplate bool `url:"is_vz_template,omitempty" json:"is_vz_template,omitempty"`
// VNC port
// Required: false //validate
VncPort int `url:"vnc_port,omitempty" json:"vnc_port,omitempty"`
// status
// Required: false
Status string `url:"status,omitempty" json:"status,omitempty"`
// vm id
// Required: false
VMID int `url:"vm_id,omitempty" json:"vm_id,omitempty"`
// MaxRamSize
// Required: false
MaxRAMSize int `url:"max_ram_size,omitempty" json:"max_ram_size,omitempty"`
// Cores count
// Required: false
CoresCount int `url:"cores_count,omitempty" json:"cores_count,omitempty"`
// is template
// Required: false
IsTemplate bool `url:"is_template,omitempty" json:"is_template,omitempty"`
// max memory
// Required: false
Maxmemory int `url:"maxmemory,omitempty" json:"maxmemory,omitempty"`
// External resource id
// Required: false
ExternalResourceID any `url:"external_resource_id,omitempty" json:"external_resource_id,omitempty"`
// is linked clone
// Required: false
IsLinkedClone bool `url:"is_linked_clone,omitempty" json:"is_linked_clone,omitempty"`
// created time
// Required: false
Created time.Time `url:"created,omitempty" json:"created,omitempty"`
// list of mac addresses
// Required: false
MacAddresses any `url:"mac_addresses,omitempty" json:"mac_addresses,omitempty"`
// VM guest domain name
// Required: false
Domain string `url:"domain,omitempty" json:"domain,omitempty"`
// Count of linked clones
// Required: false
LinkedCloneCount int `url:"linked_clone_count,omitempty" json:"linked_clone_count,omitempty"`
// Count of snapshot
// Required: false
SnapshotCount int `url:"snapshot_count,omitempty" json:"snapshot_count,omitempty"`
// Count of device host
// Required: false
HostDeviceCount int `url:"host_device_count,omitempty" json:"host_device_count,omitempty"`
// All md5
// Required: false
AllMd5 bool `url:"all_md5,omitempty" json:"all_md5,omitempty"`
// Size of disks
// Required: false
DisksSize int `url:"disks_size,omitempty" json:"disks_size,omitempty"`
// Size of template
// Required: false
TemplateSize float64 `url:"template_size,omitempty" json:"template_size,omitempty"`
// Full hard drive size
// Required: false
FullHardDriveSize int `url:"full_hard_drive_size,omitempty" json:"full_hard_drive_size,omitempty"`
// Used hard drive size
// Required: false
UsedHardDriveSize float64 `url:"used_hard_drive_size,omitempty" json:"used_hard_drive_size,omitempty"`
// Cluster ID
// Required: false
ClusterID int `url:"cluster_id,omitempty" json:"cluster_id,omitempty"`
// External storage ID
// Required: false
ExternalStorageID int `url:"external_storage_id,omitempty" json:"external_storage_id,omitempty"`
// VM guest OS version
// Required: false
GuestOsVersion string `url:"guest_os_version,omitempty" json:"guest_os_version,omitempty" validate:"omitempty,guest_os_version"`
// Virtual machine startup options
// Required: false
AutoStart string `url:"auto_start,omitempty" json:"auto_start,omitempty" validate:"omitempty,auto_start"`
// Automatic shutdown mode
// Required: false
AutoStop string `url:"auto_stop,omitempty" json:"auto_stop,omitempty" validate:"omitempty,auto_stop"`
// VNC server mode
// Required: false
VncMode string `url:"vnc_mode,omitempty" json:"vnc_mode,omitempty" validate:"omitempty,vnc_mode"`
// VM CPU count
// Required: true
CPUCount int `url:"cpu_count,omitempty" json:"cpu_count,omitempty" validate:"required"`
// rates object
// Required: false
Rates struct{} `url:"rates,omitempty" json:"rates,omitempty"`
// List of VM names to create
// Required: false
Names []string `url:"names,omitempty" json:"names,omitempty"`
// List with devices dicts
// Required: false
Devices []Device `json:"devices,omitempty"`
// Host devices
// Required: false
HostDevices []int `url:"host_devices,omitempty" json:"host_devices,omitempty"`
// VM chipset
// Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
// VM clock offset
// Required: false
ClockOffset string `url:"clock_offset,omitempty" json:"clock_offset,omitempty" validate:"omitempty,clock_offset"`
}
// struct from request JSON no have documentation
type Device struct {
Name any `json:"name,omitempty"`
Modified time.Time `json:"modified,omitempty"`
Status string `json:"status,omitempty"`
EmulationType string `json:"emulation_type,omitempty"`
Enabled bool `json:"enabled,omitempty"`
DeviceType string `json:"device_type,omitempty"`
VolumeID any `json:"volume_id,omitempty"`
IsSharedDisk bool `json:"is_shared_disk,omitempty"`
Size int `json:"size,omitempty"`
VMID int `json:"vm_id,omitempty"`
DeviceIndex int `json:"device_index,omitempty"`
DeviceID int `json:"device_id,omitempty"`
ExternalUUID any `json:"external_uuid,omitempty"`
Deleted any `json:"deleted,omitempty"`
Connected bool `json:"connected,omitempty"`
Created time.Time `json:"created,omitempty"`
ImageID int `json:"image_id,omitempty"`
UUID any `json:"uuid,omitempty"`
ExternalResourceID any `json:"external_resource_id,omitempty"`
ImagePath string `json:"image_path,omitempty"`
EditableParams []string `json:"editable_params,omitempty"`
ImageUUID string `json:"image_uuid,omitempty"`
ImageSource string `json:"image_source,omitempty"`
ImageMd5 string `json:"image_md5,omitempty"`
DiskCaches []any `json:"disk_caches,omitempty"`
ImageName string `json:"image_name,omitempty"`
ImageHashSum string `json:"image_hashSum,omitempty"`
Editing bool `json:"editing,omitempty"`
DiskType string `json:"disk_type,omitempty"`
InterfaceType string `json:"interface_type,omitempty"`
StackIndex int `json:"stack_index,omitempty"`
ExternalStorageID int `json:"external_storage_id,omitempty"`
TierID any `json:"tier_id,omitempty"`
ImageType string `json:"image_type,omitempty"`
IPAddress []any `json:"ip_address,omitempty"`
GuestIPAddress any `json:"guest_ip_address,omitempty"`
DefaultGateway any `json:"default_gateway,omitempty"`
DNSServers []any `json:"dns_servers,omitempty"`
SearchDomains []any `json:"search_domains,omitempty"`
AutoApply bool `json:"auto_apply,omitempty"`
MacAddress any `json:"mac_address,omitempty"`
NetworkName string `json:"network_name,omitempty"`
VirtualNetworkID int `json:"virtual_network_id,omitempty"`
AdapterType string `json:"adapter_type,omitempty"`
PreventIPSpoof bool `json:"prevent_ip_spoof,omitempty"`
PreventMacSpoof bool `json:"prevent_mac_spoof,omitempty"`
PreventPromisc bool `json:"prevent_promisc,omitempty"`
Autoconnect string `json:"autoconnect,omitempty"`
}
type BootDevice struct {
Type string `url:"type" json:"type" validate:"required"`
InUse bool `url:"in_use,omitempty" json:"in_use,omitempty"`
Index int `url:"index,omitempty" json:"index,omitempty"`
}

View File

@@ -0,0 +1,25 @@
package requests
// GetVMRequest struct to get details of a virtual machine.
type GetVMRequest struct {
// Id of source VM
// Required: true
VmID int `url:"vmId" json:"vmId" validate:"required"`
// If true, include VM's current metrics in the metrics field.
// Required: false
WithMetrics bool `url:"with_metrics,omitempty" json:"with_metrics,omitempty"`
// Aggregation period for metrics. Used only if 'WithMetrics' is true.
// Possible values: "latest", "hour", "day", "week".
// Required: false
MetricsPeriod string `url:"metrics_period,omitempty" json:"metrics_period,omitempty" validate:"omitempty,metrics_period"`
// If true, include VM's hierarchy information.
// Required: false
WithParentTree bool `url:"with_parent_tree,omitempty" json:"with_parent_tree,omitempty"`
// If true, request actual info from the agent.
// Required: false
ForceRefresh bool `url:"force_refresh,omitempty" json:"force_refresh,omitempty"`
}

View File

@@ -0,0 +1,8 @@
package requests
// GetDisksRequest struct to get disks of a virtual machine.
type GetDisksRequest struct {
// Id of source VM
// Required: true
VmID int `url:"vmId" json:"vmId" validate:"required"`
}

View File

@@ -0,0 +1,263 @@
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"`
}

View File

@@ -0,0 +1,16 @@
package requests
// PowerOffRequest struct to disable VM
type PowerOffRequest struct {
// Id of source VM
// Required: true
VmID int `url:"vm" json:"vm" validate:"required"`
// If true, attempt a graceful operation of the virtual machine.
// Required: false
Graceful bool `url:"graceful" json:"graceful,omitempty"`
// If true, force the operation of the virtual machine.
// Required: false
Force bool `url:"force" json:"force,omitempty"`
}

View File

@@ -0,0 +1,8 @@
package requests
// PowerOnRequest struct to enable VM
type PowerOnRequest struct {
// Id of source VM
// Required: true
VmID int `url:"vm" json:"vm" validate:"required"`
}