Get a cluster's cost estimate (bearer twin)
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_spot_cents": 123,
"confidence_level": "<string>",
"control_plane_cents": 123,
"coverage_incomplete": true,
"currency": "<string>",
"hourly_cost_cents": 123,
"idle_hourly_cents": 123,
"infrastructure_cents": 123,
"is_estimated": true,
"month_to_date_cents": 123,
"monthly_cost_estimate_cents": 123,
"network_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_volume_count": 123,
"total_node_count": 123,
"unallocated_hourly_cents": 123,
"unpriced_volume_count": 123
},
"trend": [
{
"day": "2023-11-07T05:31:56Z",
"monthly_cost_estimate_cents": 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 (bearer twin)
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 (bearer twin)
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_spot_cents": 123,
"confidence_level": "<string>",
"control_plane_cents": 123,
"coverage_incomplete": true,
"currency": "<string>",
"hourly_cost_cents": 123,
"idle_hourly_cents": 123,
"infrastructure_cents": 123,
"is_estimated": true,
"month_to_date_cents": 123,
"monthly_cost_estimate_cents": 123,
"network_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_volume_count": 123,
"total_node_count": 123,
"unallocated_hourly_cents": 123,
"unpriced_volume_count": 123
},
"trend": [
{
"day": "2023-11-07T05:31:56Z",
"monthly_cost_estimate_cents": 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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
Response
Successful response