import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-groups/{group_name}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-groups/{group_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-groups/{group_name} \
--header 'Authorization: Bearer <token>'{
"deleted": 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>"
}
]
}Delete node group
Removes a node group by draining and deleting its workers one at a time through their PodDisruptionBudgets; a worker whose drain is refused stays in service and the operation fails with the reason. Pass force_drain=true to take the whole group down regardless. 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. Requires clusters.delete.
import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-groups/{group_name}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-groups/{group_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/node-groups/{group_name} \
--header 'Authorization: Bearer <token>'{
"deleted": 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
Query Parameters
Take every worker of the group down on a cluster teardown's drain, all at once, without honouring PodDisruptionBudgets, and drop the group's settings with the request. Off by default: the workers are drained one at a time through their budgets, a worker whose drain is refused is kept together with its node group and the group's settings, and the operation fails naming what refused it; the settings go when the group's last worker has.
Response
Successful Response
- DeleteNodeGroupResult
- 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