Get application service usage
import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/applications/{application_id}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/service-admission/applications/{application_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/service-admission/applications/{application_id}/usage \
--header 'Authorization: Bearer <token>'{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"granularity": "month",
"group_by": "meter",
"lines": [
{
"meter": "worker_vcpu_hours",
"unit": "vcpu_hours",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_name": "<string>",
"is_shared": true,
"quantity": 123,
"coverage": "complete",
"price_state": "included",
"price_basis": "pilot",
"amount_minor": 123,
"currency": "EUR"
}
]
}Usage
Get application service usage
The instance time and storage of every managed service instance whose reviewed plan serves the application, one line per instance, meter and period. An instance that serves other applications too says so with is_shared. Included during the pilot: no amount. Requires billing.read and applications.read.
GET
/
api
/
v1
/
org
/
service-admission
/
applications
/
{application_id}
/
usage
Get application service usage
import requests
url = "https://platform.ankra.app/api/v1/org/service-admission/applications/{application_id}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/service-admission/applications/{application_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/service-admission/applications/{application_id}/usage \
--header 'Authorization: Bearer <token>'{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"granularity": "month",
"group_by": "meter",
"lines": [
{
"meter": "worker_vcpu_hours",
"unit": "vcpu_hours",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instance_name": "<string>",
"is_shared": true,
"quantity": 123,
"coverage": "complete",
"price_state": "included",
"price_basis": "pilot",
"amount_minor": 123,
"currency": "EUR"
}
]
}Authorizations
Query Parameters
Response
The usage report.
What the organisation used of Ankra over a window, one line per meter, period and group. Usage nobody measured is never shown as zero: a line whose every hour was unmeasured is unknown and has no quantity, and one measured in part is partial and its quantity a lower bound. Only a line Ankra has a published rate for carries an amount; during the managed services pilot nothing else is billed (Terms clause 8.8).