import requests
url = "https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups/{group_name}/autoscaling"
payload = { "enabled": True }
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.platform.ankra.app/org/clusters/aws/{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://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups/{group_name}/autoscaling \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"enabled": true
}
'{
"enabled": true,
"group_name": "<string>",
"max_count": 123,
"min_count": 123,
"message": "<string>",
"node_count": 123,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dispatch": "started",
"dispatch_reason": "<string>",
"target_count": 123
}{
"detail": "Cluster not found"
}{
"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 (browser session)
Browser session authentication; RBAC permission clusters.write. PAT mutations support wait=false where implemented; browser mutations require CSRF. Answers 404 while the organisation’s aws_provider feature flag is off.
import requests
url = "https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups/{group_name}/autoscaling"
payload = { "enabled": True }
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.platform.ankra.app/org/clusters/aws/{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://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups/{group_name}/autoscaling \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"enabled": true
}
'{
"enabled": true,
"group_name": "<string>",
"max_count": 123,
"min_count": 123,
"message": "<string>",
"node_count": 123,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dispatch": "started",
"dispatch_reason": "<string>",
"target_count": 123
}{
"detail": "Cluster not found"
}{
"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
Response
Successful response
PUT only, and always answered by it. The operation this write started for the group's nodes, created in the same transaction as the write: it moves the node count to target_count and writes the node-group label onto the existing nodes. Poll it on /api/v1/org/executions/{execution_id}. When the nodes needed no operation and enabling started the cluster autoscaler's install, it is that install, which moves no node, and dispatch_reason says so. Null when the write started none; dispatch says why.
PUT only. What the write did about the operation that applies it, as on the other node-group writes. started: operation_id names it. deferred: the change is stored but no operation was started for it now (an operation already working on the cluster, or a stopped cluster, whose start applies it); dispatch_reason says why and what applies it. none: the write left nothing for an operation to apply (autoscaling turned off; a node count already within the bounds, on workers that already carry the node-group label; a stopped cluster's scale-down that wrote the label onto none of the workers it keeps, which the write applies to the group's records itself). A stopped cluster's scale-down that wrote the label onto a worker it keeps is deferred: the label waits for the cluster's start.
started, deferred, none PUT only. Why no operation was started (deferred, none), what a started operation leaves to the reconcile loop, and, when enabling started the cluster autoscaler's install as a second operation, which one that is. Absent when a started operation carries the whole change and the write started no other.
PUT only. The node count the write moves the group to: max_count when the group had more nodes, min_count when it had fewer (while autoscaling is enabled), node_count otherwise. A group above max_count scales down through the guarded removal of its least busy nodes, each drained once the pipeline steps on it finish.