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"
}
]
}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.
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
First UTC day to read, YYYY-MM-DD. Defaults to the first day of the current month. Not after today, and not more than 400 days back (how long usage is kept).
The day after the last UTC day to read, YYYY-MM-DD. Defaults to tomorrow. At most 93 days after from; a longer stretch is read in parts.
Period length of each line.
month, day 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).
Start of the window: midnight UTC of the first day read.
End of the window: midnight UTC after the last day read, or the time of the request when that is earlier - usage that has not happened is not reported.
The length of each line's period: a calendar month or a UTC day, cut to the window at either end.
month, day What the lines are split by. The per-instance and per-application reads are always split by instance.
meter, cluster, application, instance Ordered by meter, then group, then period. Grouped by meter, every meter answers every period, even with nothing used. Grouped by cluster, application or instance, a group that used none of a meter in a period it was fully measured has no line.
Show child attributes
Show child attributes