# VMs

## Create VM

**post** `/v1/compute/vms`

Create a VM

### Body Parameters

- `boot_volume: object { size, type, tags }`

  Boot volume for the VM.

  - `size: number`

    Size of the Volume in GB.

  - `type: VolumeType`

    Type of the Volume.

    - `"nvme"`

    - `"abs"`

  - `tags: optional array of string`

    Tags to attach to the Volume.

- `instance_type: string`

  Instance type name.

- `name: string`

  Name of the VM.

- `os_image_name: string`

  Name of the OS Image to use for the VM.

- `project_id: string`

  Project ID to create the VM in.

- `public_ip_enabled: boolean`

  Whether to enable public IP for the VM.

- `region: RegionName`

  Region the resource is in.

  - `"us-sva-2"`

- `ssh_key: SSHKeyRequest`

  Public SSH key configuration for the VM.

  - `public_key: string`

    Public key to and use to access the VM.

- `subnet_id: string`

  ID of the subnet to use for the VM.

- `data_volumes: optional array of object { name, size, type, tags }`

  Data volumes for the VM.

  - `name: string`

    Name of the Volume.

  - `size: number`

    Size of the Volume in GB.

  - `type: VolumeType`

    Type of the Volume.

  - `tags: optional array of string`

    Tags to attach to the Volume.

- `tags: optional array of string`

  Tags to attach to the VM.

### 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: OperationDetails`

    Structured details about what an operation is changing.

    - `changes: OperationChanges`

      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.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

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

        New value.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

  - `kind: OperationKind`

    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: OperationStatus`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: OperationType`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```http
curl https://api.nirvanalabs.io/v1/compute/vms \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \
    -d '{
          "boot_volume": {
            "size": 100,
            "type": "abs"
          },
          "instance_type": "n1-standard-8",
          "name": "my-vm",
          "os_image_name": "ubuntu-noble-2025-10-01",
          "project_id": "123e4567-e89b-12d3-a456-426614174000",
          "public_ip_enabled": true,
          "region": "us-sva-2",
          "ssh_key": {
            "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"
          },
          "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
          "tags": [
            "production",
            "ethereum"
          ]
        }'
```

#### 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 VM Details

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

Get details about a VM

### Path Parameters

- `vm_id: string`

### Returns

- `VM object { id, boot_volume_id, cpu_config, 16 more }`

  VM details.

  - `id: string`

    Unique identifier for the VM.

  - `boot_volume_id: string`

    ID of the boot volume attached to the VM.

  - `cpu_config: CPUConfig`

    CPU configuration for the VM.

    - `vcpu: number`

      Number of virtual CPUs.

  - `created_at: string`

    When the VM was created.

  - `data_volume_ids: array of string`

    IDs of the data volumes attached to the VM.

  - `memory_config: MemoryConfig`

    Memory configuration for the VM.

    - `size: number`

      Size of the memory in GB.

  - `name: string`

    Name of the VM.

  - `private_ip: string`

    Private IP of the VM.

  - `project_id: string`

    Project ID the VM belongs to.

  - `public_ip: string`

    Public IP of the VM.

  - `public_ip_enabled: boolean`

    Whether the public IP is enabled for the VM.

  - `region: RegionName`

    Region the resource is in.

    - `"us-sva-2"`

  - `status: ResourceStatus`

    Status of the resource.

    - `"pending"`

    - `"creating"`

    - `"updating"`

    - `"ready"`

    - `"deleting"`

    - `"deleted"`

    - `"error"`

  - `subnet_id: string`

    ID of the subnet the VM is in.

  - `tags: array of string`

    Tags to attach to the VM.

  - `updated_at: string`

    When the VM was updated.

  - `vpc_id: string`

    ID of the VPC the VM is in.

  - `vpc_name: string`

    Name of the VPC the VM is in.

  - `instance_type: optional string`

    Instance type name.

### Example

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

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "boot_volume_id": "123e4567-e89b-12d3-a456-426614174000",
  "cpu_config": {
    "vcpu": 2
  },
  "created_at": "2025-01-01T00:00:00Z",
  "data_volume_ids": [
    "123e4567-e89b-12d3-a456-426614174001",
    "123e4567-e89b-12d3-a456-426614174002"
  ],
  "memory_config": {
    "size": 2
  },
  "name": "my-vm",
  "private_ip": "10.0.0.1",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "public_ip": "123.123.123.123",
  "public_ip_enabled": true,
  "region": "us-sva-2",
  "status": "ready",
  "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z",
  "vpc_id": "123e4567-e89b-12d3-a456-426614174000",
  "vpc_name": "my-vpc",
  "instance_type": "n1-standard-8"
}
```

## Update VM

**patch** `/v1/compute/vms/{vm_id}`

Update a VM

### Path Parameters

- `vm_id: string`

### Body Parameters

- `instance_type: optional string`

  Instance type name.

- `name: optional string`

  Name of the VM.

- `public_ip_enabled: optional boolean`

  Whether to enable public IP for the VM.

- `tags: optional array of string`

  Tags to attach to the VM.

### 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: OperationDetails`

    Structured details about what an operation is changing.

    - `changes: OperationChanges`

      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.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

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

        New value.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

  - `kind: OperationKind`

    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: OperationStatus`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: OperationType`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

```http
curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \
    -d '{
          "instance_type": "n1-standard-8",
          "name": "my-vm",
          "public_ip_enabled": true,
          "tags": [
            "production",
            "ethereum"
          ]
        }'
```

#### 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 VM

**delete** `/v1/compute/vms/{vm_id}`

Delete a VM

### Path Parameters

- `vm_id: string`

### 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: OperationDetails`

    Structured details about what an operation is changing.

    - `changes: OperationChanges`

      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.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

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

        New value.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

  - `kind: OperationKind`

    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: OperationStatus`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: OperationType`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

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

#### 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 VMs

**get** `/v1/compute/vms`

List all VMs

### Query 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

- `VMList object { items, pagination }`

  - `items: array of VM`

    - `id: string`

      Unique identifier for the VM.

    - `boot_volume_id: string`

      ID of the boot volume attached to the VM.

    - `cpu_config: CPUConfig`

      CPU configuration for the VM.

      - `vcpu: number`

        Number of virtual CPUs.

    - `created_at: string`

      When the VM was created.

    - `data_volume_ids: array of string`

      IDs of the data volumes attached to the VM.

    - `memory_config: MemoryConfig`

      Memory configuration for the VM.

      - `size: number`

        Size of the memory in GB.

    - `name: string`

      Name of the VM.

    - `private_ip: string`

      Private IP of the VM.

    - `project_id: string`

      Project ID the VM belongs to.

    - `public_ip: string`

      Public IP of the VM.

    - `public_ip_enabled: boolean`

      Whether the public IP is enabled for the VM.

    - `region: RegionName`

      Region the resource is in.

      - `"us-sva-2"`

    - `status: ResourceStatus`

      Status of the resource.

      - `"pending"`

      - `"creating"`

      - `"updating"`

      - `"ready"`

      - `"deleting"`

      - `"deleted"`

      - `"error"`

    - `subnet_id: string`

      ID of the subnet the VM is in.

    - `tags: array of string`

      Tags to attach to the VM.

    - `updated_at: string`

      When the VM was updated.

    - `vpc_id: string`

      ID of the VPC the VM is in.

    - `vpc_name: string`

      Name of the VPC the VM is in.

    - `instance_type: optional string`

      Instance type name.

  - `pagination: Pagination`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Example

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

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "boot_volume_id": "123e4567-e89b-12d3-a456-426614174000",
      "cpu_config": {
        "vcpu": 2
      },
      "created_at": "2025-01-01T00:00:00Z",
      "data_volume_ids": [
        "123e4567-e89b-12d3-a456-426614174001",
        "123e4567-e89b-12d3-a456-426614174002"
      ],
      "memory_config": {
        "size": 2
      },
      "name": "my-vm",
      "private_ip": "10.0.0.1",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "public_ip": "123.123.123.123",
      "public_ip_enabled": true,
      "region": "us-sva-2",
      "status": "ready",
      "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z",
      "vpc_id": "123e4567-e89b-12d3-a456-426614174000",
      "vpc_name": "my-vpc",
      "instance_type": "n1-standard-8"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Restart VM

**post** `/v1/compute/vms/{vm_id}/restart`

Restart a VM

### Path Parameters

- `vm_id: string`

### 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: OperationDetails`

    Structured details about what an operation is changing.

    - `changes: OperationChanges`

      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.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

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

        New value.

        - `string`

        - `number`

        - `boolean`

        - `array of string`

  - `kind: OperationKind`

    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: OperationStatus`

    Status of the Operation.

    - `"pending"`

    - `"running"`

    - `"done"`

    - `"failed"`

    - `"unknown"`

  - `type: OperationType`

    Type of Operation.

    - `"create"`

    - `"update"`

    - `"delete"`

    - `"restart"`

  - `updated_at: string`

    When the Operation was updated.

### Example

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

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

### CPU Config

- `CPUConfig object { vcpu }`

  CPU configuration for the VM.

  - `vcpu: number`

    Number of virtual CPUs.

### Memory Config

- `MemoryConfig object { size }`

  Memory configuration for the VM.

  - `size: number`

    Size of the memory in GB.

### OS Image

- `OSImage object { created_at, display_name, name }`

  OS Image details.

  - `created_at: string`

    When the OS Image was created.

  - `display_name: string`

    Display name of the OS Image.

  - `name: string`

    Name of the OS Image.

### SSH Key Request

- `SSHKeyRequest object { public_key }`

  Public SSH key configuration for the VM.

  - `public_key: string`

    Public key to and use to access the VM.

### VM

- `VM object { id, boot_volume_id, cpu_config, 16 more }`

  VM details.

  - `id: string`

    Unique identifier for the VM.

  - `boot_volume_id: string`

    ID of the boot volume attached to the VM.

  - `cpu_config: CPUConfig`

    CPU configuration for the VM.

    - `vcpu: number`

      Number of virtual CPUs.

  - `created_at: string`

    When the VM was created.

  - `data_volume_ids: array of string`

    IDs of the data volumes attached to the VM.

  - `memory_config: MemoryConfig`

    Memory configuration for the VM.

    - `size: number`

      Size of the memory in GB.

  - `name: string`

    Name of the VM.

  - `private_ip: string`

    Private IP of the VM.

  - `project_id: string`

    Project ID the VM belongs to.

  - `public_ip: string`

    Public IP of the VM.

  - `public_ip_enabled: boolean`

    Whether the public IP is enabled for the VM.

  - `region: RegionName`

    Region the resource is in.

    - `"us-sva-2"`

  - `status: ResourceStatus`

    Status of the resource.

    - `"pending"`

    - `"creating"`

    - `"updating"`

    - `"ready"`

    - `"deleting"`

    - `"deleted"`

    - `"error"`

  - `subnet_id: string`

    ID of the subnet the VM is in.

  - `tags: array of string`

    Tags to attach to the VM.

  - `updated_at: string`

    When the VM was updated.

  - `vpc_id: string`

    ID of the VPC the VM is in.

  - `vpc_name: string`

    Name of the VPC the VM is in.

  - `instance_type: optional string`

    Instance type name.

### VM List

- `VMList object { items, pagination }`

  - `items: array of VM`

    - `id: string`

      Unique identifier for the VM.

    - `boot_volume_id: string`

      ID of the boot volume attached to the VM.

    - `cpu_config: CPUConfig`

      CPU configuration for the VM.

      - `vcpu: number`

        Number of virtual CPUs.

    - `created_at: string`

      When the VM was created.

    - `data_volume_ids: array of string`

      IDs of the data volumes attached to the VM.

    - `memory_config: MemoryConfig`

      Memory configuration for the VM.

      - `size: number`

        Size of the memory in GB.

    - `name: string`

      Name of the VM.

    - `private_ip: string`

      Private IP of the VM.

    - `project_id: string`

      Project ID the VM belongs to.

    - `public_ip: string`

      Public IP of the VM.

    - `public_ip_enabled: boolean`

      Whether the public IP is enabled for the VM.

    - `region: RegionName`

      Region the resource is in.

      - `"us-sva-2"`

    - `status: ResourceStatus`

      Status of the resource.

      - `"pending"`

      - `"creating"`

      - `"updating"`

      - `"ready"`

      - `"deleting"`

      - `"deleted"`

      - `"error"`

    - `subnet_id: string`

      ID of the subnet the VM is in.

    - `tags: array of string`

      Tags to attach to the VM.

    - `updated_at: string`

      When the VM was updated.

    - `vpc_id: string`

      ID of the VPC the VM is in.

    - `vpc_name: string`

      Name of the VPC the VM is in.

    - `instance_type: optional string`

      Instance type name.

  - `pagination: Pagination`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

# Availability

## Check VM Create Availability

**post** `/v1/compute/vms/availability`

Check VM Create Availability

### Body Parameters

- `boot_volume: object { size, type, tags }`

  Boot volume for the VM.

  - `size: number`

    Size of the Volume in GB.

  - `type: VolumeType`

    Type of the Volume.

    - `"nvme"`

    - `"abs"`

  - `tags: optional array of string`

    Tags to attach to the Volume.

- `instance_type: string`

  Instance type name.

- `name: string`

  Name of the VM.

- `os_image_name: string`

  Name of the OS Image to use for the VM.

- `project_id: string`

  Project ID to create the VM in.

- `public_ip_enabled: boolean`

  Whether to enable public IP for the VM.

- `region: RegionName`

  Region the resource is in.

  - `"us-sva-2"`

- `ssh_key: SSHKeyRequest`

  Public SSH key configuration for the VM.

  - `public_key: string`

    Public key to and use to access the VM.

- `subnet_id: string`

  ID of the subnet to use for the VM.

- `data_volumes: optional array of object { name, size, type, tags }`

  Data volumes for the VM.

  - `name: string`

    Name of the Volume.

  - `size: number`

    Size of the Volume in GB.

  - `type: VolumeType`

    Type of the Volume.

  - `tags: optional array of string`

    Tags to attach to the Volume.

- `tags: optional array of string`

  Tags to attach to the VM.

### Example

```http
curl https://api.nirvanalabs.io/v1/compute/vms/availability \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \
    -d '{
          "boot_volume": {
            "size": 100,
            "type": "abs"
          },
          "instance_type": "n1-standard-8",
          "name": "my-vm",
          "os_image_name": "ubuntu-noble-2025-10-01",
          "project_id": "123e4567-e89b-12d3-a456-426614174000",
          "public_ip_enabled": true,
          "region": "us-sva-2",
          "ssh_key": {
            "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"
          },
          "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
          "tags": [
            "production",
            "ethereum"
          ]
        }'
```

## Check VM Update Availability

**patch** `/v1/compute/vms/{vm_id}/availability`

Check VM Update Availability

### Path Parameters

- `vm_id: string`

### Body Parameters

- `instance_type: optional string`

  Instance type name.

- `name: optional string`

  Name of the VM.

- `public_ip_enabled: optional boolean`

  Whether to enable public IP for the VM.

- `tags: optional array of string`

  Tags to attach to the VM.

### Example

```http
curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/availability \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \
    -d '{
          "instance_type": "n1-standard-8",
          "name": "my-vm",
          "public_ip_enabled": true,
          "tags": [
            "production",
            "ethereum"
          ]
        }'
```

# 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

- `limit: optional number`

  Maximum number of items to return

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

# OS Images

## List OS Images

**get** `/v1/compute/vms/os_images`

List all OS Images

### Query Parameters

- `cursor: optional string`

  Pagination cursor returned by a previous request

- `limit: optional number`

  Maximum number of items to return

### Returns

- `items: array of OSImage`

  - `created_at: string`

    When the OS Image was created.

  - `display_name: string`

    Display name of the OS Image.

  - `name: string`

    Name of the OS Image.

- `pagination: Pagination`

  Pagination response details.

  - `next_cursor: string`

  - `previous_cursor: string`

  - `total_count: number`

### Example

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

#### Response

```json
{
  "items": [
    {
      "created_at": "2025-01-01T00:00:00Z",
      "display_name": "Ubuntu 24.04 (Noble)",
      "name": "ubuntu-noble-2025-10-01"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
