Get Volume
client.Compute.Volumes.Get(ctx, volumeID) (*Volume, error)
GET/v1/compute/volumes/{volume_id}
Get Volume
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)
}
{
"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"
}Returns Examples
{
"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"
}