curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/tenant_clusters/{tenant_cluster_id}/node-pools/{node_pool_id}/autoscaling/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "min_replicas": 0, "max_replicas": 0, "triggers": [ { "type": "cpu", "target_utilization_percent": 0 } ], "polling_interval_seconds": 0, "scale_up_stabilization_window_seconds": 0, "scale_down_stabilization_window_seconds": 0}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/tenant_clusters/{tenant_cluster_id}/node-pools/{node_pool_id}/autoscaling/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "min_replicas": 0, "max_replicas": 0, "triggers": [ { "type": "cpu", "target_utilization_percent": 0, }, ], "polling_interval_seconds": 0, "scale_up_stabilization_window_seconds": 0, "scale_down_stabilization_window_seconds": 0, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/tenant_clusters/{tenant_cluster_id}/node-pools/{node_pool_id}/autoscaling/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "min_replicas": 0, "max_replicas": 0, "triggers": [ { "type": "cpu", "target_utilization_percent": 0 } ], "polling_interval_seconds": 0, "scale_up_stabilization_window_seconds": 0, "scale_down_stabilization_window_seconds": 0 }),});console.log(await response.json());Sets a worker pool’s size, in place of whatever it had. Send equal min_replicas and max_replicas and no triggers for a fixed size: the pool shows resizing until it reaches that count. Send a lower minimum than maximum, with a CPU target, a memory target, or both, to autoscale: the pool runs as many nodes as its busiest target asks for, within the bounds, and shows scaling while its autoscaler changes the count. The cluster stays ready throughout.
The pool must be ready and on an hourly plan; a committed pool cannot be resized or autoscaled. Growing a pool checks credit and free stock for the added nodes. Scaling down removes nodes and evicts their pods.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Kubernetes cluster ID, as returned by List Kubernetes Clusters.
Worker node pool ID, from the cluster’s node_pools list.
Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
The fewest nodes. Equal to max_replicas for a fixed size.
The most nodes.
Required when autoscaling, and empty or left out for a fixed size. At most one cpu and one memory target.
object
The average use across the pool’s nodes to aim for. Defaults to 70 for cpu and 80 for memory.
How often the targets are checked, when autoscaling. null keeps the default, 30.
How long use must stay above the target before nodes are added, when autoscaling. null keeps the default, 0.
How long use must stay below the target before nodes are removed, when autoscaling. null keeps the default, 300.
Responses
Section titled “Responses”The new size is saved.
object
The pool’s size settings, as in Get Node Pool Size, without available_trigger_types.
object
object
Example
{ "code": 200, "data": { "node_pool_id": 22, "min_replicas": 4, "max_replicas": 4, "replicas": 4, "status": "resizing" }, "errors": {}, "message": "Node pool resize to 4 nodes queued successfully"}