import requests
url = "https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-runs/{run_id}/resource-suggestions"
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/pipeline-repositories/{repository_id}/pipeline-runs/{run_id}/resource-suggestions', 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/pipeline-repositories/{repository_id}/pipeline-runs/{run_id}/resource-suggestions \
--header 'Authorization: Bearer <token>'{
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"window": 50,
"method": {
"percentile": 123,
"headroom_percent": 123,
"minimum_samples": 123,
"memory_at_limit_percent": 123,
"cpu_throttled_share_percent": 123,
"tolerance_percent": 123,
"cpu_reserve_percent": 123
},
"stages": [
{
"stage": "<string>",
"sample_count": 123,
"memory": {
"status": "oversized",
"samples": 123,
"current_request_bytes": 123,
"peak_p95_bytes": 123,
"peak_max_bytes": 123,
"at_limit_samples": 123,
"oom_killed_samples": 123,
"suggested_bytes": 123,
"suggested": "<string>"
},
"cpu": {
"status": "oversized",
"samples": 123,
"current_request_millicores": 123,
"current_limit_millicores": 123,
"mean_p95_millicores": 123,
"throttled_share_p95": 123,
"suggested_request_millicores": 123,
"suggested": "<string>"
}
}
]
}Get a run's resource suggestions
Right-sizing advice for the stages of the pipeline definition a run was planned from: for each stage, the 95th percentile of what its latest successful attempts used, plus 25% headroom, against what it asks for, with how many samples it rests on. Memory is sized from the kernel’s memory peak; a stage whose peak reached its limit is at_limit with no suggestion. CPU is sized from mean cores and suggests the request. Only the caller’s organisation’s runs are counted. Requires pipelines.read. Read-only: nothing is written back to the definition.
import requests
url = "https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-runs/{run_id}/resource-suggestions"
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/pipeline-repositories/{repository_id}/pipeline-runs/{run_id}/resource-suggestions', 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/pipeline-repositories/{repository_id}/pipeline-runs/{run_id}/resource-suggestions \
--header 'Authorization: Bearer <token>'{
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"window": 50,
"method": {
"percentile": 123,
"headroom_percent": 123,
"minimum_samples": 123,
"memory_at_limit_percent": 123,
"cpu_throttled_share_percent": 123,
"tolerance_percent": 123,
"cpu_reserve_percent": 123
},
"stages": [
{
"stage": "<string>",
"sample_count": 123,
"memory": {
"status": "oversized",
"samples": 123,
"current_request_bytes": 123,
"peak_p95_bytes": 123,
"peak_max_bytes": 123,
"at_limit_samples": 123,
"oom_killed_samples": 123,
"suggested_bytes": 123,
"suggested": "<string>"
},
"cpu": {
"status": "oversized",
"samples": 123,
"current_request_millicores": 123,
"current_limit_millicores": 123,
"mean_p95_millicores": 123,
"throttled_share_p95": 123,
"suggested_request_millicores": 123,
"suggested": "<string>"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
How many of each stage's latest successful attempts to size from.
1 <= x <= 100Response
One suggestion per stage.
The pipeline definition the run was planned from, whose attempts the suggestions are sized from. Null for a run that names none, which then carries no stages.
How many of each stage's latest successful attempts were considered.
1 <= x <= 100The parameters every suggestion in the body is made of.
Show child attributes
Show child attributes
One entry per stage with at least one successful attempt that carried a usage report, in name order. A stage absent from the list has no such attempt yet, not zero use.
Show child attributes
Show child attributes