Create scale

Resizes a node pool to an absolute node count and returns the pool as Visor reports it after the change.

POST /v1/compute/clusters/{clusterId}/pools/{poolId}/scale

Addresshttps://api.hanzo.ai/v1/compute/clusters/{clusterId}/pools/{poolId}/scale
MethodPOST
OperationscaleNodePool
AuthAuthorization: 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).

FieldInTypeRequiredDescription
clusterIdpathstringyesClusterID is the cluster holding the pool, from the URL path.
poolIdpathstringyesPoolID is the pool to resize, from the URL path — the poolId a cluster read reports for it.
clusterIdbodystring—ClusterID is the cluster holding the pool, from the URL path.
countbodyinteger (int64)—Count is the node count to scale TO — an absolute target, not a delta, and never negative.
poolIdbodystring—PoolID is the pool to resize, from the URL path — the poolId a cluster read reports for it.
providerbodystring—Provider is the cloud the cluster lives on.

Response

StatusBodyMeaning
200compute.nodePoolViewok
defaultproblem-detailsrefused

200 body — 7 fields.

FieldInTypeAlwaysDescription
autoScalebodyboolean—AutoScale reports whether the provider's cluster autoscaler owns this pool's size, moving Count between MinNodes and MaxNodes as workloads demand.
countbodyinteger (int64)—Count is how many nodes the pool has right now.
maxNodesbodyinteger (int64)—MaxNodes is the ceiling the autoscaler will not grow the pool past, and so the bound on what this pool can cost.
minNodesbodyinteger (int64)—MinNodes is the floor the autoscaler will not shrink the pool below.
namebodystring—Name is the pool's name as the provider knows it.
poolIdbodystring—PoolID is the provider's id for the pool — the value the scale and delete routes address it by.
sizebodystring—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 compute clusters pools scale <clusterId> <poolId>
import { Configuration, ComputeApi } from 'hanzoai';

const api = new ComputeApi(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 ComputeApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ComputeApi(client).scale_node_pool(cluster_id='clusterId', pool_id='poolId', cluster_id="<clusterId>", count=0)
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ComputeAPI.ScaleNodePool(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, compute_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = compute_api::scale_node_pool(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ComputeApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ComputeApi(client).scaleNodePool();
curl -X POST https://api.hanzo.ai/v1/compute/clusters/<clusterId>/pools/<poolId>/scale \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "clusterId": "<clusterId>",
       "count": 0
     }'

Tool compute, 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": "compute",
         "arguments": {
           "op": "scaleNodePool",
           "input": {
             "clusterId": "<clusterId>",
             "poolId": "<poolId>",
             "count": 0
           }
         }
       }
     }'

Compute API · All Hanzo APIs · Interactive reference

Was this page useful?