import requests
url = "https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/vms/{vm_id}/instance-type"
payload = {
"abandon_pending_resize": False,
"force_drain": False,
"instance_type": "<string>"
}
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({abandon_pending_resize: false, force_drain: false, instance_type: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/vms/{vm_id}/instance-type', 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}/vms/{vm_id}/instance-type \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"abandon_pending_resize": false,
"force_drain": false,
"instance_type": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"instance_type": "<string>",
"operation_id": "<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"
}Resize a standalone VM (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}/vms/{vm_id}/instance-type"
payload = {
"abandon_pending_resize": False,
"force_drain": False,
"instance_type": "<string>"
}
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({abandon_pending_resize: false, force_drain: false, instance_type: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/aws/{cluster_id}/vms/{vm_id}/instance-type', 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}/vms/{vm_id}/instance-type \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"abandon_pending_resize": false,
"force_drain": false,
"instance_type": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"instance_type": "<string>",
"operation_id": "<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
Browser session. Mutations also require X-Ankra-CSRF.
Headers
Must match the ankra_csrf browser cookie.
Body
Abandon the resize the group has pending instead of asking for one: each server's definition goes back to the type it actually runs and its resize markers are cleared, with nothing drained or powered off. Use it for a resize that cannot land (a drain the PodDisruptionBudgets block, a disk the provider will not shrink). instance_type is not needed when this is true; a group with no pending resize answers 409.
Bypass PodDisruptionBudgets when draining each node before it is power-cycled. Off by default: a budget is a workload owner's stated availability requirement.
The new instance type for every node in the group. Changing it power-cycles each node, so the nodes are rolled in bounded lanes and each is drained before it goes down.