TOPICS
API

API: Images

The image category allows you to manage images and snapshots.

Action Required Parameters Optional Parameters
image/fetch region, name, location, format virtio
image/list None region
image/details image_id None
image/delete image_id None
image/replicate image_id, region None
image/rename image_id, name None
image/retrieve image_id None

image/fetch

Add a new image from an HTTP, HTTPS, or FTP source.

Required parameters:

  • region - region ('toronto', 'montreal', 'roubaix')
  • name - a label for this image
  • location - the source URL to download the image from
  • format - either 'iso' or 'qcow2'

Optional parameters:

  • virtio - 'yes' to use virtio storage and network drivers for VMs provisioned from this image (default is 'no' to use ide and e1000 drivers)

Example request and response:

Endpoint: image/fetch
region=toronto
name=myimage
location=https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso
format=iso

{
    "image_id": "141119",
    "success": "yes"
}

image/list

List images. The optional region parameter applies a filter so that only images in the specified region are returned.

Endpoint: image/list
region=toronto

{
    "images": [
        {
            "image_id": "84473",
            "name": "Arch Linux 2017-02-23 64-bit (ISO)",
            "region": "toronto",
            "status": "active"
        },
        {
            "image_id": "84476",
            "name": "Arch Linux 2017-02-23 64-bit (ISO)",
            "region": "toronto",
            "status": "active"
        },
        ...
}

image/details

Example request and response:

Endpoint: image/details
image_id=141119

{
    "details": {
        "cache_mode": "writeback",
        "checksum": "0a5352e3568bc893a9f7b65192caf1e1",
        "disk_format": "iso",
        "hw_disk_bus": "ide",
        "hw_video_model": "cirrus",
        "hw_vif_model": "e1000",
        "is_read_only": "no",
        "libvirt_cpu_mode": "host-model",
        "metadata": [],
        "name": "myimage",
        "region": "toronto",
        "size": "305135616",
        "status": "active",
        "time_created": "2018-12-17T00:23:09.000000"
    },
    "success": "yes"
}

image/delete

Delete an image.

Example request and response:

Endpoint: image/delete
image_id=141119

{"success": "yes"}

image/replicate

Replicate an image to another region.

Required parameters:

  • image_id - the image ID
  • region - destination region ('toronto', 'montreal', 'roubaix')

Example request and response:

Endpoint: image/replicate
image_id=141119
region=montreal

{
    "image_id": "141120",
    "success": "yes"
}

image/rename

Required parameters:

  • image_id - the image ID
  • name - the new name

Example request and response:

Endpoint: image/rename
image_id=141119
name=myimage2

{ "success": "yes"}

image/retrieve

Download a specified image.

This action does not return a JSON object. Instead, the response body contains the contents of a specified image. This allows you to download images from your account via the API.

Required parameters:

  • image_id - the image ID