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"
}
],
"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>"
}{
"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 (bearer twin)
How much Ankra may do about cost unasked (ankra cost autopilot): the tier each environment kind defaults to, the quiet hours and notification route of the autopilot’s pre-notices, 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.
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"
}
],
"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>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Response
Successful response
The organisation's cost autopilot policy and every live cluster's tier under it.
Show child attributes
Show child attributes
The tier each environment kind defaults to; every kind is present.
Show child attributes
Show child attributes
production, staging, development, preview, unknown False for an organisation that never set a policy: every kind is then Hands-off.
The route the autopilot's pre-notices go to; null for the organisation's default routing.
When the autopilot starts no change of its own; null for none.
Show child attributes
Show child attributes
The policy the Autopilot view offers to turn on.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Null until a policy is set.
The Ankra user id of the last change; null until a policy is set.