Get a run's resource suggestions
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,
"working_set_samples": 123,
"working_set_p95_bytes": 123,
"working_set_max_bytes": 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>"
}
}
]
}Pipelines
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.
GET
/
api
/
v1
/
org
/
pipeline-repositories
/
{repository_id}
/
pipeline-runs
/
{run_id}
/
resource-suggestions
Get a run's resource suggestions
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,
"working_set_samples": 123,
"working_set_p95_bytes": 123,
"working_set_max_bytes": 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
Query Parameters
Response
One suggestion per stage.