## List Sandbox Clusters

`client.SandboxClusters.List(ctx, query) (*Cursor[SandboxCluster], error)`

**get** `/v1/sandbox_clusters`

List the Sandbox Clusters in a project

### Parameters

- `query SandboxClusterListParams`

  - `ProjectID param.Field[string]`

    Project ID of resources to request

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request. Only valid for the same sort order.

  - `Limit param.Field[int64]`

    Maximum number of items to return

  - `Name param.Field[string]`

    Filter by a case-insensitive substring of the Sandbox Cluster name

  - `Region param.Field[string]`

    Filter by region

  - `Sort param.Field[string]`

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

  - `Tags param.Field[[]string]`

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

### Returns

- `type SandboxCluster struct{…}`

  A cluster sandboxes run on, in one region.

  - `ID string`

    Unique identifier for the Sandbox Cluster.

  - `CreatedAt Time`

    When the Sandbox Cluster was created.

  - `GatewayHostname string`

    Hostname sandboxes' endpoints are served on over HTTPS, to allow in outbound firewalls. Null until assigned; a recreated Sandbox Cluster gets a new one.

  - `InstanceType string`

    Instance type of the nodes the sandboxes run on.

  - `Name string`

    Name of the Sandbox Cluster.

  - `NodeCount int64`

    Number of nodes the sandboxes run on.

  - `ProjectID string`

    ID of the project the Sandbox Cluster is in.

  - `Region RegionName`

    Region the resource is in.

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

    - `const RegionNameUsWdc1 RegionName = "us-wdc-1"`

  - `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"`

    - `const ResourceStatusSuspended ResourceStatus = "suspended"`

  - `Tags []string`

    Tags attached to the Sandbox Cluster.

  - `UpdatedAt Time`

    When the Sandbox Cluster was last updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.SandboxClusters.List(context.TODO(), sandbox_clusters.SandboxClusterListParams{
    ProjectID: "project_id",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "gateway_hostname": "gw.0123456789ab.example.com",
      "instance_type": "n1-standard-8",
      "name": "my-sandboxes",
      "node_count": 3,
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "us-sva-2",
      "status": "ready",
      "tags": [
        "production",
        "agents"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
