import requests
url = "https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/usage"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/usage \
--cookie ankra_session={
"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 managed service instance usage (browser session)
A managed service instance’s instance time and storage, one line per meter and period. Instance time runs from the instance’s deployment to its release and is counted while its cluster could be seen; storage is what the bound volume claims in its namespace requested. Minutes the platform could not see read unknown, never zero. Included during the pilot: no amount. Requires billing.read, and that the instance be visible to the caller as GET …/instances/ decides.
import requests
url = "https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/usage"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/service-admission/instances/{instance_id}/usage \
--cookie ankra_session={
"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).