import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/budgets"
payload = {
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', monthly_cents: 123, currency: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/budgets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/cloud-cost/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>"
}
'{
"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"
}Create a cost budget (bearer twin)
Adds a monthly budget for the organisation, one cluster, one environment label or one application. A scope holds at most one budget (409). Audited as create_cost_budget. 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"
payload = {
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', monthly_cents: 123, currency: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/budgets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/cloud-cost/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"monthly_cents": 123,
"currency": "<string>"
}
'{
"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.
Body
Body of POST /api/v1/org/cloud-cost/budgets.
organisation, cluster, environment, application 1 to 120 characters.
The budget in the currency's minor unit; positive.
One of the platform's convertible currencies.
A cluster or application id of the organisation, or an environment label; omitted or null for the organisation.
An active member of the organisation the budget is for.
1 to 100.
Response
Created
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