import requests
url = "https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups/{group_name}/autoscaling"
payload = { "enabled": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups/{group_name}/autoscaling', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups/{group_name}/autoscaling \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'{
"group_name": "<string>",
"enabled": true,
"min_count": 123,
"max_count": 123,
"node_count": 123,
"target_count": 123,
"operation_id": "<string>",
"message": "<string>"
}{
"status": "accepted",
"message": "<string>",
"operation_id": "<string>",
"node_count": 123,
"target_count": 123
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Update node-group autoscaling
Enables or disables the cluster autoscaler for the node group and sets its bounds (min_count defaults to the v1 minimum, max_count to the per-group maximum). A group outside the new bounds is moved into them: the response says the node count it moves to and the operation applying it. Requires clusters.write. With the default wait=false the write is queued and answered 202; an agent too old for the autoscaler, a write already running on the cluster, or an invalid state answers 409.
import requests
url = "https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups/{group_name}/autoscaling"
payload = { "enabled": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups/{group_name}/autoscaling', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups/{group_name}/autoscaling \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'{
"group_name": "<string>",
"enabled": true,
"min_count": 123,
"max_count": 123,
"node_count": 123,
"target_count": 123,
"operation_id": "<string>",
"message": "<string>"
}{
"status": "accepted",
"message": "<string>",
"operation_id": "<string>",
"node_count": 123,
"target_count": 123
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
true runs the write inline and answers its result; the default queues it and answers 202 once its first verdict is in (or after a few seconds), with a refusal decided in that window answered as it would be inline.
Body
Response
The settings as written (wait=true)
A node group's cluster-autoscaler settings. The members after max_count are answered by the PUT only.
PUT only. The group's node count when the write was made.
PUT only. The node count the write moves the group to: max_count when it had more nodes, min_count when it had fewer (while autoscaling is enabled), node_count otherwise.
PUT only. The operation applying the write; absent when none was created now (a stopped cluster, an operation already working on the cluster, or nothing to apply).
PUT only. What the write does to the group's node count, in words.