# Block Storage


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

Exoscale's Block Storage offers persistent externally attached volumes for your Compute instances.

[Read more](https://community.exoscale.com/documentation/block-storage/)

## <span data-label="POST" class="pill-POST"></span>create-block-storage-snapshot

Create a block storage snapshot

```
POST /block-storage/{id}:create-snapshot
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `labels` | object | no | Resource labels |
| `name` | string | no | Snapshot name<br/><br/>Min length: `1`. Max length: `255`. |

<details>
<summary>Example</summary>

```json
{
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-block-storage-snapshot`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateBlockStorageSnapshot) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_block_storage_snapshot) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createBlockStorageSnapshot(java.util.UUID,com.exoscale.sdk.model.CreateBlockStorageSnapshotRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-block-storage-snapshot`

## <span data-label="GET" class="pill-GET"></span>get-block-storage-snapshot

Retrieve block storage snapshot details

```
GET /block-storage-snapshot/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `block-storage-volume` | [Target block storage volume](/reference/api/_schemas/block-storage-volume-ref/) | Referenced volume |
| `created-at` | string | Snapshot creation date<br/><br/>ISO 8601 date-time. |
| `id` | string | Snapshot ID<br/><br/>Must be a valid UUID. |
| `labels` | object | Resource labels |
| `name` | string | Snapshot name<br/><br/>Min length: `1`. Max length: `255`. |
| `size` | integer | Snapshot size<br/><br/>Min: `1`. |
| `state` | string | Snapshot state<br/><br/>Allowed values: `partially-destroyed`, `destroying`, `creating`, `created`, `promoting`, `error`, `destroyed`, `allocated`. |
| `volume-size` | integer | Original Volume size<br/><br/>Min: `0`. |

<details>
<summary>Example output</summary>

```json
{
  "block-storage-volume": {
    "id": "string"
  },
  "created-at": "2024-01-01T12:00:00Z",
  "id": "string",
  "labels": {},
  "name": "string",
  "size": 0,
  "state": "partially-destroyed",
  "volume-size": 0
}
```
</details>


SDK reference for `get-block-storage-snapshot`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetBlockStorageSnapshot) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_block_storage_snapshot) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getBlockStorageSnapshot(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-block-storage-snapshot`

## <span data-label="PUT" class="pill-PUT"></span>update-block-storage-snapshot

Update block storage volume snapshot

```
PUT /block-storage-snapshot/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `labels` | object | no | Resource labels |
| `name` | string | no | Snapshot name<br/><br/>Max length: `255`. |

<details>
<summary>Example</summary>

```json
{
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-block-storage-snapshot`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateBlockStorageSnapshot) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_block_storage_snapshot) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateBlockStorageSnapshot(java.util.UUID,com.exoscale.sdk.model.UpdateBlockStorageSnapshotRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-block-storage-snapshot`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-block-storage-snapshot

Delete a block storage snapshot, data will be unrecoverable

```
DELETE /block-storage-snapshot/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-block-storage-snapshot`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteBlockStorageSnapshot) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_block_storage_snapshot) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteBlockStorageSnapshot(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-block-storage-snapshot`

## <span data-label="POST" class="pill-POST"></span>create-block-storage-volume

Create a block storage volume

```
POST /block-storage
```

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `block-storage-snapshot` | [Target block storage snapshot](/reference/api/_schemas/block-storage-snapshot-ref/) | no | Block storage snapshot |
| `labels` | object | no | Resource labels |
| `name` | string | no | Volume name<br/><br/>Max length: `255`. |
| `size` | integer | no | Volume size in GiB.                             When a snapshot ID is supplied, this defaults to the size of the source volume, but can be set to a larger value.<br/><br/>Min: `1`. |

<details>
<summary>Example</summary>

```json
{
  "block-storage-snapshot": {
    "id": "string"
  },
  "labels": {},
  "name": "string",
  "size": 0
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-block-storage-volume`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateBlockStorageVolume) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_block_storage_volume) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createBlockStorageVolume(com.exoscale.sdk.model.CreateBlockStorageVolumeRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-block-storage-volume`

## <span data-label="GET" class="pill-GET"></span>get-block-storage-volume

Retrieve block storage volume details

```
GET /block-storage/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `block-storage-snapshots` | array of [Target block storage snapshot](/reference/api/_schemas/block-storage-snapshot-ref/) | Volume snapshots, if any |
| `blocksize` | integer | Volume block size<br/><br/>Min: `0`. |
| `created-at` | string | Volume creation date<br/><br/>ISO 8601 date-time. |
| `encrypted` | boolean | Indicates if the block-storage volume is encrypted |
| `id` | string | Volume ID<br/><br/>Must be a valid UUID. |
| `instance` | [Target Instance](/reference/api/_schemas/instance-ref/) | Volume attached instance, if any |
| `labels` | object | Resource labels |
| `name` | string | Volume name<br/><br/>Min length: `1`. Max length: `255`. |
| `size` | integer | Volume size<br/><br/>Min: `1`. |
| `state` | string | Volume state<br/><br/>Allowed values: `snapshotting`, `deleted`, `creating`, `detached`, `deleting`, `attaching`, `error`, `attached`, `detaching`. |

<details>
<summary>Example output</summary>

```json
{
  "block-storage-snapshots": [
    {
      "id": "string"
    }
  ],
  "blocksize": 0,
  "created-at": "2024-01-01T12:00:00Z",
  "encrypted": true,
  "id": "string",
  "instance": {
    "id": "string"
  },
  "labels": {},
  "name": "string",
  "size": 0,
  "state": "snapshotting"
}
```
</details>


SDK reference for `get-block-storage-volume`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetBlockStorageVolume) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_block_storage_volume) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getBlockStorageVolume(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-block-storage-volume`

## <span data-label="PUT" class="pill-PUT"></span>resize-block-storage-volume

Resize a block storage volume

```
PUT /block-storage/{id}:resize-volume
```

This operation resizes a Block storage volume. Note: the volume can only grow, cannot be shrunk. Only detached volumes or volumes attached to stopped instances can be resized.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `size` | integer | **yes** | Volume size in GiB<br/><br/>Min: `0`. |

<details>
<summary>Example</summary>

```json
{
  "size": 0
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `block-storage-snapshots` | array of [Target block storage snapshot](/reference/api/_schemas/block-storage-snapshot-ref/) | Volume snapshots, if any |
| `blocksize` | integer | Volume block size<br/><br/>Min: `0`. |
| `created-at` | string | Volume creation date<br/><br/>ISO 8601 date-time. |
| `encrypted` | boolean | Indicates if the block-storage volume is encrypted |
| `id` | string | Volume ID<br/><br/>Must be a valid UUID. |
| `instance` | [Target Instance](/reference/api/_schemas/instance-ref/) | Volume attached instance, if any |
| `labels` | object | Resource labels |
| `name` | string | Volume name<br/><br/>Min length: `1`. Max length: `255`. |
| `size` | integer | Volume size<br/><br/>Min: `1`. |
| `state` | string | Volume state<br/><br/>Allowed values: `snapshotting`, `deleted`, `creating`, `detached`, `deleting`, `attaching`, `error`, `attached`, `detaching`. |

<details>
<summary>Example output</summary>

```json
{
  "block-storage-snapshots": [
    {
      "id": "string"
    }
  ],
  "blocksize": 0,
  "created-at": "2024-01-01T12:00:00Z",
  "encrypted": true,
  "id": "string",
  "instance": {
    "id": "string"
  },
  "labels": {},
  "name": "string",
  "size": 0,
  "state": "snapshotting"
}
```
</details>


SDK reference for `resize-block-storage-volume`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResizeBlockStorageVolume) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.resize_block_storage_volume) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resizeBlockStorageVolume(java.util.UUID,com.exoscale.sdk.model.ResizeBlockStorageVolumeRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api resize-block-storage-volume`

## <span data-label="PUT" class="pill-PUT"></span>detach-block-storage-volume

Detach block storage volume

```
PUT /block-storage/{id}:detach
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `detach-block-storage-volume`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DetachBlockStorageVolume) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.detach_block_storage_volume) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#detachBlockStorageVolume(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api detach-block-storage-volume`

## <span data-label="PUT" class="pill-PUT"></span>update-block-storage-volume

Update block storage volume

```
PUT /block-storage/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `labels` | object | no | Resource labels |
| `name` | string | no | Volume name<br/><br/>Max length: `255`. |

<details>
<summary>Example</summary>

```json
{
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-block-storage-volume`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateBlockStorageVolume) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_block_storage_volume) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateBlockStorageVolume(java.util.UUID,com.exoscale.sdk.model.UpdateBlockStorageVolumeRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-block-storage-volume`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-block-storage-volume

Delete a block storage volume, data will be unrecoverable

```
DELETE /block-storage/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-block-storage-volume`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteBlockStorageVolume) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_block_storage_volume) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteBlockStorageVolume(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-block-storage-volume`


---

## Other Operations

## <span data-label="GET" class="pill-GET"></span>list-block-storage-snapshots

List block storage snapshots

```
GET /block-storage-snapshot
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `block-storage-snapshots` | array of [Block storage snapshot](/reference/api/_schemas/block-storage-snapshot/) |  |

<details>
<summary>Example output</summary>

```json
{
  "block-storage-snapshots": [
    {
      "block-storage-volume": {
        "id": "string"
      },
      "created-at": "2024-01-01T12:00:00Z",
      "id": "string",
      "labels": {},
      "name": "string",
      "size": 0,
      "state": "partially-destroyed",
      "volume-size": 0
    }
  ]
}
```
</details>


SDK reference for `list-block-storage-snapshots`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListBlockStorageSnapshots) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_block_storage_snapshots) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listBlockStorageSnapshots())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-block-storage-snapshots`

## <span data-label="PUT" class="pill-PUT"></span>attach-block-storage-volume-to-instance

Attach block storage volume to an instance

```
PUT /block-storage/{id}:attach
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | [Target Instance](/reference/api/_schemas/instance-ref/) | **yes** | Instance to attach to, this can only be done if the volume is not currently attached |

<details>
<summary>Example</summary>

```json
{
  "instance": {
    "id": "string"
  }
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `attach-block-storage-volume-to-instance`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.AttachBlockStorageVolumeToInstance) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.attach_block_storage_volume_to_instance) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#attachBlockStorageVolumeToInstance(java.util.UUID,com.exoscale.sdk.model.AttachBlockStorageVolumeToInstanceRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api attach-block-storage-volume-to-instance`

## <span data-label="GET" class="pill-GET"></span>list-block-storage-volumes

List block storage volumes

```
GET /block-storage
```

### Query parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `instance-id` | `query` | no | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `block-storage-volumes` | array of [Block storage volume](/reference/api/_schemas/block-storage-volume/) |  |

<details>
<summary>Example output</summary>

```json
{
  "block-storage-volumes": [
    {
      "block-storage-snapshots": [
        {
          "id": "string"
        }
      ],
      "blocksize": 0,
      "created-at": "2024-01-01T12:00:00Z",
      "encrypted": true,
      "id": "string",
      "instance": {
        "id": "string"
      },
      "labels": {},
      "name": "string",
      "size": 0,
      "state": "snapshotting"
    }
  ]
}
```
</details>


SDK reference for `list-block-storage-volumes`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListBlockStorageVolumes) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_block_storage_volumes) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listBlockStorageVolumes(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-block-storage-volumes`


