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,
"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,
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
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.
The kind of change.
replicas, resources, park, promote, new_environment, database The cluster the deployment runs on, or for new_environment and database the cluster the new workload would run on.
The namespace the deployment runs in.
The proposed replica count, for replicas (0 to 1000); for new_environment (1 to 1000) it replaces the application's own.
The proposed CPU request per pod, for resources (a Kubernetes quantity such as 500m); for new_environment it replaces the application's own.
The proposed memory request per pod, for resources (a Kubernetes quantity such as 512Mi); for new_environment it replaces the application's own.
For database, the managed service engine the preset installs, such as service-postgresql (the default).
For database, the preset's plan parameters, such as instances, cpu_millicores and memory_mib; the engine's defaults fill what is absent.
Show child attributes
Show child attributes
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.
The reader's display currency; every *_cents figure is in its minor units.
How much more (positive) or less (negative) the application would cost a month after the change.
The deployment's cost a month today, compute and storage, as the object projection counts it; null when it is not known, and for a new environment or a database, which do not run yet.
The pricing coverage of the snapshot the figure is read from: high, medium or low.
The figure is a floor: the snapshot left something unpriced, or, for a new environment or a database, storage it would claim is not included.
How the figure was reached, in a sentence or two.