import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/autopilot"
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/cloud-cost/autopilot', 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/cloud-cost/autopilot \
--header 'Authorization: Bearer <token>'{
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"environment": "<string>",
"environment_kind": "production",
"override": {
"expires_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"set_at": "2023-11-07T05:31:56Z",
"set_by": "<string>",
"tier": "hands-off"
},
"reason": "<string>",
"source": "override",
"tier": "hands-off",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"defaults": {},
"environment_kinds": [
"production"
],
"is_set": true,
"notification_route_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quiet_hours": {
"end": "<string>",
"start": "<string>",
"timezone": "<string>"
},
"recommended_defaults": {},
"tiers": [
{
"applies_to": "<string>",
"does": "<string>",
"name": "<string>",
"proposes": "<string>",
"rollback_window": "<string>",
"tier": "hands-off"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"scope": {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"all_projects": true,
"partial": true
},
"project_defaults": [
{
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"defaults": {},
"set_by": "<string>",
"set_at": "2023-11-07T05:31:56Z"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Get the cost autopilot policy
How much Ankra may do about cost unasked (ankra cost autopilot): the tier each environment kind defaults to, the quiet hours, the notification route kept with the policy (no notice is sent to it today), the four tiers with what each lets Ankra do, and every live cluster with its tier, whether an override or its environment set it, and the sentence a card shows for it. An organisation that never set a policy reads is_set false and Hands-off for every kind; recommended_defaults is the policy the Autopilot view offers to turn on. Any member can read it. Bearer-PAT twin of the browser route of the same name under /org; the console’s session cookie is not accepted here and the browser route answers a token with a login redirect. The clusters listed are those of one project - the one project_id names, else the caller’s current project - that the caller may read; scope says what was read.
import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/autopilot"
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/cloud-cost/autopilot', 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/cloud-cost/autopilot \
--header 'Authorization: Bearer <token>'{
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"environment": "<string>",
"environment_kind": "production",
"override": {
"expires_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"set_at": "2023-11-07T05:31:56Z",
"set_by": "<string>",
"tier": "hands-off"
},
"reason": "<string>",
"source": "override",
"tier": "hands-off",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"defaults": {},
"environment_kinds": [
"production"
],
"is_set": true,
"notification_route_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quiet_hours": {
"end": "<string>",
"start": "<string>",
"timezone": "<string>"
},
"recommended_defaults": {},
"tiers": [
{
"applies_to": "<string>",
"does": "<string>",
"name": "<string>",
"proposes": "<string>",
"rollback_window": "<string>",
"tier": "hands-off"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"scope": {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"all_projects": true,
"partial": true
},
"project_defaults": [
{
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"defaults": {},
"set_by": "<string>",
"set_at": "2023-11-07T05:31:56Z"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Query Parameters
Response
Successful response
The organisation's cost autopilot policy and every live cluster's tier under it.