Clusters API
List, attach, scale, and detach Kubernetes clusters through api.hanzo.ai/v1.
Clusters are a top-level noun on the one Hanzo API host. Managed clusters (Visor-provisioned DOKS/AWS/…) and bring-your-own clusters attached with a kubeconfig surface together.
All calls take an IAM bearer — see Authentication.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/clusters | List every cluster the org can see (managed + BYO) |
POST | /v1/clusters | Attach an existing cluster by kubeconfig |
DELETE | /v1/clusters/{id} | Detach a cluster |
POST | /v1/clusters/{clusterId}/pools | Create a node pool |
POST | /v1/clusters/{clusterId}/pools/{poolId}/scale | Scale a node pool |
DELETE | /v1/clusters/{clusterId}/pools/{poolId} | Delete a node pool |
GET | /v1/k8s/clusters | Managed-cluster lifecycle view (DOKS detail + nodes) |
Reads are org-scoped; create and delete are admin-gated, because they spend real infrastructure budget.
List clusters
curl -fsS https://api.hanzo.ai/v1/clusters \
-H "Authorization: Bearer $TOKEN"{ "clusters": [] }Attach a cluster
curl -fsS -X POST https://api.hanzo.ai/v1/clusters \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "prod", "kubeconfig": "'"$(base64 < ~/.kube/config)"'" }'Scale a node pool
curl -fsS -X POST \
"https://api.hanzo.ai/v1/clusters/$CLUSTER_ID/pools/$POOL_ID/scale" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "count": 5 }'Detach a cluster
curl -fsS -X DELETE "https://api.hanzo.ai/v1/clusters/$CLUSTER_ID" \
-H "Authorization: Bearer $TOKEN"Detaching removes Hanzo's handle on the cluster; it does not destroy a BYO cluster you brought in.
Related
- Machines API — individual compute units and GPUs
- Containers API — the workloads that run on these clusters
How is this guide?
Last updated on