# Client API: Cloud Compute images

> Your own ISOs and disk images for Cloud Compute: upload in parts, import from an https link, list, rename and delete.

Source: https://www.coritan.com/docs/api/reference/client/cloud-compute-images/

Your own ISOs and disk images for Cloud Compute: upload in parts, import from an https link, list, rename and delete. Paths are under `/api/v1/client/vps/images`.

Base URL: `https://api.coritan.com/api/v1`. Paths below are complete.

To try these requests in the browser, open the [interactive Client API reference](https://api.coritan.com/docs).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/client/vps/images`](#op-get-api-v1-client-vps-images) | The account's images, newest first, and the storage they and snapshots use |
| POST | [`/api/v1/client/vps/images/imports`](#op-post-api-v1-client-vps-images-imports) | Queue a download of a public https file |
| POST | [`/api/v1/client/vps/images/uploads`](#op-post-api-v1-client-vps-images-uploads) | Start upload |
| GET | [`/api/v1/client/vps/images/{image_uuid}`](#op-get-api-v1-client-vps-images-image-uuid) | One of the account's images |
| PATCH | [`/api/v1/client/vps/images/{image_uuid}`](#op-patch-api-v1-client-vps-images-image-uuid) | Rename an image, or correct its operating system, firmware or cloud-init flag |
| DELETE | [`/api/v1/client/vps/images/{image_uuid}`](#op-delete-api-v1-client-vps-images-image-uuid) | Delete an image |
| POST | [`/api/v1/client/vps/images/{image_uuid}/complete`](#op-post-api-v1-client-vps-images-image-uuid-complete) | Join the uploaded parts |
| POST | [`/api/v1/client/vps/images/{image_uuid}/parts`](#op-post-api-v1-client-vps-images-image-uuid-parts) | Sign the part URLs of an upload in progress again |

### The account's images, newest first, and the storage they and snapshots use {#op-get-api-v1-client-vps-images}

`GET /api/v1/client/vps/images`

The account's images, newest first, and the storage they and snapshots use.

An unknown ``kind`` or ``status`` answers 422 naming the allowed words.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `kind` | query | string or null | no | Only images of this kind: iso, disk. |
| `status` | query | string or null | no | Only images in this state: pending, uploading, validating, ready, failed, deleting. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Queue a download of a public https file {#op-post-api-v1-client-vps-images-imports}

`POST /api/v1/client/vps/images/imports`

Queue a download of a public https file. The image is ``pending`` until it is stored and checked.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | yes | A public https:// address of the file. Redirects are not followed. |
| `name` | string | yes |  |
| `kind` | string | yes |  |
| `location` | string or null | no |  |
| `description` | string or null | no |  |
| `os_family` | string or null | no |  |
| `bios` | string or null | no |  |
| `cloud_init` | boolean | no |  |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Start upload {#op-post-api-v1-client-vps-images-uploads}

`POST /api/v1/client/vps/images/uploads`

Open an upload: the image and one presigned URL per part (``part_size`` bytes each, the last shorter).

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | 1 to 100 characters. |
| `kind` | string | yes | iso, or disk for a qcow2, raw or vmdk disk image. |
| `size_bytes` | integer | yes | The file's exact size in bytes. |
| `location` | string or null | no | Where to keep it, a storage location code. Default: the first. |
| `description` | string or null | no |  |
| `os_family` | string or null | no | linux (default), bsd or other. |
| `bios` | string or null | no | ovmf (UEFI, default) or seabios (legacy BIOS). |
| `cloud_init` | boolean | no | Whether the disk image reads cloud-init. Ignored for an ISO. |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### One of the account's images {#op-get-api-v1-client-vps-images-image-uuid}

`GET /api/v1/client/vps/images/{image_uuid}`

One of the account's images. Another account's answers 404.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `image_uuid` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Rename an image, or correct its operating system, firmware or cloud-init flag {#op-patch-api-v1-client-vps-images-image-uuid}

`PATCH /api/v1/client/vps/images/{image_uuid}`

Rename an image, or correct its operating system, firmware or cloud-init flag.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `image_uuid` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `name` | string or null | no |
| `description` | string or null | no |
| `os_family` | string or null | no |
| `bios` | string or null | no |
| `cloud_init` | boolean or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Delete an image {#op-delete-api-v1-client-vps-images-image-uuid}

`DELETE /api/v1/client/vps/images/{image_uuid}`

Delete an image. Instances made from it keep running. 409 for an image on hold.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `image_uuid` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Join the uploaded parts {#op-post-api-v1-client-vps-images-image-uuid-complete}

`POST /api/v1/client/vps/images/{image_uuid}/complete`

Join the uploaded parts. The image is ``validating`` until the check finishes.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `image_uuid` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `parts` | array of CompletedPart | yes |
| `parts[].part_number` | integer | yes |
| `parts[].etag` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Sign the part URLs of an upload in progress again {#op-post-api-v1-client-vps-images-image-uuid-parts}

`POST /api/v1/client/vps/images/{image_uuid}/parts`

Sign the part URLs of an upload in progress again. 409 when it is not waiting for an upload.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `image_uuid` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `part_numbers` | array of integer or null | no | The parts to sign again. Default: every part. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
