## List NKS Clusters

`client.NKS.Clusters.List(ctx, query) (*Cursor[NKSCluster], error)`

**get** `/v1/nks/clusters`

List all NKS clusters

### Parameters

- `query ClusterListParams`

  - `ProjectID param.Field[string]`

    Project ID of resources to request

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type NKSCluster struct{…}`

  NKS Cluster details.

  - `ID string`

    Unique identifier for the Cluster.

  - `Autoscaling bool`

    Whether autoscaling is enabled for the Cluster.

  - `CreatedAt Time`

    When the Cluster was created.

  - `KubernetesVersion string`

    Kubernetes version of the Cluster.

  - `Name string`

    Name of the Cluster.

  - `PoolIDs []string`

    IDs of pools belonging to this Cluster.

  - `PrivateIP string`

    Private IP (VIP) of the Cluster.

  - `ProjectID string`

    Project ID the Cluster belongs to.

  - `PublicIP string`

    Public IP of the Cluster.

  - `Region RegionName`

    Region the resource is in.

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

  - `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 attached to the Cluster.

  - `UpdatedAt Time`

    When the Cluster was last updated.

  - `VPCID string`

    ID of the VPC the Cluster is in.

### Example

```go
package main

import (
  "context"
  "fmt"

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

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

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "autoscaling": true,
      "created_at": "2025-01-01T00:00:00Z",
      "kubernetes_version": "v1.34.4",
      "name": "my-cluster",
      "pool_ids": [
        "123e4567-e89b-12d3-a456-426614174000"
      ],
      "private_ip": "10.0.0.254",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "public_ip": "198.51.100.1",
      "region": "us-sva-2",
      "status": "ready",
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z",
      "vpc_id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
