List NKS Clusters
client.NKS.Clusters.List(ctx, query) (*Cursor[NKSCluster], error)
GET/v1/nks/clusters
List NKS Clusters
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)
}
{
"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
}
}Returns Examples
{
"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
}
}