import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/waste/{finding_id}/resolve"
payload = {
"consent": "no_snapshot_acknowledged",
"min_unattached_days": 1825
}
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({consent: 'no_snapshot_acknowledged', min_unattached_days: 1825})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/waste/{finding_id}/resolve', 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/org/cloud-cost/waste/{finding_id}/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent": "no_snapshot_acknowledged",
"min_unattached_days": 1825
}
'{
"action": "snapshot_then_delete",
"kind": "<string>",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_name": "<string>",
"snapshot_retained_days": 123,
"waste_finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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>"
}
]
}Clean up one cloud-waste finding
Starts the cleanup of one open cloud-waste finding and answers the operation that does it (ankra cost waste resolve). What happens is decided by the kind of waste, never by the caller: a stopped server gets a snapshot image kept for seven days and is deleted only once the image is available; an unassigned IP or an idle load balancer is released. An unattached volume has no snapshot (the provider offers none), so it is deleted only with written consent in the body (consent: no_snapshot_acknowledged) and only once it has been seen unattached for at least min_unattached_days (30, or more if asked): the consent is recorded on the finding and in the audit log, and the job re-reads the volume and refuses one attached again or delete-protected. A released persistent volume (released_pv) keeps its disk because its reclaim policy is Retain, so it is cleaned up the Kubernetes way: with the same written consent and minimum age, and with clusters.write on its cluster, the volume is read live from its cluster and, only when it is still Released and was created by a cloud provider’s CSI driver that deletes the disks it provisioned, its reclaim policy is set to Delete (action reclaim_delete); the operation then waits for the volume to leave its cluster before the saving is counted. A pre-provisioned volume, one of another driver, one bound again, one already gone, or one that could not be read live is refused and left unchanged. The body is optional; without one no consent is given. Needs billing.manage. Bearer-PAT twin of the browser route of the same name under /org.
import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/waste/{finding_id}/resolve"
payload = {
"consent": "no_snapshot_acknowledged",
"min_unattached_days": 1825
}
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({consent: 'no_snapshot_acknowledged', min_unattached_days: 1825})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/waste/{finding_id}/resolve', 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/org/cloud-cost/waste/{finding_id}/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent": "no_snapshot_acknowledged",
"min_unattached_days": 1825
}
'{
"action": "snapshot_then_delete",
"kind": "<string>",
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_name": "<string>",
"snapshot_retained_days": 123,
"waste_finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
Body
Response
The cleanup operation was created
The cleanup operation and what it will do. snapshot_retained_days is set only for a snapshot-then-delete; delete (an unattached volume, on written consent) keeps no copy, and neither does reclaim_delete (a released persistent volume set to Delete on written consent, so its provisioner deletes it and the disk behind it; the operation waits for it to leave its cluster).