import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/savings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/savings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/cloud-cost/savings \
--header 'Authorization: Bearer <token>'{
"analysed_cluster_count": 123,
"analysis_budget_exhausted": true,
"breakdowns": [
{
"best_recommendation_id": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"components": [
{
"key": "<string>",
"label": "<string>",
"monthly_cents": 123
}
],
"idle_monthly_cents": 123,
"monthly_cents": 123,
"provider": "<string>",
"top_namespaces": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"monthly_cents": 123,
"namespace": "<string>",
"share_percent": 123
}
],
"trend": [
{
"day": "2023-11-07T05:31:56Z",
"monthly_cost_estimate_cents": 123,
"fully_priced": true
}
],
"unallocated_monthly_cents": 123
}
],
"currency": "<string>",
"estimated_monthly_savings_cents": 123,
"generated_at": "2023-11-07T05:31:56Z",
"namespaces": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"monthly_cents": 123,
"namespace": "<string>",
"share_percent": 123
}
],
"priced_cluster_count": 123,
"recommendations": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"environment": "<string>",
"confidence": "measured",
"evidence": {
"idle_monthly_cents": 123,
"off_hours_share_percent": 123,
"start_cron": "<string>",
"stop_cron": "<string>",
"stoppable_monthly_cents": 123,
"unallocated_monthly_cents": 123,
"unallocated_share_percent": 123,
"metrics_state": "present",
"node_local_storage_state": "present",
"node_local_pvc_count": 123,
"node_local_pvc_names": [
"<string>"
]
},
"id": "<string>",
"kind": "right_size_idle",
"monthly_cost_cents": 123,
"monthly_savings_cents": 123,
"provider": "<string>",
"share_percent": 123,
"ladder": [
{
"wave": 123,
"group": "<string>",
"from_instance_type": "<string>",
"to_instance_type": "<string>",
"count": 123,
"monthly_savings_cents": 123,
"cumulative_monthly_savings_cents": 123,
"verify_days": 123
}
],
"total_ladder_savings_cents": 123,
"ladder_notes": [
{
"group": "<string>",
"reason": "<string>"
}
],
"autopilot_tier": "hands-off",
"autopilot_tier_reason": "<string>"
}
],
"thresholds": {
"analysed_cluster_limit": 123,
"analysis_budget_seconds": 123,
"snapshot_stale_after_hours": 123,
"minimum_off_hours_monthly_cents": 123,
"minimum_savings_cents": 123,
"off_hours_share": 123,
"unallocated_share_threshold": 123
},
"total_monthly_savings_cents": 123,
"unanalysed_cluster_count": 123,
"unanalysed_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"reason": "limit"
}
],
"unpriced_cluster_count": 123,
"unpriced_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"kind": "<string>"
}
],
"stale_cluster_count": 123,
"stale_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"kind": "<string>"
}
],
"unreadable_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>"
}
],
"offline_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>"
}
],
"waste": {
"available": true,
"finding_count": 123,
"has_data": true,
"scanned_at": "<string>",
"total_monthly_cost_cents": 123,
"unpriced_finding_count": 123,
"shared_not_counted_monthly_cost_cents": 123,
"shared_not_counted_finding_count": 123
}
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Savings model for the organisation
The organisation’s savings model: right-size and off-hours recommendations across the biggest priced clusters, the cost breakdowns they were read from, the clusters the fleet cannot price, and the waste scan, in the caller’s display currency (ankra cost savings). One cluster counts once in the total, at its best lever. 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/savings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/savings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/cloud-cost/savings \
--header 'Authorization: Bearer <token>'{
"analysed_cluster_count": 123,
"analysis_budget_exhausted": true,
"breakdowns": [
{
"best_recommendation_id": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"components": [
{
"key": "<string>",
"label": "<string>",
"monthly_cents": 123
}
],
"idle_monthly_cents": 123,
"monthly_cents": 123,
"provider": "<string>",
"top_namespaces": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"monthly_cents": 123,
"namespace": "<string>",
"share_percent": 123
}
],
"trend": [
{
"day": "2023-11-07T05:31:56Z",
"monthly_cost_estimate_cents": 123,
"fully_priced": true
}
],
"unallocated_monthly_cents": 123
}
],
"currency": "<string>",
"estimated_monthly_savings_cents": 123,
"generated_at": "2023-11-07T05:31:56Z",
"namespaces": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"monthly_cents": 123,
"namespace": "<string>",
"share_percent": 123
}
],
"priced_cluster_count": 123,
"recommendations": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"environment": "<string>",
"confidence": "measured",
"evidence": {
"idle_monthly_cents": 123,
"off_hours_share_percent": 123,
"start_cron": "<string>",
"stop_cron": "<string>",
"stoppable_monthly_cents": 123,
"unallocated_monthly_cents": 123,
"unallocated_share_percent": 123,
"metrics_state": "present",
"node_local_storage_state": "present",
"node_local_pvc_count": 123,
"node_local_pvc_names": [
"<string>"
]
},
"id": "<string>",
"kind": "right_size_idle",
"monthly_cost_cents": 123,
"monthly_savings_cents": 123,
"provider": "<string>",
"share_percent": 123,
"ladder": [
{
"wave": 123,
"group": "<string>",
"from_instance_type": "<string>",
"to_instance_type": "<string>",
"count": 123,
"monthly_savings_cents": 123,
"cumulative_monthly_savings_cents": 123,
"verify_days": 123
}
],
"total_ladder_savings_cents": 123,
"ladder_notes": [
{
"group": "<string>",
"reason": "<string>"
}
],
"autopilot_tier": "hands-off",
"autopilot_tier_reason": "<string>"
}
],
"thresholds": {
"analysed_cluster_limit": 123,
"analysis_budget_seconds": 123,
"snapshot_stale_after_hours": 123,
"minimum_off_hours_monthly_cents": 123,
"minimum_savings_cents": 123,
"off_hours_share": 123,
"unallocated_share_threshold": 123
},
"total_monthly_savings_cents": 123,
"unanalysed_cluster_count": 123,
"unanalysed_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"reason": "limit"
}
],
"unpriced_cluster_count": 123,
"unpriced_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"kind": "<string>"
}
],
"stale_cluster_count": 123,
"stale_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"kind": "<string>"
}
],
"unreadable_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>"
}
],
"offline_clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>"
}
],
"waste": {
"available": true,
"finding_count": 123,
"has_data": true,
"scanned_at": "<string>",
"total_monthly_cost_cents": 123,
"unpriced_finding_count": 123,
"shared_not_counted_monthly_cost_cents": 123,
"shared_not_counted_finding_count": 123
}
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Response
Successful response
The organisation's savings model. Each cluster is counted once, at its best lever, because idle spend sits inside what an off-hours stop reclaims: total_monthly_savings_cents is each cluster's best measured or billed lever, and estimated_monthly_savings_cents only what its best lever of any confidence adds above that, so the two never count one spend twice. Unanalysed clusters are priced clusters beyond the organisation's analysed limit or past the analysis time budget, and offline clusters are priced clusters whose agent has not checked in; neither is a cluster with nothing to save.
True when the analysis time budget (thresholds.analysis_budget_seconds), not the analysed-cluster limit, left some priced clusters unanalysed.
Show child attributes
Show child attributes
What the clusters' best levers add, on estimates alone, above total_monthly_savings_cents: summed per cluster as its best lever of any confidence less its best measured or billed lever. Never counted in total_monthly_savings_cents.
The costliest namespaces across the analysed clusters, at most twelve.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Every priced cluster unanalysed_cluster_count counts, costliest first, with why it was left out on this read: limit (past the organisation's analysed-cluster limit), budget (the analysis time budget ran out first), unreadable (its cost read failed; also in unreadable_clusters) or no_breakdown (its cost read had no priced breakdown). The analysed set is re-chosen on every read, so this is what explains a total that moved without anything being spent or saved.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Clusters priced before whose latest snapshot is older than the fleet's staleness window: metering has stalled, which is neither priced nor unpriced.
Show child attributes
Show child attributes
Priced clusters whose cost breakdown could not be read on this pass; counted as unanalysed, never as clusters with nothing to save.
Show child attributes
Show child attributes
Priced clusters whose agent has not checked in within the platform's check-in threshold. Their synced inventory is the last one the agent sent, so they keep their price and breakdown but are offered no recommendation of any kind; never clusters with nothing to save.
Show child attributes
Show child attributes
The open cloud-waste findings. available is false when the waste scan could not be read, which is unknown waste, not no waste. total_monthly_cost_cents and unpriced_finding_count cover the findings that count toward this organisation's savings: a resource several organisations' credentials see counts only in the organisation its Ankra cluster label names, and in none without one, so it is counted once between them. finding_count is every finding listed.
Show child attributes
Show child attributes