import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/autonomy"
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/applications/{application_id}/autonomy', 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/applications/{application_id}/autonomy \
--header 'Authorization: Bearer <token>'{
"application_id": "<string>",
"storage": "seeded",
"read_state": "ok",
"read_reason": "<string>",
"unread": [
"auto_remediation_policy"
],
"environments": [
{
"environment_id": "<string>",
"name": "<string>",
"role": "<string>",
"environment_kind": "production",
"level": "you_run_it",
"is_custom": true,
"areas": [
{
"area": "keep_it_up",
"level": "you_run_it",
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
},
"seeded_from": "auto_remediation_policy",
"ceiling": {
"level": "you_run_it",
"reason": "<string>"
},
"requested": {
"level": "you_run_it",
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
}
}
],
"limits": {
"monthly_cost_increase_cents": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"non_production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"may_change_data": {
"value": true,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
}
},
"inherited_limits": {
"monthly_cost_increase_cents": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"non_production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"may_change_data": {
"value": true,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
}
}
}
],
"layers": {
"application": {
"level": "you_run_it",
"areas": {},
"limits": {
"monthly_cost_increase_cents": 1,
"production_downtime_seconds": 1,
"non_production_downtime_seconds": 1,
"may_change_data": true
},
"widened_by_admin": true
},
"environments": {}
},
"choices_take_effect_areas": [
"keep_it_up"
],
"pause": {
"read_state": "ok",
"paused": true,
"paused_at": "2023-11-07T05:31:56Z",
"paused_by": "<string>",
"reason": "<string>"
},
"limits_editable": true
}{
"detail": "<string>"
}Get who runs each environment
Who runs it: for each of the application’s environments, the effective autonomy level (you_run_it, together, ankra_runs_it) in every area, the rule that decided it, and the limits. The stored organisation, application and environment layers apply first; where the organisation layer sets nothing it is seeded from existing settings (auto-remediation policy, Cost Autopilot tier, push-to-deploy) and seeded_from names which. read_state is partial when one of those seeds could not be read and unknown when the environments or the stored policy could not be read, in which case environments is empty and must be rendered as could-not-check, never as no environments.
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/autonomy"
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/applications/{application_id}/autonomy', 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/applications/{application_id}/autonomy \
--header 'Authorization: Bearer <token>'{
"application_id": "<string>",
"storage": "seeded",
"read_state": "ok",
"read_reason": "<string>",
"unread": [
"auto_remediation_policy"
],
"environments": [
{
"environment_id": "<string>",
"name": "<string>",
"role": "<string>",
"environment_kind": "production",
"level": "you_run_it",
"is_custom": true,
"areas": [
{
"area": "keep_it_up",
"level": "you_run_it",
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
},
"seeded_from": "auto_remediation_policy",
"ceiling": {
"level": "you_run_it",
"reason": "<string>"
},
"requested": {
"level": "you_run_it",
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
}
}
],
"limits": {
"monthly_cost_increase_cents": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"non_production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"may_change_data": {
"value": true,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
}
},
"inherited_limits": {
"monthly_cost_increase_cents": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"non_production_downtime_seconds": {
"value": 123,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
},
"may_change_data": {
"value": true,
"source": {
"layer": "platform_default",
"detail": "default",
"widened_by_admin": true,
"clamped": true,
"clamped_layer": "<string>"
}
}
}
}
],
"layers": {
"application": {
"level": "you_run_it",
"areas": {},
"limits": {
"monthly_cost_increase_cents": 1,
"production_downtime_seconds": 1,
"non_production_downtime_seconds": 1,
"may_change_data": true
},
"widened_by_admin": true
},
"environments": {}
},
"choices_take_effect_areas": [
"keep_it_up"
],
"pause": {
"read_state": "ok",
"paused": true,
"paused_at": "2023-11-07T05:31:56Z",
"paused_by": "<string>",
"reason": "<string>"
},
"limits_editable": true
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
stored: at least one stored layer (organisation, application or one of its environments) applies; seeded: every layer is read from existing settings; unknown: the stored layers could not be read, so read_state is unknown too. Per area, source.layer names the layer that decided it and seeded_from the setting a seed came from.
seeded, stored, unknown ok, partial, unknown auto_remediation_policy, cost_autopilot_tier, deploys_on_push Show child attributes
Show child attributes
What is stored for the application, the layers a write starts from. null when the stored layers were not read; no write may be built then.
Show child attributes
Show child attributes
The areas whose stored choice Ankra honours today. The autonomous lane of each consults the stored levels before it acts, holding itself at a lower choice and never acting above its own setting, or, for keep_it_safe, acts only when a person asks, so every stored level already holds. A choice in any other area is stored and shown, but no lane acts on it yet.
keep_it_up, ship_changes, keep_it_safe, keep_costs_down, keep_it_current, fix_my_code Whether a person paused Ankra's autonomous actions for the application, as GET /org/applications/{application_id}/autonomy-pause answers it. Read on its own, so it is answered even when read_state is unknown; its own read_state is unknown, with paused null, when the pause could not be read.
Show child attributes
Show child attributes
The write supports transactional expected-layer comparisons. This is not a claim that automatic lanes enforce limits.