REST - Disk Images

Listing Disk Images

Request

GET /v2/disk-images

Returns an array containing a list of existing disk images.

Response

{  
  "success":true,
  "disk_images": [
     {
        "id":"$image_id",
        "label":"$image_label",
        "size": $image_size,
        "cost_per_hour": $image_cost,
        "owner": {
           "id": "$owner_id",
           "name": "$owner_name"
        },
        "storage_volume": {
            "id": "$volume_id",
            "size": "$volume_size",
            "label": "$volume_label",
            "type": "$volume_type",
            "system_disk": $volume_system,

            // if shared_disk is equal to false, then
            // 'virtual_machine' field will exist if the
            // disk is attached to a virtual machine
            "shared_disk": $shared_disk,
            "virtual_machine": {
               "id": "$vm_id",
               "label": "$vm_label",
               "attach_time": "$attach_time"
            }

            // if shared_disk is equal to true, then
            // 'virtual_machines' field will exist if the
            // disk is attached to at least one 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"
               }
            ]
        }
     }
  ]
}

Returned information

  • $image_id (string) - UUID of the disk image
  • $image_label (string) - name of the disk image
  • $image_size (int) - size of the image (in GB)
  • $cost_per_hour (float) - cost of the image per hour
  • $owner_id (string) - UUID of the image owner
  • $owner_name (string) - name of the image owner
  • $volume_id (string) - UUID of the virtual disk
  • $volume_label (string) - name of the virtual disk
  • $volume_size (int) - size of the disk (in GB)
  • $shared_disk (bool) - specifies whether the disk is a shared or regular disk
  • $volume_system (int) - specifies whether the disk is a system disk
  • $volume_type (string) - specifies the type of disk HDD/SSD
  • $vm_id (string) - UUID of the virtual machine to which the disk is attached
  • $vm_label (string) - name of the virtual machine to which the disk is attached
  • $attach_time (datetime) - date and time of attaching the disk to the virtual server


Creating an Image

Request

PUT /v2/disk-images

Request Content

{
   "storage_volume_id": $volume_id,
   "label": $image_label
}

Parameters Description

  • $volume_id (string) - UUID of the disk
  • $image_label (string) - name of the image

Response

{  
  "success":true,
  "disk_image": {
      "id": $image_id
  }
}

Returned information

  • $image_id (string) - UUID of the new disk image


Deleting an image

Request

DELETE /v2/disk-images/$IMAGE_ID

Usuwa obraz $IMAGE_ID.

Response

{  
  "success":true
}