Set a project's cost autopilot tier
import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/autopilot/projects/{project_id}"
payload = { "defaults": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({defaults: {}})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/autopilot/projects/{project_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/cloud-cost/autopilot/projects/{project_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"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"
}Cost
Set a project's cost autopilot tier
Sets a project's autopilot tier per environment kind (ADR 0022), a layer between a cluster's override and the organisation's defaults: the body is {"defaults": {kind: tier, ...}} and is the whole layer, a kind it does not name falls through to the organisation. Needs billing.manage and clusters.write; the token stands in for the browser route's CSRF double-submit. The change and what it replaced are written to the audit log in the same transaction. Bearer-PAT twin of the browser route of the same name under /org.
PUT
/
api
/
v1
/
org
/
cloud-cost
/
autopilot
/
projects
/
{project_id}
Set a project's cost autopilot tier
import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/autopilot/projects/{project_id}"
payload = { "defaults": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({defaults: {}})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/autopilot/projects/{project_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/cloud-cost/autopilot/projects/{project_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"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
Body
application/json
Response
Successful response
A project's own autopilot defaults (ADR 0022): a layer between a cluster's override and the organisation's defaults.