## Get Volume

`client.Compute.Volumes.Get(ctx, volumeID) (*Volume, error)`

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

Get a Volume.

### Parameters

- `volumeID string`

### Returns

- `type Volume struct{…}`

  Volume details.

  - `ID string`

    Unique identifier for the Volume.

  - `CreatedAt Time`

    When the Volume was created.

  - `Kind VolumeKind`

    Volume kind.

    - `const VolumeKindBoot VolumeKind = "boot"`

    - `const VolumeKindData VolumeKind = "data"`

  - `Name string`

    Name of the Volume.

  - `ProjectID string`

    Project ID the Volume belongs to.

  - `Region RegionName`

    Region the resource is in.

    - `const RegionNameUsSva2 RegionName = "us-sva-2"`

  - `Size int64`

    Size of the Volume in GB.

  - `Status ResourceStatus`

    Status of the resource.

    - `const ResourceStatusPending ResourceStatus = "pending"`

    - `const ResourceStatusCreating ResourceStatus = "creating"`

    - `const ResourceStatusUpdating ResourceStatus = "updating"`

    - `const ResourceStatusReady ResourceStatus = "ready"`

    - `const ResourceStatusDeleting ResourceStatus = "deleting"`

    - `const ResourceStatusDeleted ResourceStatus = "deleted"`

    - `const ResourceStatusError ResourceStatus = "error"`

  - `Tags []string`

    Tags to attach to the Volume.

  - `Type VolumeType`

    Type of the Volume.

    - `const VolumeTypeNvme VolumeType = "nvme"`

    - `const VolumeTypeABS VolumeType = "abs"`

  - `UpdatedAt Time`

    When the Volume was updated.

  - `VMID string`

    ID of the VM the Volume is attached to.

  - `VMName string`

    Name of the VM the Volume is attached to.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  volume, err := client.Compute.Volumes.Get(context.TODO(), "volume_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
}
```
