import requests
url = "https://platform.ankra.app/api/v1/org/ci-settings/capacity/history"
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/ci-settings/capacity/history', 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/ci-settings/capacity/history \
--header 'Authorization: Bearer <token>'{
"window": "24h",
"bucket_seconds": 123,
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"run_retention_days": 123,
"is_capped": true,
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"buckets": [
{
"start": "2023-11-07T05:31:56Z",
"steps_started": 123,
"average_steps_running": 123,
"peak_steps_running": 123,
"cpu_requested_millicores": 123,
"memory_requested_bytes": 123,
"request_coverage": 123,
"cpu_used_millicores": 123,
"usage_coverage": 123,
"slot_wait_average_seconds": 123,
"slot_wait_max_seconds": 123
}
]
}
]
}Read the organisation's CI usage history
How the organisation’s CI clusters have been used over a window of 24h, 7d or 30d, per cluster and per time bucket: steps started, the time-weighted average and peak number of steps running, the CPU and memory those steps requested and the CPU they used, and how long they waited for a slot. It is folded from the organisation’s pipeline steps on its own clusters (steps Ankra’s builders ran are not counted), so it reaches back no further than run_retention_days. A requested or used figure is null when steps ran and none recorded it and zero when nothing ran; request_coverage and usage_coverage give the share of step running time that recorded it. The slot count and node capacity at the time are not recorded; read today’s from the capacity route. Readable by any member. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).
import requests
url = "https://platform.ankra.app/api/v1/org/ci-settings/capacity/history"
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/ci-settings/capacity/history', 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/ci-settings/capacity/history \
--header 'Authorization: Bearer <token>'{
"window": "24h",
"bucket_seconds": 123,
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"run_retention_days": 123,
"is_capped": true,
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"buckets": [
{
"start": "2023-11-07T05:31:56Z",
"steps_started": 123,
"average_steps_running": 123,
"peak_steps_running": 123,
"cpu_requested_millicores": 123,
"memory_requested_bytes": 123,
"request_coverage": 123,
"cpu_used_millicores": 123,
"usage_coverage": 123,
"slot_wait_average_seconds": 123,
"slot_wait_max_seconds": 123
}
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The span to read: 48 buckets of 30 minutes, 56 of 3 hours, or 60 of 12 hours.
24h, 7d, 30d Response
The organisation's CI usage over the window.
The organisation's CI usage over one window (ankra-q573dh.57).
24h, 7d, 30d End of the newest bucket, which is still going.
How long the organisation keeps pipeline runs; a window reaching further back is empty there, not idle.
The window held more steps than one read folds; the newest were kept, so the oldest buckets undercount.
Every current member of the organisation's CI pool, primary first, then any other of its clusters a step ran on in the window.
Show child attributes
Show child attributes