import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/ledger"
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/ledger', 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/ledger \
--header 'Authorization: Bearer <token>'{
"currency": "<string>",
"generated_at": "2023-11-07T05:31:56Z",
"measured_total_cents": 123,
"month": "<string>",
"measured_this_month_cents": 123,
"running_total_cents": 123,
"counts": {
"pending": 123,
"measured": 123,
"unmeasured": 123,
"reverted": 123
},
"rows": [
{
"decision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"lever": "<string>",
"summary": "<string>",
"status": "approved",
"expected_monthly_cents": 123,
"baseline_monthly_cents": 123,
"measured_monthly_cents": 123,
"measurement_status": "not_applicable",
"measurement_reason": "<string>",
"days": 123,
"decided_at": "2023-11-07T05:31:56Z",
"executed_at": "2023-11-07T05:31:56Z",
"verify_until": "2023-11-07T05:31:56Z",
"verification_status": "not_applicable",
"verification_days": [
{
"day": 123,
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"state": "clear",
"cpu_p95_share": 123,
"memory_p95_share": 123,
"nodes": 123,
"reporting": 123,
"hottest_node": "<string>",
"reason": "<string>"
}
],
"measured_at": "2023-11-07T05:31:56Z"
}
],
"truncated": true
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Measured outcomes of the organisation's cost decisions
The measured outcomes of the organisation’s cost decisions (ankra cost ledger): every cost proposal that was approved, is running or has run, with what the surface expected it to save, what was measured seven days after it ran (the subject cluster’s 24h mean run rate before the change minus the same mean at day seven, from cost snapshots, never an estimate), where the measurement stands and why it could not be made, in the caller’s display currency. measured_total_cents sums measured rows only; running_total_cents sums the expectations of approved, running and still-verifying changes. 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/ledger"
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/ledger', 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/ledger \
--header 'Authorization: Bearer <token>'{
"currency": "<string>",
"generated_at": "2023-11-07T05:31:56Z",
"measured_total_cents": 123,
"month": "<string>",
"measured_this_month_cents": 123,
"running_total_cents": 123,
"counts": {
"pending": 123,
"measured": 123,
"unmeasured": 123,
"reverted": 123
},
"rows": [
{
"decision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"lever": "<string>",
"summary": "<string>",
"status": "approved",
"expected_monthly_cents": 123,
"baseline_monthly_cents": 123,
"measured_monthly_cents": 123,
"measurement_status": "not_applicable",
"measurement_reason": "<string>",
"days": 123,
"decided_at": "2023-11-07T05:31:56Z",
"executed_at": "2023-11-07T05:31:56Z",
"verify_until": "2023-11-07T05:31:56Z",
"verification_status": "not_applicable",
"verification_days": [
{
"day": 123,
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"state": "clear",
"cpu_p95_share": 123,
"memory_p95_share": 123,
"nodes": 123,
"reporting": 123,
"hottest_node": "<string>",
"reason": "<string>"
}
],
"measured_at": "2023-11-07T05:31:56Z"
}
],
"truncated": true
}{
"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 measured outcomes of the organisation's cost decisions, newest first. measured_total_cents sums measured rows only, never expectations; running_total_cents sums the expectations of the changes in flight (approved, running, or succeeded and still inside their verification window). A negative measured row counts against the total as it stands.
The UTC calendar month measured_this_month_cents covers, as YYYY-MM.
measured_total_cents restricted to the rows measured in the current UTC calendar month (month): the figure a "saved this month" reading shows. Aggregated over every row, like the other totals.
How many ledger rows sit in each measurement state.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
True when the organisation holds more rows than the read returns (the newest 500); the totals and counts still cover every row.