GET /v2/storage-volumes
Returns an array with a list of existing virtual disks.
{
"success":true,
"storage_volumes": [
{
"id":"$volume_id",
"label":"$volume_label",
"size": $volume_size,
"cost_per_hour": $volume_cost,
"type": "$volume_type",
"system_disk": $volume_system,
// if shared_disk is equal to true then
// the 'virtual_machines' field will exist if the disk
// is connected to at least one virtual machine
"shared_disk": $shared_disk, //if false
"virtual_machine": {
"id": "$vm_id",
"label": "$vm_label",
"attach_time": "$attach_time"
}
// if shared_disk is equal to false then
// the 'virtual_machine' field will exist if
// the disk is connected to a virtual machine
"shared_disk": $shared_disk, //if true
"virtual_machines": [{
"id": "$vm_id",
"label": "$vm_label",
"attach_time": "$attach_time",
},
{ ... },
{
"id": "$vm_id",
"label": "$vm_label",
"attach_time": "$attach_time"
}
]
},
{ ... }
]
}
GET /v2/storage-volumes/$VOLUME_ID
Returns information about a virtual disk with the specified $VOLUME_ID
.
{
"success":true,
"storage_volume": [
{
"id": "$volume_id",
"label": "$volume_label",
"size": $volume_size,
"cost_per_hour": $volume_cost,
"type": "$volume_type",
"system_disk": $volume_system,
// if shared_disk is equal to true then
// the 'virtual_machines' field will exist if the disk
// is connected to at least one virtual machine
"shared_disk": $shared_disk, //if false
"virtual_machine": {
"id": "$vm_id",
"label": "$vm_label",
"attach_time": "$attach_time"
}
// if shared_disk is equal to false then
// the 'virtual_machine' field will exist if
// the disk is connected to a virtual machine
"shared_disk": $shared_disk, //if true
"virtual_machines": [{
"id": "$vm_id",
"label": "$vm_label",
"attach_time": "$attach_time",
},
{ ... },
{
"id": "$vm_id",
"label": "$vm_label",
"attach_time": "$attach_time"
}
]
}
]
}
POST /v2/storage-volumes/$VOLUME_ID/attach
{
"virtual_machine_id": "$vm_id"
}
{
"success":true
}
POST /v2/storage-volumes/$VOLUME_ID/detach
Adds a task to detach the disk $VOLUME_ID
from the virtual machine. The disk must be connected to the virtual machine for the operation to succeed.
{
"success":true
}
PUT /v2/storage-volumes
Dodaje nowy dysk wirtualny.
{
"zone_id": "$location_id",
"type": "$disk_type",
"name": "$disk_label",
"shared_volume": $shared_volume,
"size": $disk_size,
"recovery_point_id": "$recovery_point_id"
}
{
"success":true
}
DELETE /v2/storage-volumes/$VOLUME_ID
Adds a task to delete the disk $VOLUME_ID
. If the disk is connected to a virtual machine, it will be automatically detached from it.
{
"success":true
}