import requests
url = "https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups"
payload = {
"instance_type": "<string>",
"name": "<string>"
}
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({instance_type: '<string>', name: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--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": "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"
}Add node group (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"
payload = {
"instance_type": "<string>",
"name": "<string>"
}
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({instance_type: '<string>', name: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/node-groups \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--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": "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
Body
Node group name. In a create-cluster request it must be 1 to 63 lowercase letters, digits and hyphens, starting and ending with a letter or digit (an RFC 1123 DNS label), or the create is refused and nothing is created. Adding a node group to an existing cluster applies the day-2 name check instead.
Number of nodes in the group, 0 to 100. A cluster create accepts 0. Adding the group to an existing cluster (POST .../node-groups) refuses 0 with a 409, because a node group exists through its nodes and one added with none would not be stored: add it with 1 or more.
0 <= x <= 100Response
Successful response
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.