Drives

Allowed HTTP methods

Method Description
GET get / list object/s
POST create new object/s
PUT update / modify object/s
DELETE delete object/s

Note

See RFC 2616 for more details on HTTP methods semantics

Listing

GET /drives/

Gets the list of drives to which the authenticated user has access.

Parameters:
  • fields – A set of field names specifying the returned fields
Status Codes:
  • 200 – no error

Example request 1 - default list:

GET /api/2.0/drives/?limit=0 HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

Example response 1 - default list:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "meta": {
        "limit": 0,
        "offset": 0,
        "total_count": 8
    },
    "objects": [
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/d67997c3-ea7e-43dc-870e-afea2017aeea/",
            "status": "unmounted",
            "uuid": "d67997c3-ea7e-43dc-870e-afea2017aeea"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/a9b9eae5-096b-45a3-8b35-8be31547f749/",
            "status": "unmounted",
            "uuid": "a9b9eae5-096b-45a3-8b35-8be31547f749"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/89895923-3f45-4d19-80c3-8e7c3de15a82/",
            "status": "unmounted",
            "uuid": "89895923-3f45-4d19-80c3-8e7c3de15a82"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/f714eb49-e35a-438c-82d9-82960da8942f/",
            "status": "unmounted",
            "uuid": "f714eb49-e35a-438c-82d9-82960da8942f"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/7feae3c2-00fd-41d6-836c-0335fb92f95b/",
            "status": "unmounted",
            "uuid": "7feae3c2-00fd-41d6-836c-0335fb92f95b"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/38497498-9c92-4bd6-8d81-3fb0a18dfca4/",
            "status": "unmounted",
            "uuid": "38497498-9c92-4bd6-8d81-3fb0a18dfca4"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/a7010331-a967-4c3c-ac95-bcd5e016098b/",
            "status": "unmounted",
            "uuid": "a7010331-a967-4c3c-ac95-bcd5e016098b"
        },
        {
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/36e1644f-5f3b-4601-b50a-e34e397803e9/",
            "status": "unmounted",
            "uuid": "36e1644f-5f3b-4601-b50a-e34e397803e9"
        }
    ]
}

Example request 2 - just uuid and status fields:

GET /api/2.0/drives/?fields=uuid,status&limit=0 HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

Example response 2 - just uuid and status fields:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "meta": {
        "limit": 0,
        "offset": 0,
        "total_count": 8
    },
    "objects": [
        {
            "status": "unmounted",
            "uuid": "d67997c3-ea7e-43dc-870e-afea2017aeea"
        },
        {
            "status": "unmounted",
            "uuid": "a9b9eae5-096b-45a3-8b35-8be31547f749"
        },
        {
            "status": "unmounted",
            "uuid": "89895923-3f45-4d19-80c3-8e7c3de15a82"
        },
        {
            "status": "unmounted",
            "uuid": "f714eb49-e35a-438c-82d9-82960da8942f"
        },
        {
            "status": "unmounted",
            "uuid": "7feae3c2-00fd-41d6-836c-0335fb92f95b"
        },
        {
            "status": "unmounted",
            "uuid": "38497498-9c92-4bd6-8d81-3fb0a18dfca4"
        },
        {
            "status": "unmounted",
            "uuid": "a7010331-a967-4c3c-ac95-bcd5e016098b"
        },
        {
            "status": "unmounted",
            "uuid": "36e1644f-5f3b-4601-b50a-e34e397803e9"
        }
    ]
}

Detailed listing

GET /drives/detail/

Gets the detailed list of drives with additional information to which the authenticated user has access.

Status Codes:
  • 200 – no error

Example request:

GET /api/2.0/drives/detail/?limit=0 HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "meta": {
        "limit": 0,
        "offset": 0,
        "total_count": 8
    },
    "objects": [
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_1",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/d67997c3-ea7e-43dc-870e-afea2017aeea/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "d67997c3-ea7e-43dc-870e-afea2017aeea"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {
                "description": "",
                "install_notes": ""
            },
            "mounted_on": [],
            "name": "atom-qnez",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/a9b9eae5-096b-45a3-8b35-8be31547f749/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 11811160064,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "a9b9eae5-096b-45a3-8b35-8be31547f749"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_3",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/89895923-3f45-4d19-80c3-8e7c3de15a82/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "89895923-3f45-4d19-80c3-8e7c3de15a82"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [
                {
                    "amount": 1,
                    "license": {
                        "burstable": false,
                        "long_name": "Windows Server 2008 Standard",
                        "name": "msft_p73_04837",
                        "resource_uri": "/api/2.0/licenses/13/",
                        "type": "instance",
                        "user_metric": ""
                    },
                    "user": null
                }
            ],
            "media": "disk",
            "meta": {
                "arch": "32",
                "category": "general",
                "description": "Please refer to the install notes for a full guide to initial configuration.",
                "favourite": "False",
                "image_type": "preinst",
                "install_notes": "<script type=\"text/javascript\">alert(\"a\");</script>***You must update the default Administrator password for Windows Server Standard 2003***\\n\\nPre-installed Windows Server 2003 Standard 32bit English on 08/10/2010\\n==========================================================\\n\\n1. Connecting to your server via VNC\\n--------------------------------------------------\\n\\na) Having installed a compatible VNC client, open a VNC connection to your server.\\n\\nb) Enter your IP address and VNC password as displayed on your Server Summary Window.\\n\\nc) Start to configure your server.\\n\\n\\n2. Minimum Hardware Requirements\\n---------------------------------------------------\\n\\nThe recommended minimum hardware requirements as publishes by Microsoft can be found through \\n\\nthe following link:\\n\\nhttp://technet.microsoft.com/en-us/library/cc738496(WS.10).aspx\\n\\nWe recommend specifying a higher level of RAM for a better user experience.\\n\\n\\n3. Update your administrator password\\n-----------------------------------------------------\\n\\nThe default administrator password is set to: CloudSigma1\\n\\nPlease CHANGE this IMMEDIATELY after first logging on.\\n\\na) Select &quot;Start&quot; | &quot;Administrative Tools&quot; | &quot;Computer Management&quot;\\n\\nb) Select &quot;System Tools&quot; | &quot;Local Users and Groups&quot; | &quot;Users&quot;\\n\\nc) Right click on &quot;Administrator&quot; and select &quot;Set Password&quot;\\n\\nd) Enter a new administrative password\\n\\nProceed to select Users and Groups according to your Domain policies.\\n\\n4. Configuring your Networking\\n------------------------------------------\\n\\na) IP networking can be left as DHCP. Even if you are using a static IP address with this server our management layer will apply the same IP address via DHCP. Using DHCP ensures you will have no issues receiving the correct networking settings. We recommend using DHCP initially if only to receive all the correct networking settings.\\n\\nb) CloudSigma employs an open networking infrastructure. All ports are open for inbound and outbound traffic with the exception of port 25 (SMTP) which is blocked for trial users. It is important that you secure access to your server according to your needs.\\n\\n\\n5. Expanding your drive\\n--------------------------------\\n\\nThe system is fully installed, but you will need to extend the disk partition to cover the whole of your drive. To do this:\\n\\na) Open the &quot;Computer Management&quot; tool from &quot;Administrative Tools&quot; on the &quot;Start&quot; menu.\\n\\nb) Select &quot;Storage&quot; then &quot;Disk Management&quot; in the left hand pane.\\n\\nc) Right-click on the &quot;Unallocated&quot; partition volume and select &quot;New Partition&quot;.\\n\\nd) This will start the &quot;New Partition Wizard&quot;. For the purposes of these instructions we will extend the existing partition.\\n\\ne) Select &quot;Primary Partition&quot; and click &quot;Next&quot;.\\n\\nf) Select the maximum &quot;Partition size in MB&quot; you require or leave the default value. Click &quot;Next&quot;.\\n\\ng) Assign a drive letter, and click &quot;Next&quot;.\\n\\nh) Enter your Format Partition values including the &quot;File System&quot; type, &quot;Allocation unit size&quot; \\n\\nand a &quot;Volume label&quot;. We recommend leaving the default value for the File System format and the Allocation unit size. Click &quot;Next&quot; to continue.\\n\\ni) click Finish to complete the process. The new volume will now be formatted and setup.\\n\\nYou may also use third party tools to create and manage your partitions.\\n\\n\\n6. Enabling Remote Access\\n--------------------------------------\\n\\nAfter logging in to VNC for the first time to configure your new Windows server, we recommend \\nthat if you are logging in from a Windows Desktop that you enable Remote Desktop for better access performance. To do this, follow these instructions:\\n\\na) Select &quot;Start&quot; | &quot;Applications&quot; | &quot;Control Panel&quot;\\n\\nb) Select &quot;System&quot; and select the &quot;Remote&quot; tab\\n\\nc) Enable the &quot;Allow users to connect remotely to this computer&quot; under the &quot;System&quot; checkbox\\n\\n\\n7. Pinging Service\\n-------------------------\\n\\nThe Pinging service has been turned on by default, if you wish to disable it please follow these instructions:\\n\\na) Select &quot;Start&quot; | &quot;Applications&quot; | &quot;Control Panel&quot; | &quot;Windows Firewall&quot;\\n\\nb) Select the &quot;Advanced&quot; tab\\n\\nc) Click on the &quot;Settings&quot; button under the &quot;ICMP&quot; section\\n\\nd) Unselect &quot;Allow incoming echo request&quot; checkbox\\n\\ne) Press &quot;OK&quot; to return to the Windows Firewall, and press &quot;OK&quot; again to finalise the change\\n",
                "os": "windows",
                "paid": "True",
                "url": ""
            },
            "mounted_on": [],
            "name": "Windows Server 2003 Standard 32bit English Preinstalled System",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/f714eb49-e35a-438c-82d9-82960da8942f/",
            "runtime": {
                "is_snapshotable": false,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 13958643712,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "f714eb49-e35a-438c-82d9-82960da8942f"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_4",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/7feae3c2-00fd-41d6-836c-0335fb92f95b/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "7feae3c2-00fd-41d6-836c-0335fb92f95b"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_2",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/38497498-9c92-4bd6-8d81-3fb0a18dfca4/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "38497498-9c92-4bd6-8d81-3fb0a18dfca4"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_0",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/a7010331-a967-4c3c-ac95-bcd5e016098b/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "a7010331-a967-4c3c-ac95-bcd5e016098b"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {
                "description": "",
                "install_notes": ""
            },
            "mounted_on": [],
            "name": "otom",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/36e1644f-5f3b-4601-b50a-e34e397803e9/",
            "runtime": {
                "is_snapshotable": false,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 11811160064,
            "snapshots": [],
            "status": "unmounted",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "36e1644f-5f3b-4601-b50a-e34e397803e9"
        }
    ]
}

List single drive

GET /drives/{uuid}/

Gets detailed information for drive identified by drive_uuid.

Status Codes:
  • 200 – no error

Example request:

GET /api/2.0/drives/f17cce62-bcc9-4e0b-a57b-a5582b05aff0/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "affinities": [],
    "allow_multimount": false,
    "jobs": [],
    "licenses": [],
    "media": "disk",
    "meta": {},
    "mounted_on": [],
    "name": "test_drive_1",
    "owner": {
        "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
        "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
    },
    "resource_uri": "/api/2.0/drives/f17cce62-bcc9-4e0b-a57b-a5582b05aff0/",
    "runtime": {
        "is_snapshotable": true,
        "snapshots_allocated_size": 0,
        "storage_type": "dssd"
    },
    "size": 1024000000,
    "snapshots": [],
    "status": "unmounted",
    "storage_type": "dssd",
    "tags": [],
    "uuid": "f17cce62-bcc9-4e0b-a57b-a5582b05aff0"
}

Creating

POST /drives/

Creates a new drive or multiple drives.

Status Codes:
  • 201 – object created

Example request:

Create a drive

POST /api/2.0/drives/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

{
    "media": "disk",
    "name": "test_drive_0",
    "size": "1024000000"
}

or create multiple drives

POST /api/2.0/drives/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

{
    "objects": [
        {
            "media": "disk",
            "name": "test_drive_0",
            "size": "1024000000"
        },
        {
            "media": "disk",
            "name": "test_drive_1",
            "size": "1024000000"
        },
        {
            "media": "disk",
            "name": "test_drive_2",
            "size": "1024000000"
        },
        {
            "media": "disk",
            "name": "test_drive_3",
            "size": "1024000000"
        },
        {
            "media": "disk",
            "name": "test_drive_4",
            "size": "1024000000"
        }
    ]
}

or you can omit the {‘objects’: ... } and provide only the list:

POST /api/2.0/drives/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

[
    {
        "media": "disk",
        "name": "test_drive_0",
        "size": "1024000000"
    },
    {
        "media": "disk",
        "name": "test_drive_1",
        "size": "1024000000"
    },
    {
        "media": "disk",
        "name": "test_drive_2",
        "size": "1024000000"
    },
    {
        "media": "disk",
        "name": "test_drive_3",
        "size": "1024000000"
    },
    {
        "media": "disk",
        "name": "test_drive_4",
        "size": "1024000000"
    }
]

Example response

HTTP/1.1 201 CREATED
Content-Type: application/json; charset=utf-8

{
    "objects": [
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_0",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/a7010331-a967-4c3c-ac95-bcd5e016098b/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "creating",
            "storage_type": null,
            "tags": [],
            "uuid": "a7010331-a967-4c3c-ac95-bcd5e016098b"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_1",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/d67997c3-ea7e-43dc-870e-afea2017aeea/",
            "runtime": {
                "is_snapshotable": null,
                "snapshots_allocated_size": 0,
                "storage_type": null
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "creating",
            "storage_type": null,
            "tags": [],
            "uuid": "d67997c3-ea7e-43dc-870e-afea2017aeea"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_2",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/38497498-9c92-4bd6-8d81-3fb0a18dfca4/",
            "runtime": {
                "is_snapshotable": null,
                "snapshots_allocated_size": 0,
                "storage_type": null
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "creating",
            "storage_type": null,
            "tags": [],
            "uuid": "38497498-9c92-4bd6-8d81-3fb0a18dfca4"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_3",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/89895923-3f45-4d19-80c3-8e7c3de15a82/",
            "runtime": {
                "is_snapshotable": null,
                "snapshots_allocated_size": 0,
                "storage_type": null
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "creating",
            "storage_type": null,
            "tags": [],
            "uuid": "89895923-3f45-4d19-80c3-8e7c3de15a82"
        },
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_4",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/7feae3c2-00fd-41d6-836c-0335fb92f95b/",
            "runtime": {
                "is_snapshotable": null,
                "snapshots_allocated_size": 0,
                "storage_type": null
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "creating",
            "storage_type": null,
            "tags": [],
            "uuid": "7feae3c2-00fd-41d6-836c-0335fb92f95b"
        }
    ]
}

Editing

PUT /drives/{uuid}/

Edits a drive. Note that if the drive is mounted on a running server only the name, meta, tags, and allow_multimount can be changed. If other fields such as size or media are changed for a drive mounted on a running server these changes will be ignored. To make sure that the changes are either fully applied or an error is returned if impossible, use the resize action (Resizing (Update or Fail)). Note that changing drive size might be a slow operation, and the drive cannot be used during the resizing.

Status Codes:
  • 200 – no errors

Example request:

PUT /api/2.0/drives/d36140a9-6586-4fe0-9b3f-fabb4649fa3e/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

{
    "media": "cdrom",
    "name": "test_drive_y",
    "size": 1024000000
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "affinities": [],
    "allow_multimount": false,
    "jobs": [],
    "licenses": [],
    "media": "cdrom",
    "meta": {},
    "mounted_on": [],
    "name": "test_drive_y",
    "owner": {
        "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
        "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
    },
    "resource_uri": "/api/2.0/drives/d36140a9-6586-4fe0-9b3f-fabb4649fa3e/",
    "runtime": {
        "is_snapshotable": true,
        "snapshots_allocated_size": 0,
        "storage_type": "dssd"
    },
    "size": 1024000000,
    "snapshots": [],
    "status": "unmounted",
    "storage_type": "dssd",
    "tags": [],
    "uuid": "d36140a9-6586-4fe0-9b3f-fabb4649fa3e"
}

Resizing (Update or Fail)

POST /drives/{uuid}/action/?do=resize

In order to make sure that drive changes take effect, one can use the resize action. It updates a drive definition, and returns an error if not possible to completely apply the new drive definition, which may happen if the drive is mounted on a running server. The name of the action is resize because only drive size cannot be changed for a drive mounted on a running server.

Note that the resize action is a full definition update (it can update even name and meta), so a full definition should be provided to this call.

Example:

POST /api/2.0/drives/84feaa96-fc08-45de-8b0a-33ea1b3ca647/action/?do=resize HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

{
    "affinities": [],
    "allow_multimount": false,
    "jobs": [],
    "licenses": [],
    "media": "disk",
    "meta": {},
    "mounted_on": [],
    "name": "test_drive_1",
    "owner": {
        "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
        "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
    },
    "resource_uri": "/api/2.0/drives/84feaa96-fc08-45de-8b0a-33ea1b3ca647/",
    "runtime": {
        "is_snapshotable": null,
        "snapshots_allocated_size": 0,
        "storage_type": null
    },
    "size": 4294967296,
    "snapshots": [],
    "status": "creating",
    "storage_type": null,
    "tags": [],
    "uuid": "84feaa96-fc08-45de-8b0a-33ea1b3ca647"
}

Note that the drive in the response is with status resizing:

HTTP/1.1 202 ACCEPTED
Content-Type: application/json; charset=utf-8

{
    "objects": [
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "disk",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_1",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/84feaa96-fc08-45de-8b0a-33ea1b3ca647/",
            "runtime": {
                "is_snapshotable": true,
                "snapshots_allocated_size": 0,
                "storage_type": "dssd"
            },
            "size": 2147483648,
            "snapshots": [],
            "status": "resizing",
            "storage_type": "dssd",
            "tags": [],
            "uuid": "84feaa96-fc08-45de-8b0a-33ea1b3ca647"
        }
    ]
}

Meta

It is possible to add arbitrary key-value data to a drive definition. See Objects’ meta field for more information.

Deleting

Single drive

DELETE /drives/{uuid}/

Deletes a single mounted or unmounted drive.

Status Codes:
  • 204 – No content, object deletion started.

Example request:

DELETE /api/2.0/drives/f17cce62-bcc9-4e0b-a57b-a5582b05aff0/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

Example response:

HTTP/1.1 204 NO CONTENT
Content-Type: text/html; charset=utf-8

Multiple drives

DELETE /drives/

Deletes multiple mounted or unmounted drives specified by their UUID’s.

statuscode 204:No content, object deletion started.

Example request:

Request body

{"objects":
  [
    {
     "uuid":"b137e217-42b6-4ecf-8575-d72efc2d3dbd",
    },
    {
     "uuid":"e035a488-8587-4a15-ab25-9b7343236bc9",
    },
    {
     "uuid":"feded33c-106f-49fa-a1c4-be5c718ad1b5",
    }
  ]
}

Example response:

HTTP/1.0 204 NO CONTENT

Cloning

POST /drives/{uuid}/action/?do=clone

Clones a drive. Request body is optional and any or all of the key/value pairs can be omitted.

Status Codes:
  • 202 – Action accepted, execution is proceeding.

Example request:

POST /api/2.0/drives/0edc2f50-20de-405b-aca8-a4a6bc4a65b6/action/?do=clone HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop

{
    "affinities": [],
    "media": "cdrom",
    "name": "test_drive_y"
}

Example response:

HTTP/1.1 202 ACCEPTED
Content-Type: application/json; charset=utf-8

{
    "objects": [
        {
            "affinities": [],
            "allow_multimount": false,
            "jobs": [],
            "licenses": [],
            "media": "cdrom",
            "meta": {},
            "mounted_on": [],
            "name": "test_drive_y",
            "owner": {
                "resource_uri": "/api/2.0/user/42cb107b-d57a-4808-93d9-2d3f9ae4fe71/",
                "uuid": "42cb107b-d57a-4808-93d9-2d3f9ae4fe71"
            },
            "resource_uri": "/api/2.0/drives/bf645eae-ce03-4208-87bf-19126b14ea9d/",
            "runtime": {
                "is_snapshotable": null,
                "snapshots_allocated_size": 0,
                "storage_type": null
            },
            "size": 1024000000,
            "snapshots": [],
            "status": "cloning_dst",
            "storage_type": null,
            "tags": [],
            "uuid": "bf645eae-ce03-4208-87bf-19126b14ea9d"
        }
    ]
}

Request schema

{
   "description":"Clone drive",
   "properties":{
          "name":{
                  "description": "Name of the cloned drive",
          }
          "media":{
                  "description": "Media of the cloned drive",
          }
          "affinities":{
                  "description": "Affinities of the cloned drive",
          }
   }
}

Availability groups

It is possible to query which drives share common storage hosts. See Drives availability groups.

Creating or Cloning drives to Different infrastructure (Avoid)

It is possible to hint the system which drives are preferred to be on separate physical storage host. See Creating Drives in a Different Availability Group (Create/Clone Avoid).

Licenses

Drives can have licenses attached to them. This means usage of the given drive on a running server requires either posession of subscriptions for the given licenses or additional payment. Typical such example are some drives in the drives library, see Licensed drive images and Licenses list

Drive State Diagram

_images/DrivesStates.png

Schema

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "allowed_detail_http_methods": [
        "get",
        "put",
        "delete"
    ],
    "allowed_list_http_methods": [
        "get",
        "put",
        "delete",
        "post"
    ],
    "default_format": "application/json",
    "default_limit": 20,
    "fields": {
        "affinities": {
            "choices": [
                "ssd"
            ],
            "default": [],
            "help_text": "A list of affinities this drive should belong to",
            "readonly": false,
            "required": false,
            "type": "list"
        },
        "allow_multimount": {
            "default": false,
            "help_text": "Allow the drive to be mounted on multiple guests. Not taken into account when drive is cdrom.",
            "readonly": false,
            "required": false,
            "type": "boolean"
        },
        "jobs": {
            "default": "No default provided.",
            "help_text": "Background jobs related to this resource",
            "readonly": true,
            "required": true,
            "type": "related"
        },
        "licenses": {
            "default": [],
            "fields": {
                "amount": {
                    "default": 1,
                    "help_text": "Number of licenses",
                    "readonly": false,
                    "required": false,
                    "type": "integer"
                },
                "license": {
                    "default": "No default provided.",
                    "help_text": "A single related resource. Can be either a URI or set of nested resource data.",
                    "readonly": false,
                    "required": true,
                    "type": "related"
                },
                "user": {
                    "default": null,
                    "help_text": "Owner of the license",
                    "readonly": false,
                    "required": false,
                    "type": "related"
                }
            },
            "help_text": "A list of licenses attached to this drive",
            "readonly": false,
            "required": false,
            "type": "related"
        },
        "media": {
            "choices": [
                "cdrom",
                "disk"
            ],
            "default": null,
            "help_text": "Media representation type",
            "readonly": false,
            "required": true,
            "type": "string"
        },
        "meta": {
            "default": {},
            "help_text": "User defined meta information",
            "readonly": false,
            "required": false,
            "type": "dict"
        },
        "mounted_on": {
            "default": "No default provided.",
            "help_text": "Servers on which this drive is mounted on",
            "readonly": true,
            "required": false,
            "type": "related"
        },
        "name": {
            "default": null,
            "help_text": "Human readable name of the drive",
            "readonly": false,
            "required": true,
            "type": "string"
        },
        "owner": {
            "default": null,
            "help_text": "Owner of the drive",
            "readonly": true,
            "required": false,
            "type": "related"
        },
        "resource_uri": {
            "default": "No default provided.",
            "help_text": "Unicode string data. Ex: \"Hello World\"",
            "readonly": true,
            "required": true,
            "type": "string"
        },
        "runtime": {
            "default": "No default provided.",
            "fields": {
                "is_snapshotable": {
                    "default": "No default provided.",
                    "help_text": "Specifies if the drive supports snapshotting",
                    "readonly": true,
                    "required": true,
                    "type": "boolean"
                },
                "snapshots_allocated_size": {
                    "default": "No default provided.",
                    "help_text": "Sum of the allocated size of this drive's snapshots",
                    "readonly": true,
                    "required": false,
                    "type": "integer"
                },
                "storage_type": {
                    "default": "No default provided.",
                    "help_text": "Underlying storage",
                    "readonly": true,
                    "required": true,
                    "type": "string"
                }
            },
            "help_text": "Runtime information of the drive",
            "readonly": true,
            "required": false,
            "type": "related"
        },
        "size": {
            "default": null,
            "help_text": "Size of the drive in bytes",
            "readonly": false,
            "required": true,
            "type": "integer"
        },
        "snapshots": {
            "default": "No default provided.",
            "help_text": "Servers on which this drive is mounted on",
            "readonly": true,
            "required": false,
            "type": "related"
        },
        "status": {
            "default": "No default provided.",
            "help_text": "Status of the drive.",
            "readonly": true,
            "required": true,
            "type": "string"
        },
        "storage_type": {
            "default": "No default provided.",
            "help_text": "Underlying storage",
            "readonly": true,
            "required": true,
            "type": "string"
        },
        "tags": {
            "default": [],
            "help_text": "Tags associated with this drive",
            "readonly": false,
            "required": false,
            "type": "list"
        },
        "uuid": {
            "default": null,
            "help_text": "UUID of the drive",
            "readonly": true,
            "required": true,
            "type": "string"
        }
    }
}