import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/objects/stack/{cluster_id}/{stack_name}"
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/objects/stack/{cluster_id}/{stack_name}', 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/objects/stack/{cluster_id}/{stack_name} \
--header 'Authorization: Bearer <token>'{
"kind": "cluster",
"object": {
"id": "<string>",
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>"
},
"currency": "<string>",
"priced": true,
"unpriced_reason": "<string>",
"monthly_cents": 123,
"idle_pct": 123,
"share_of_fleet_pct": 123,
"confidence": "<string>",
"coverage_incomplete": true,
"open_waste": {
"available": true,
"reason": "<string>",
"count": 123,
"monthly_cents": 123,
"unpriced_count": 123
},
"trend_30d": [
{
"date": "2023-12-25",
"cents": 123,
"clusters_metered": 123,
"clusters_total": 123
}
],
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"priced": true,
"monthly_cents": 123,
"confidence": "<string>",
"coverage_incomplete": true
}
],
"namespaces": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"namespace": "<string>",
"monthly_cents": 123,
"shared": true
}
],
"snapshot_stale_after_hours": 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"
}Get a stack's cost projection (bearer twin)
What one stack of a cluster costs: the allocations of the namespaces its cluster’s latest metering pass attributes to it (a namespace two stacks claim is attributed to neither), its share of the fleet and 30 days of daily cost. 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/objects/stack/{cluster_id}/{stack_name}"
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/objects/stack/{cluster_id}/{stack_name}', 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/objects/stack/{cluster_id}/{stack_name} \
--header 'Authorization: Bearer <token>'{
"kind": "cluster",
"object": {
"id": "<string>",
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>"
},
"currency": "<string>",
"priced": true,
"unpriced_reason": "<string>",
"monthly_cents": 123,
"idle_pct": 123,
"share_of_fleet_pct": 123,
"confidence": "<string>",
"coverage_incomplete": true,
"open_waste": {
"available": true,
"reason": "<string>",
"count": 123,
"monthly_cents": 123,
"unpriced_count": 123
},
"trend_30d": [
{
"date": "2023-12-25",
"cents": 123,
"clusters_metered": 123,
"clusters_total": 123
}
],
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"priced": true,
"monthly_cents": 123,
"confidence": "<string>",
"coverage_incomplete": true
}
],
"namespaces": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"namespace": "<string>",
"monthly_cents": 123,
"shared": true
}
],
"snapshot_stale_after_hours": 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
The stack's name on the cluster.
Response
Successful response
What one object of the organisation costs now and over the last 30 days, read from the same snapshots and staleness window as the fleet summary. A cluster-based object (a cluster, a credential) costs its clusters' run rate, idle capacity included; a namespace-based object (a namespace, a stack, an application) costs its namespaces' allocations and has no idle share. Nothing unknown reads as zero.
cluster, namespace, stack, application, credential Show child attributes
Show child attributes
The caller's display currency; every *_cents figure is in its minor units.
At least one cluster behind the object contributed a figure. False leaves every figure null and names why in unpriced_reason.
The run rate at the latest snapshot inside the window, times 730 hours.
The share of the run rate idle capacity accounts for; cluster-based objects only.
monthly_cents over the fleet's run rate in the same window; null when either is unknown or the fleet is zero.
The lowest confidence among the snapshots the figure is read from: high, medium or low.
The figure is a floor: a node or billed resource of a contributing cluster could not be priced, or a cluster behind the object contributed no figure (clusters names which).
The open cloud waste attributed to the object. Waste is found per cloud resource, so only a cluster or a credential carries it; available false names why it is not read, which is unknown, not none.
Show child attributes
Show child attributes
The object's cost per UTC day over the last 30 days, oldest first.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The namespaces behind a namespace-based object; empty for a cluster-based one.
Show child attributes
Show child attributes
The window a snapshot counts in.