Get a cluster's cost estimate
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/cost"
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/clusters/{cluster_id}/cost', 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/clusters/{cluster_id}/cost \
--header 'Authorization: Bearer <token>'{
"has_data": true,
"namespaces": [
{
"allocated_compute_monthly_cents": 123,
"allocated_hourly_cents": 123,
"allocated_monthly_cents": 123,
"allocated_storage_monthly_cents": 123,
"allocation_source": "<string>",
"cpu_share": 123,
"memory_share": 123,
"namespace": "<string>",
"stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"readiness": {
"cluster_online": true,
"has_cloud_credential": true,
"nodes_synced": true,
"pricing_available": true,
"provider": "<string>",
"state": "<string>"
},
"summary": {
"applied_discount_pct": 123,
"compute_on_demand_cents": 123,
"compute_on_demand_monthly_cents": 123,
"compute_spot_cents": 123,
"compute_spot_monthly_cents": 123,
"confidence_level": "<string>",
"control_plane_cents": 123,
"control_plane_monthly_cents": 123,
"coverage_incomplete": true,
"currency": "<string>",
"hourly_cost_cents": 123,
"idle_hourly_cents": 123,
"idle_monthly_cents": 123,
"infrastructure_cents": 123,
"infrastructure_monthly_cents": 123,
"inventory_freshness": "fresh",
"inventory_observed_at": "2023-11-07T05:31:56Z",
"is_estimated": true,
"month_hours": {
"cluster_count": 123,
"hours_elapsed": 123,
"hours_estimated": 123,
"hours_measured": 123,
"hours_metered": 123,
"is_short": true,
"note": "<string>",
"short_cluster_count": 123
},
"month_to_date_cents": 123,
"monthly_cost_estimate_cents": 123,
"network_cents": 123,
"network_monthly_cents": 123,
"on_demand_node_count": 123,
"priced_node_count": 123,
"projected_month_end_cents": 123,
"provider": "<string>",
"snapshot_at": "2023-11-07T05:31:56Z",
"spot_node_count": 123,
"storage_cents": 123,
"storage_monthly_cents": 123,
"storage_volume_count": 123,
"total_node_count": 123,
"unallocated_hourly_cents": 123,
"unallocated_monthly_cents": 123,
"unpriced_volume_count": 123,
"price_list_as_of": "2023-12-25",
"price_source": "provider_list"
},
"trend": [
{
"day": "2023-11-07T05:31:56Z",
"monthly_cost_estimate_cents": 123,
"fully_priced": true,
"fx_basis": "recorded"
}
],
"trend_fx_basis": "recorded",
"unmetered": {
"currency": "<string>",
"is_inventory_stale": true,
"last_snapshot_at": "2023-11-07T05:31:56Z",
"month_to_date_cents": 123,
"month_hours": {
"cluster_count": 123,
"hours_elapsed": 123,
"hours_estimated": 123,
"hours_measured": 123,
"hours_metered": 123,
"is_short": true,
"note": "<string>",
"short_cluster_count": 123
}
}
}{
"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"
}Cost
Get a cluster's cost estimate
A cluster’s latest cost snapshot with its daily trend and namespace allocation, in the caller’s display currency, or its readiness when no estimate exists yet (ankra cost cluster). Bearer-PAT twin of the browser route of the same name under /org; the console’s session cookie is not accepted here and the browser route answers a token with a login redirect.
GET
/
api
/
v1
/
org
/
clusters
/
{cluster_id}
/
cost
Get a cluster's cost estimate
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/cost"
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/clusters/{cluster_id}/cost', 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/clusters/{cluster_id}/cost \
--header 'Authorization: Bearer <token>'{
"has_data": true,
"namespaces": [
{
"allocated_compute_monthly_cents": 123,
"allocated_hourly_cents": 123,
"allocated_monthly_cents": 123,
"allocated_storage_monthly_cents": 123,
"allocation_source": "<string>",
"cpu_share": 123,
"memory_share": 123,
"namespace": "<string>",
"stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"readiness": {
"cluster_online": true,
"has_cloud_credential": true,
"nodes_synced": true,
"pricing_available": true,
"provider": "<string>",
"state": "<string>"
},
"summary": {
"applied_discount_pct": 123,
"compute_on_demand_cents": 123,
"compute_on_demand_monthly_cents": 123,
"compute_spot_cents": 123,
"compute_spot_monthly_cents": 123,
"confidence_level": "<string>",
"control_plane_cents": 123,
"control_plane_monthly_cents": 123,
"coverage_incomplete": true,
"currency": "<string>",
"hourly_cost_cents": 123,
"idle_hourly_cents": 123,
"idle_monthly_cents": 123,
"infrastructure_cents": 123,
"infrastructure_monthly_cents": 123,
"inventory_freshness": "fresh",
"inventory_observed_at": "2023-11-07T05:31:56Z",
"is_estimated": true,
"month_hours": {
"cluster_count": 123,
"hours_elapsed": 123,
"hours_estimated": 123,
"hours_measured": 123,
"hours_metered": 123,
"is_short": true,
"note": "<string>",
"short_cluster_count": 123
},
"month_to_date_cents": 123,
"monthly_cost_estimate_cents": 123,
"network_cents": 123,
"network_monthly_cents": 123,
"on_demand_node_count": 123,
"priced_node_count": 123,
"projected_month_end_cents": 123,
"provider": "<string>",
"snapshot_at": "2023-11-07T05:31:56Z",
"spot_node_count": 123,
"storage_cents": 123,
"storage_monthly_cents": 123,
"storage_volume_count": 123,
"total_node_count": 123,
"unallocated_hourly_cents": 123,
"unallocated_monthly_cents": 123,
"unpriced_volume_count": 123,
"price_list_as_of": "2023-12-25",
"price_source": "provider_list"
},
"trend": [
{
"day": "2023-11-07T05:31:56Z",
"monthly_cost_estimate_cents": 123,
"fully_priced": true,
"fx_basis": "recorded"
}
],
"trend_fx_basis": "recorded",
"unmetered": {
"currency": "<string>",
"is_inventory_stale": true,
"last_snapshot_at": "2023-11-07T05:31:56Z",
"month_to_date_cents": 123,
"month_hours": {
"cluster_count": 123,
"hours_elapsed": 123,
"hours_estimated": 123,
"hours_measured": 123,
"hours_metered": 123,
"is_short": true,
"note": "<string>",
"short_cluster_count": 123
}
}
}{
"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
Response
Successful response
The weakest fx_basis of the trend's days, unrated when a day was left out of the trend because an hour of it no rate converts: that day is missing for want of a rate, not because the cluster was not priced. Null when the trend read no day.
Available options:
recorded, own_day, today, unrated