# Volumes

## List VM's Volumes

**get** `/v1/compute/vms/{vm_id}/volumes`

List VM's Volumes

### Path Parameters

- `vm_id: string`

### Query Parameters

- `cursor: optional string`

  Pagination cursor returned by a previous request. Only valid for the same VM, filters and sort order.

- `kind: optional "boot" or "data"`

  Filter by Volume kind

  - `"boot"`

  - `"data"`

- `limit: optional number`

  Maximum number of items to return

- `name: optional string`

  Filter by a case-insensitive substring of the Volume name

- `sort: optional string`

  Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status, size

- `status: optional "pending" or "creating" or "updating" or 3 more`

  Filter by Volume status

  - `"pending"`

  - `"creating"`

  - `"updating"`

  - `"ready"`

  - `"deleting"`

  - `"error"`

- `tags: optional array of string`

  Filter by tags. Repeat the parameter to require several tags; a Volume must carry all of them.

- `type: optional "nvme" or "abs"`

  Filter by storage type

  - `"nvme"`

  - `"abs"`

### Returns

- `VolumeList object { items, pagination }`

  - `items: array of Volume`

    - `id: string`

      Unique identifier for the Volume.

    - `created_at: string`

      When the Volume was created.

    - `kind: VolumeKind`

      Volume kind.

      - `"boot"`

      - `"data"`

    - `name: string`

      Name of the Volume.

    - `project_id: string`

      Project ID the Volume belongs to.

    - `region: RegionName`

      Region the resource is in.

      - `"us-sva-2"`

    - `size: number`

      Size of the Volume in GB.

    - `status: ResourceStatus`

      Status of the resource.

      - `"pending"`

      - `"creating"`

      - `"updating"`

      - `"ready"`

      - `"deleting"`

      - `"deleted"`

      - `"error"`

    - `tags: array of string`

      Tags to attach to the Volume.

    - `type: VolumeType`

      Type of the Volume.

      - `"nvme"`

      - `"abs"`

    - `updated_at: string`

      When the Volume was updated.

    - `vm_id: string`

      ID of the VM the Volume is attached to.

    - `vm_name: string`

      Name of the VM the Volume is attached to.

  - `pagination: Pagination`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Example

```http
curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/volumes \
    -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "kind": "boot",
      "name": "my-volume",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "us-sva-2",
      "size": 100,
      "status": "ready",
      "tags": [
        "production",
        "ethereum"
      ],
      "type": "abs",
      "updated_at": "2025-01-01T00:00:00Z",
      "vm_id": "123e4567-e89b-12d3-a456-426614174000",
      "vm_name": "my-vm"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
