# Volumes

## Create Volume

`$ nirvana compute:volumes create`

**post** `/v1/compute/volumes`

Create a Volume. Only data volumes can be created.

### Parameters

- `--name: string`

  Name of the Volume.

- `--project-id: string`

  Project ID the Volume belongs to.

- `--region: "us-sva-2"`

  Region the resource is in.

- `--size: number`

  Size of the Volume in GB.

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

  Type of the Volume.

- `--tag: optional array of string`

  Tags to attach to the Volume.

- `--vm-id: optional string`

  ID of the VM the Volume is attached to.

### Returns

- `operation: object { id, created_at, details, 6 more }`

  Operation details.

  - `id: string`

    Unique identifier for the Operation.

  - `created_at: string`

    When the Operation was created.

  - `details: object { changes }`

    Structured details about what an operation is changing.

    - `changes: map[OperationFieldDiff]`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `from: string or number or boolean or array of string`

        Previous value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

      - `to: string or number or boolean or array of string`

        New value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

  - `kind: "vm" or "volume" or "vpc" or 3 more`

    Kind of Operation.

    - `"vm"`

    - `"volume"`

    - `"vpc"`

    - `"firewall_rule"`

    - `"nks_cluster"`

    - `"nks_node_pool"`

  - `project_id: string`

    Project ID the Operation belongs to.

  - `resource_id: string`

    ID of the resource that the Operation is acting on.

  - `status: "pending" or "running" or "done" or 2 more`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: "create" or "update" or "delete" or "restart"`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```cli
nirvana compute:volumes create \
  --api-key 'My API Key' \
  --name my-data-volume \
  --project-id 123e4567-e89b-12d3-a456-426614174000 \
  --region us-sva-2 \
  --size 100 \
  --type abs
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Get Volume

`$ nirvana compute:volumes get`

**get** `/v1/compute/volumes/{volume_id}`

Get a Volume.

### Parameters

- `--volume-id: string`

  Volume ID

### Returns

- `volume: object { id, created_at, kind, 10 more }`

  Volume details.

  - `id: string`

    Unique identifier for the Volume.

  - `created_at: string`

    When the Volume was created.

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

    Volume kind.

    - `"boot"`

    - `"data"`

  - `name: string`

    Name of the Volume.

  - `project_id: string`

    Project ID the Volume belongs to.

  - `region: "us-sva-2"`

    Region the resource is in.

    - `"us-sva-2"`

  - `size: number`

    Size of the Volume in GB.

  - `status: "pending" or "creating" or "updating" or 4 more`

    Status of the resource.

    - `"pending"`

    - `"creating"`

    - `"updating"`

    - `"ready"`

    - `"deleting"`

    - `"deleted"`

    - `"error"`

  - `tags: array of string`

    Tags to attach to the Volume.

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

    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.

### Example

```cli
nirvana compute:volumes get \
  --api-key 'My API Key' \
  --volume-id volume_id
```

#### Response

```json
{
  "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"
}
```

## Update Volume

`$ nirvana compute:volumes update`

**patch** `/v1/compute/volumes/{volume_id}`

Update a Volume. Boot or data volumes can be updated.

### Parameters

- `--volume-id: string`

  Volume ID

- `--name: optional string`

  Name of the Volume.

- `--size: optional number`

  Size of the Volume in GB.

- `--tag: optional array of string`

  Tags to attach to the Volume.

### Returns

- `operation: object { id, created_at, details, 6 more }`

  Operation details.

  - `id: string`

    Unique identifier for the Operation.

  - `created_at: string`

    When the Operation was created.

  - `details: object { changes }`

    Structured details about what an operation is changing.

    - `changes: map[OperationFieldDiff]`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `from: string or number or boolean or array of string`

        Previous value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

      - `to: string or number or boolean or array of string`

        New value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

  - `kind: "vm" or "volume" or "vpc" or 3 more`

    Kind of Operation.

    - `"vm"`

    - `"volume"`

    - `"vpc"`

    - `"firewall_rule"`

    - `"nks_cluster"`

    - `"nks_node_pool"`

  - `project_id: string`

    Project ID the Operation belongs to.

  - `resource_id: string`

    ID of the resource that the Operation is acting on.

  - `status: "pending" or "running" or "done" or 2 more`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: "create" or "update" or "delete" or "restart"`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```cli
nirvana compute:volumes update \
  --api-key 'My API Key' \
  --volume-id volume_id
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete Volume

`$ nirvana compute:volumes delete`

**delete** `/v1/compute/volumes/{volume_id}`

Delete a Volume. Boot or data volumes can be deleted.

### Parameters

- `--volume-id: string`

  Volume ID

### Returns

- `operation: object { id, created_at, details, 6 more }`

  Operation details.

  - `id: string`

    Unique identifier for the Operation.

  - `created_at: string`

    When the Operation was created.

  - `details: object { changes }`

    Structured details about what an operation is changing.

    - `changes: map[OperationFieldDiff]`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `from: string or number or boolean or array of string`

        Previous value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

      - `to: string or number or boolean or array of string`

        New value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

  - `kind: "vm" or "volume" or "vpc" or 3 more`

    Kind of Operation.

    - `"vm"`

    - `"volume"`

    - `"vpc"`

    - `"firewall_rule"`

    - `"nks_cluster"`

    - `"nks_node_pool"`

  - `project_id: string`

    Project ID the Operation belongs to.

  - `resource_id: string`

    ID of the resource that the Operation is acting on.

  - `status: "pending" or "running" or "done" or 2 more`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: "create" or "update" or "delete" or "restart"`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```cli
nirvana compute:volumes delete \
  --api-key 'My API Key' \
  --volume-id volume_id
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## List Volumes

`$ nirvana compute:volumes list`

**get** `/v1/compute/volumes`

List all volumes

### Parameters

- `--project-id: string`

  Project ID of resources to request

- `--cursor: optional string`

  Pagination cursor returned by a previous request

- `--limit: optional number`

  Maximum number of items to return

### Returns

- `volume_list: object { items, pagination }`

  - `items: array of Volume`

    - `id: string`

      Unique identifier for the Volume.

    - `created_at: string`

      When the Volume was created.

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

      Volume kind.

      - `"boot"`

      - `"data"`

    - `name: string`

      Name of the Volume.

    - `project_id: string`

      Project ID the Volume belongs to.

    - `region: "us-sva-2"`

      Region the resource is in.

      - `"us-sva-2"`

    - `size: number`

      Size of the Volume in GB.

    - `status: "pending" or "creating" or "updating" or 4 more`

      Status of the resource.

      - `"pending"`

      - `"creating"`

      - `"updating"`

      - `"ready"`

      - `"deleting"`

      - `"deleted"`

      - `"error"`

    - `tags: array of string`

      Tags to attach to the Volume.

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

      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: object { next_cursor, previous_cursor, total_count }`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Example

```cli
nirvana compute:volumes list \
  --api-key 'My API Key' \
  --project-id project_id
```

#### 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
  }
}
```

## Attach Volume

`$ nirvana compute:volumes attach`

**post** `/v1/compute/volumes/{volume_id}/attach`

Attach a volume to a VM

### Parameters

- `--volume-id: string`

  Volume ID

- `--vm-id: string`

  ID of the VM to attach the Volume to.

### Returns

- `operation: object { id, created_at, details, 6 more }`

  Operation details.

  - `id: string`

    Unique identifier for the Operation.

  - `created_at: string`

    When the Operation was created.

  - `details: object { changes }`

    Structured details about what an operation is changing.

    - `changes: map[OperationFieldDiff]`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `from: string or number or boolean or array of string`

        Previous value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

      - `to: string or number or boolean or array of string`

        New value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

  - `kind: "vm" or "volume" or "vpc" or 3 more`

    Kind of Operation.

    - `"vm"`

    - `"volume"`

    - `"vpc"`

    - `"firewall_rule"`

    - `"nks_cluster"`

    - `"nks_node_pool"`

  - `project_id: string`

    Project ID the Operation belongs to.

  - `resource_id: string`

    ID of the resource that the Operation is acting on.

  - `status: "pending" or "running" or "done" or 2 more`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: "create" or "update" or "delete" or "restart"`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```cli
nirvana compute:volumes attach \
  --api-key 'My API Key' \
  --volume-id volume_id \
  --vm-id 123e4567-e89b-12d3-a456-426614174000
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Detach Volume

`$ nirvana compute:volumes detach`

**post** `/v1/compute/volumes/{volume_id}/detach`

Detach a volume from a VM

### Parameters

- `--volume-id: string`

  Volume ID

### Returns

- `operation: object { id, created_at, details, 6 more }`

  Operation details.

  - `id: string`

    Unique identifier for the Operation.

  - `created_at: string`

    When the Operation was created.

  - `details: object { changes }`

    Structured details about what an operation is changing.

    - `changes: map[OperationFieldDiff]`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `from: string or number or boolean or array of string`

        Previous value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

      - `to: string or number or boolean or array of string`

        New value.

        - `union_member_0: string`

        - `union_member_1: number`

        - `union_member_2: boolean`

        - `union_member_3: array of string`

  - `kind: "vm" or "volume" or "vpc" or 3 more`

    Kind of Operation.

    - `"vm"`

    - `"volume"`

    - `"vpc"`

    - `"firewall_rule"`

    - `"nks_cluster"`

    - `"nks_node_pool"`

  - `project_id: string`

    Project ID the Operation belongs to.

  - `resource_id: string`

    ID of the resource that the Operation is acting on.

  - `status: "pending" or "running" or "done" or 2 more`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: "create" or "update" or "delete" or "restart"`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```cli
nirvana compute:volumes detach \
  --api-key 'My API Key' \
  --volume-id volume_id
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Domain Types

### Volume

- `volume: object { id, created_at, kind, 10 more }`

  Volume details.

  - `id: string`

    Unique identifier for the Volume.

  - `created_at: string`

    When the Volume was created.

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

    Volume kind.

    - `"boot"`

    - `"data"`

  - `name: string`

    Name of the Volume.

  - `project_id: string`

    Project ID the Volume belongs to.

  - `region: "us-sva-2"`

    Region the resource is in.

    - `"us-sva-2"`

  - `size: number`

    Size of the Volume in GB.

  - `status: "pending" or "creating" or "updating" or 4 more`

    Status of the resource.

    - `"pending"`

    - `"creating"`

    - `"updating"`

    - `"ready"`

    - `"deleting"`

    - `"deleted"`

    - `"error"`

  - `tags: array of string`

    Tags to attach to the Volume.

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

    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.

### Volume Kind

- `volume_kind: "boot" or "data"`

  Volume kind.

  - `"boot"`

  - `"data"`

### Volume List

- `volume_list: object { items, pagination }`

  - `items: array of Volume`

    - `id: string`

      Unique identifier for the Volume.

    - `created_at: string`

      When the Volume was created.

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

      Volume kind.

      - `"boot"`

      - `"data"`

    - `name: string`

      Name of the Volume.

    - `project_id: string`

      Project ID the Volume belongs to.

    - `region: "us-sva-2"`

      Region the resource is in.

      - `"us-sva-2"`

    - `size: number`

      Size of the Volume in GB.

    - `status: "pending" or "creating" or "updating" or 4 more`

      Status of the resource.

      - `"pending"`

      - `"creating"`

      - `"updating"`

      - `"ready"`

      - `"deleting"`

      - `"deleted"`

      - `"error"`

    - `tags: array of string`

      Tags to attach to the Volume.

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

      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: object { next_cursor, previous_cursor, total_count }`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Volume Type

- `volume_type: "nvme" or "abs"`

  Type of the Volume.

  - `"nvme"`

  - `"abs"`

# Availability

## Check Volume Create Availability

`$ nirvana compute:volumes:availability create`

**post** `/v1/compute/volumes/availability`

Check Volume Create Availability

### Parameters

- `--name: string`

  Name of the Volume.

- `--project-id: string`

  Project ID the Volume belongs to.

- `--region: "us-sva-2"`

  Region the resource is in.

- `--size: number`

  Size of the Volume in GB.

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

  Type of the Volume.

- `--tag: optional array of string`

  Tags to attach to the Volume.

- `--vm-id: optional string`

  ID of the VM the Volume is attached to.

### Example

```cli
nirvana compute:volumes:availability create \
  --api-key 'My API Key' \
  --name my-data-volume \
  --project-id 123e4567-e89b-12d3-a456-426614174000 \
  --region us-sva-2 \
  --size 100 \
  --type abs
```

## Check Volume Update Availability

`$ nirvana compute:volumes:availability update`

**patch** `/v1/compute/volumes/{volume_id}/availability`

Check Volume Update Availability

### Parameters

- `--volume-id: string`

  Volume ID

- `--name: optional string`

  Name of the Volume.

- `--size: optional number`

  Size of the Volume in GB.

- `--tag: optional array of string`

  Tags to attach to the Volume.

### Example

```cli
nirvana compute:volumes:availability update \
  --api-key 'My API Key' \
  --volume-id volume_id
```
