import requests
url = "https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups"
payload = {
"instance_type": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instance_type: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instance_type": "<string>",
"name": "<string>"
}
'{
"count": 123,
"dispatch": "started",
"group_name": "<string>",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dispatch_reason": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Add node group
Adds a worker node group with the given name, instance_type and count (default 1), plus optional labels, taints and autoscaling settings. By default the change runs in the background and the call answers 202 {"status": "accepted"} (409 if the same change is already in flight); pass wait=true to run it in the request and receive the result.
import requests
url = "https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups"
payload = {
"instance_type": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instance_type: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/upcloud/{cluster_id}/node-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instance_type": "<string>",
"name": "<string>"
}
'{
"count": 123,
"dispatch": "started",
"group_name": "<string>",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dispatch_reason": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Response
Successful Response
- AddNodeGroupResult
- AsyncWriteAcceptedResponse
What the write did about the operation that applies it. started: operation_id names it, created in the same transaction as the write. deferred: the change is stored but no operation was started for it now; dispatch_reason says why and what applies it instead (the reconcile loop once a running operation has finished, or the cluster's next start). none: the write left nothing for an operation to apply (a scale to the group's current count, a removal on a stopped cluster, which the write applies to the group's records itself).
started, deferred, none The operation this write started, created in the same transaction as the write; poll it on /api/v1/org/executions/{execution_id}. It is the operation that creates the group's nodes, so when it finishes the nodes have been created. When the nodes needed no operation of their own and the group was added with autoscaling enabled, it is instead the operation that installs the cluster autoscaler, which moves no node, and dispatch_reason says so. Null when the write started none; dispatch says why.
Why no operation was started (deferred, none); what a started operation leaves to the reconcile loop (an offline cluster's agent work); and, for a group added with autoscaling enabled, the second operation the write started, which installs the cluster autoscaler and moves no node. Absent when a started operation carries the whole change and the write started no other.