import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/budgets/{budget_id}"
payload = {
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notify_at_pct": 80
}
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({
name: '<string>',
monthly_cents: 123,
currency: '<string>',
owner_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
notify_at_pct: 80
})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/budgets/{budget_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/budgets/{budget_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notify_at_pct": 80
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scope_kind": "organisation",
"scope_id": "<string>",
"scope_name": "<string>",
"monthly_cents": 123,
"currency": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notify_at_pct": 123,
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"month": "<string>",
"projection": {
"status": "under",
"month_to_date_cents": 123,
"projected_month_end_cents": 123,
"percent_of_budget": 123,
"crossing_at": "2023-11-07T05:31:56Z",
"running_savings_monthly_cents": 123,
"after_running_changes_cents": 123,
"priced_cluster_count": 123,
"unpriced_cluster_count": 123,
"complete": true,
"currency": "<string>"
}
}{
"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"
}Change a cost budget (bearer twin)
Changes a budget’s name, amount, currency, owner or notify threshold; a field left out keeps its value and owner_user_id null clears the owner. A budget’s scope never changes: naming scope_kind or scope_id is refused. Audited as update_cost_budget with what it replaced. Gated on billing.manage; the token stands in for the browser route’s CSRF double-submit. 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/budgets/{budget_id}"
payload = {
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notify_at_pct": 80
}
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({
name: '<string>',
monthly_cents: 123,
currency: '<string>',
owner_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
notify_at_pct: 80
})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/budgets/{budget_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/budgets/{budget_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notify_at_pct": 80
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scope_kind": "organisation",
"scope_id": "<string>",
"scope_name": "<string>",
"monthly_cents": 123,
"currency": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notify_at_pct": 123,
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"month": "<string>",
"projection": {
"status": "under",
"month_to_date_cents": 123,
"projected_month_end_cents": 123,
"percent_of_budget": 123,
"crossing_at": "2023-11-07T05:31:56Z",
"running_savings_monthly_cents": 123,
"after_running_changes_cents": 123,
"priced_cluster_count": 123,
"unpriced_cluster_count": 123,
"complete": true,
"currency": "<string>"
}
}{
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
The budget's id.
Body
Body of PUT /api/v1/org/cloud-cost/budgets/{budget_id}; a field left out keeps its value, owner_user_id null clears the owner.
Response
Successful response
A monthly cost budget for one scope with its month as of the read.
organisation, cluster, environment, application The cluster or application id, or the environment label; null for the organisation.
What the scope is called now; empty for a cluster or application the organisation no longer has.
The budget, in currency.
Who the budget is for.
The share of the budget the projection must reach for the budget's card (cost_budget_crossing) to be raised.
The UTC month the projection is for, YYYY-MM.
A budget's month as of the read, in the budget's currency. Every figure is null while the scope has no priced cluster (status unknown): an unread month is not a month with no spend.
Show child attributes
Show child attributes