OpenapiVisor
Adds a node pool to one of the caller org's clusters and answers 201 with the…
Adds a node pool to one of the caller org's clusters and answers 201 with the created pool.
POST /v1/visor/clusters/{clusterId}/pools
| Address | https://api.hanzo.ai/v1/visor/clusters/{clusterId}/pools |
| Method | POST |
| Operation | createNodePool |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Adds a node pool to one of the caller org's clusters and answers 201 with the created pool. Only the CreateNodePoolSpec fields are forwarded; owner/provider/clusterId ride in the query exactly as Visor expects them.
Request
9 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
clusterId | path | string | yes | ClusterID is the cluster to add the pool to, from the URL path. |
autoScale | body | boolean | — | AutoScale turns the provider's cluster autoscaler on for this pool. |
clusterId | body | string | — | ClusterID is the cluster to add the pool to, from the URL path. |
count | body | integer | — | Count is how many nodes the pool starts with. |
maxNodes | body | integer | — | MaxNodes is the ceiling the autoscaler may not grow the pool past, and so the bound on what this pool can spend. |
minNodes | body | integer | — | MinNodes is the floor the autoscaler may not shrink the pool below. |
name | body | string | — | Name is the pool's name. |
provider | body | string | — | Provider is the cloud the cluster lives on (e.g. |
size | body | string | — | Size is the provider size slug for each node (e.g. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | nodePoolView | ok |
200 body — 7 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
autoScale | body | boolean | — | AutoScale reports whether the provider's cluster autoscaler owns this pool's size, moving Count between MinNodes and MaxNodes as workloads demand. |
count | body | integer | — | Count is how many nodes the pool has right now. |
maxNodes | body | integer | — | MaxNodes is the ceiling the autoscaler will not grow the pool past, and so the bound on what this pool can cost. |
minNodes | body | integer | — | MinNodes is the floor the autoscaler will not shrink the pool below. |
name | body | string | — | Name is the pool's name as the provider knows it. |
poolId | body | string | — | PoolID is the provider's id for the pool — the value the scale and delete routes address it by. |
size | body | string | — | Size is the provider size slug every node in the pool runs at ("s-4vcpu-8gb", "gpu-h100x8-640gb"). |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, VisorApi } from 'hanzoai';
const api = new VisorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.createNodePool({ clusterId: 'clusterId', autoScale: false, clusterId: "<clusterId>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import VisorApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = VisorApi(client).create_node_pool(cluster_id='clusterId', auto_scale=False, cluster_id="<clusterId>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.VisorAPI.CreateNodePool(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, visor_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = visor_api::create_node_pool(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.VisorApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new VisorApi(client).createNodePool();curl -X POST https://api.hanzo.ai/v1/visor/clusters/<clusterId>/pools \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"autoScale": false,
"clusterId": "<clusterId>"
}'Tool visor, op createNodePool — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "visor",
"arguments": {
"op": "createNodePool",
"input": {
"clusterId": "<clusterId>",
"autoScale": false
}
}
}
}'How is this guide?