-
Notifications
You must be signed in to change notification settings - Fork 86
Under the Hood
What has actually happened? Let's dig a bit deeper to get some idea how Abacus works.
Dashboard reported new usage data via Abacus API. The document we submitted to Abacus, contains 100 API calls value. Abacus updates its stored aggregated usage data for that resource with the value we provided.
The rest of the fields in the usage document are used to specify who made the API calls (organization_id
, space_id
, consumer_id
) and when did this happen (start
and end
).
The payload looks like this:
{
"start": 1515159737498,
"end": 1515159737498,
"organization_id": "idz:sampleIdentityZoneId",
"space_id": "sampleSpaceId",
"consumer_id": "sampleConsumerId",
"resource_id": "6d79654d-8344-4c08-8117-7f5157d50b2e",
"plan_id": "standard",
"resource_instance_id": "sampleResourceInstanceId",
"measured_usage": [
{
"measure": "sampleName",
"quantity": "100"
}
]
}
Our demo application queries the current monthly usage via the Abacus API. We use the same user we send usage with.
The usage is per organization_id
so we need to provide the same ID for which we submitted usage. Hence the URL for getting the usage contains the ID https://abacus-broker-test-app.<domain>/summary/idz:sampleIdentityZoneId
To update the aggregated values Abacus uses formulas defined in a "plan". We reference to the plan in the payload above, using the plan_id
and resource_instance_id
.
<< Quick Start | Create a Resource Provider>> |
---|
ABOUT | RESOURCE PROVIDER | ABACUS INTEGRATOR
*Abacus icon made by Freepik from www.flaticon.com