OpenapiVisor
Resizes a node pool to an absolute node count and returns the pool as Visor…
Resizes a node pool to an absolute node count and returns the pool as Visor reports it after the change.
POST /v1/visor/clusters/{clusterId}/pools/{poolId}/scale
| Address | https://api.hanzo.ai/v1/visor/clusters/{clusterId}/pools/{poolId}/scale |
| Method | POST |
| Operation | scaleNodePool |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Resizes a node pool to an absolute node count and returns the pool as Visor reports it after the change.
Request
6 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
clusterId | path | string | yes | ClusterID is the cluster holding the pool, from the URL path. |
poolId | path | string | yes | PoolID is the pool to resize, from the URL path — the poolId a cluster read reports for it. |
clusterId | body | string | — | ClusterID is the cluster holding the pool, from the URL path. |
count | body | integer | — | Count is the node count to scale TO — an absolute target, not a delta, and never negative. |
poolId | body | string | — | PoolID is the pool to resize, from the URL path — the poolId a cluster read reports for it. |
provider | body | string | — | Provider is the cloud the cluster lives on. |
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.scaleNodePool({ clusterId: 'clusterId', poolId: 'poolId', clusterId: "<clusterId>", count: 0 });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).scale_node_pool(cluster_id='clusterId', pool_id='poolId', cluster_id="<clusterId>", count=0)cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.VisorAPI.ScaleNodePool(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::scale_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).scaleNodePool();curl -X POST https://api.hanzo.ai/v1/visor/clusters/<clusterId>/pools/<poolId>/scale \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clusterId": "<clusterId>",
"count": 0
}'Tool visor, op scaleNodePool — 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": "scaleNodePool",
"input": {
"clusterId": "<clusterId>",
"poolId": "<poolId>",
"count": 0
}
}
}
}'How is this guide?