import requests
url = "https://platform.ankra.app/api/v1/org/pipelines/time-saved"
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/pipelines/time-saved', 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/pipelines/time-saved \
--header 'Authorization: Bearer <token>'{
"window": "7d",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1,
"reasons": [
{
"reason": "path_filter",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"repositories": [
{
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"full_name": "<string>",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"days": [
{
"date": "2023-12-25",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"method": {
"statistic": "median",
"sample_window": 2,
"history_run_scan": 2
}
}Get the time the organisation's pipelines saved
The CI time every pipeline repository the caller may see did not spend over the last 7 or 30 days, in total, by reason, by repository and by UTC day. Each saving is estimated when the run is planned or skipped, from the stage’s own history in the same repository: the median of its newest 20 successful runs among the repository’s newest 300 concluded runs (a promoted step uses its duration in the run it was promoted from; a whole run uses the median total of the newest 20 successful runs of the same trigger). CPU-minutes are requested CPU times duration. A stage with no history is counted as unknown, never as a saving. The time is runner time, not wall-clock time. Requires pipelines.read. Read-only.
import requests
url = "https://platform.ankra.app/api/v1/org/pipelines/time-saved"
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/pipelines/time-saved', 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/pipelines/time-saved \
--header 'Authorization: Bearer <token>'{
"window": "7d",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1,
"reasons": [
{
"reason": "path_filter",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"repositories": [
{
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"full_name": "<string>",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"days": [
{
"date": "2023-12-25",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"method": {
"statistic": "median",
"sample_window": 2,
"history_run_scan": 2
}
}Authorizations
Response
The organisation's savings over the window.
The CI time saved over a window of whole UTC days ending today.