import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/cost/estimate"
payload = {}
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({})
};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/cost/estimate', 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/applications/{application_id}/cost/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"change": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"currency": "<string>",
"priced": true,
"unpriced_reason": "<string>",
"monthly_delta_cents": 123,
"current_monthly_cents": 123,
"parked_storage_monthly_cents": 123,
"confidence": "<string>",
"coverage_incomplete": true,
"basis": "<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"
}Estimate what a change to an application costs
Prices a proposed change to an application as the monthly change to its cost. A change to one deployment - its replica count, its per-pod CPU and memory requests, parking it, or promoting a build into it - is read from its object cost projection and moved by the metering’s own allocation rule; a new environment or a database preset is priced on the cluster it would run on as the share that cluster’s latest metering pass would have allocated it, compute only, so a floor. The answer carries the confidence of the snapshot it is read from and how it was reached. A change Ankra cannot price (a namespace another application shares, a cluster with no recent snapshot or none recording its capacity yet, a parked deployment’s size, a workload the cluster has no room for) answers priced false with the reason, never zero. Nothing is stored. Bearer-PAT twin of the browser route of the same name under /org.
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/cost/estimate"
payload = {}
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({})
};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/cost/estimate', 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/applications/{application_id}/cost/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"change": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"currency": "<string>",
"priced": true,
"unpriced_reason": "<string>",
"monthly_delta_cents": 123,
"current_monthly_cents": 123,
"parked_storage_monthly_cents": 123,
"confidence": "<string>",
"coverage_incomplete": true,
"basis": "<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
Body
A proposed change to an application. For replicas, resources, park and promote, cluster_id and namespace name the deployment it changes and are required. For new_environment and database, cluster_id names the cluster the new workload would run on; without it the answer is not known.
Response
Successful response
What a proposed change would do to the application's monthly cost. Priced false leaves monthly_delta_cents and confidence null and names why in unpriced_reason; a priced zero is a change that costs nothing.
What the deployment's storage keeps costing a month once it is parked, in the currency's minor units: the one rounded figure the basis names, and 0 for a deployment with no storage. Only a priced park answers it; it is null for every other change kind and whenever the park is not priced, which is never a cost of zero.