Hanzo

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

MethodPathDescription
GET/v1/clustersList every cluster the org can see (managed + BYO)
POST/v1/clustersAttach an existing cluster by kubeconfig
DELETE/v1/clusters/{id}Detach a cluster
POST/v1/clusters/{clusterId}/poolsCreate a node pool
POST/v1/clusters/{clusterId}/pools/{poolId}/scaleScale a node pool
DELETE/v1/clusters/{clusterId}/pools/{poolId}Delete a node pool
GET/v1/k8s/clustersManaged-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.

How is this guide?

Last updated on

On this page