PUT /v2/virtual-machines
Adds a task to create a server with the specified parameters.
{
"create_vm": {
"cpus": $cpus,
"ram": $memory,
"compute_zone_id": "$zone_id",
"name": "$name",
"boot_type": "$boot_type",
"cdrom": "$iso_name",
"os": "$template_id",
"password": "$password",
"key_id": "$key_id",
"user_data": "$user_data",
}
}
$os variable installed$boot_type == ‘cdrom’$boot_type == ‘image’ - see also: listing operating systems$boot_type == ‘image’ and the selected image supports setting the password$boot_type == ‘image’ and the selected image supports setting the SSH key$boot_type == ‘image’ and the selected image supports Cloud-init{
"success":true,
"virtual_machine": {
"id": $vm_id
}
}
GET /v2/virtual-machines
Returns an array with the list of existing servers.
{
"success":true,
"virtual_machines": [
{
"id":"$vm_id",
"label":"$vm_label",
"cores": $vm_cpu,
"ram": $vm_memory,
"adm": $vm_managed,
"system": {
"id": "$system_id",
"name": "$system_name"
},
"cost_per_hour": $vm_cost,
"state": $vm_state,
"transfer_used": $vm_transfer,
"owner": {
"id": "$owner_id",
"name": "$owner_name"
},
"public_interface": {
"primary_ip_ipv4address": "$primary_ip",
"ipv4_addresses": [
{
"id": "$ip_address_id",
"ipv4_address": "$ip_address"
}, { ... }
]
},
"storage_volumes": [
{
"id": "$volume_id",
"size": $volume_size,
"system_disk": $volume_is_system
}, { ... }
],
"zone": {
"id": "$zone_id",
"name": "$zone_label"
},
"networks": [
{
"id": "$network_id",
"label": "$network_label",
"mac_address": "$network_mac",
"type": "$network_type"
}, { ... }
],
"groups": [
{
"id": "$group_id",
"name": "$group_name"
}, { ... }
]
},
{ ... }
]
}
true if the machine is managed, false if it is nottrue if the volume is a system volume, false otherwise$network_id will be of type int$network_id will be of type intGET /v2/virtual-machines/$VM_ID
Returns information about a single server with the given $VM_ID.
{
"success":true,
"virtual_machine": [
{
"id":"$vm_id",
"label":"$vm_label",
"cores": $vm_cpu,
"ram": $vm_memory,
"adm": $vm_managed,
"system": {
"id": "$system_id",
"name": "$system_name"
},
"cost_per_hour": $vm_cost,
"state": $vm_state,
"transfer_used": $vm_transfer,
"owner": {
"id": "$owner_id",
"name": "$owner_name"
},
"public_interface": {
"primary_ip_ipv4address": "$primary_ip",
"ipv4_addresses": [
{
"id": "$ip_address_id",
"ipv4_address": "$ip_address"
}, { ... }
]
},
"storage_volumes": [
{
"id": "$volume_id",
"size": $volume_size,
"system_disk": $volume_is_system
}, { ... }
],
"zone": {
"id": "$zone_id",
"name": "$zone_label"
},
"networks": [
{
"id": "$network_id",
"label": "$network_label",
"mac_address": "$network_mac",
"type": "$network_type"
}, { ... }
],
"groups": [
{
"id": "$group_id",
"name": "$group_name"
}, { ... }
]
},
{ ... }
]
}
true if the machine is managed, false if it is nottrue if the volume is a system volume, false if it is not$network_id will be of type int$network_id will be of type intPOST /v2/virtual-machines/$VM_ID/resize
Adds a task to resize the server with the given $VM_ID to the desired number of VCPU and RAM size. If the machine is turned on, it will be shut down by sending an ACPI request with a maximum waiting time of $wait_for minutes. If the system does not shut down after $wait_for minutes, the machine is turned off anyway.
{
"cores": $cores,
"ram": $memory,
"wait_for": $wait_for
}
{
"success":true
}
POST /v2/virtual-machines/$VM_ID/shutdown
Adds a task to shut down the server with the given $VM_ID. The shutdown request is passed through ACPI, which requires support from the server’s operating system but gives it the ability to orderly close services and the system. If the system does not shut down after $wait_for minutes, the machine is turned off anyway.
{
"wait_for": $wait_for
}
4{
"success":true
}
POST /v2/virtual-machines/$VM_ID/reboot
Adds a task to reboot the server with the given $VM_ID. Reboot occurs via ACPI, which requires support from the server’s operating system.
{
"success":true
}
POST /v2/virtual-machines/$VM_ID/restart
Adds a task to reboot the server with the given $VM_ID. Restart occurs through simulation of a hard hardware restart.
{
"success":true
}
POST /v2/virtual-machines/$VM_ID/console
Launches the virtual machine console with the given $VM_ID.
{
"console": {
"port": port,
"password": password,
"host": host
}
}
POST /v2/virtual-machines/$VM_ID/rename
Changes the name of the server with the given $VM_ID.
{
"name": "$vm_label"
}
{
"success":true
}
DELETE /v2/virtual-machines/$VM_ID
Adds a task to delete the server with the given $VM_ID.
{
"deleteResources": $delete_resources
}
0 if additional resources should be detached, 1 if they should be deleted{
"success":true
}