-
Notifications
You must be signed in to change notification settings - Fork 86
Development Tutorial
When you have an application or service which is ready to send metering data, you can follow the steps below. You can refer to the broker test app as an example.
Two demo videos showing the steps below are also available:
- A demo video showing how to update your metering plan in the dashboard.
- A demo video showing how to create and update your metering service instance plan definition via the command line.
You can also see the Metering with Abacus Simple Demo project on how to send usage data to Abacus to meter the usage of a service or application. The README.md explains what the demo does, how to build and run it, how to use its UI, some hints on implementations, as well as some basic information about Abacus and the most important terms related to the submission of usage data.
In order to create the service you need to run the following commands:
-
cf marketplace
-
cf create-service metering standard <myservice>
, where<myservice>
is the name of your service.
ℹ️ You could also provide your metering plan configuration via the-c
option ofcf create-service
command as described under Use Abacus Broker.
Execute:
-
cf bind-service <myapp> <myservice>
, where<myapp>
is the name of your application.
To update your environment and enable your app to access the service instance, execute:
cf restart <myapp>
I. From the Dashboard
The dashboard shows the metering plan for the resource provider application that is bound to the service instance. The metering plan has a sample Measure and a sample Metric.
- Navigate to the metering plan to maintain the Measures and Metrics of the metering plan.
- On the Measures tab, the application developer can add/edit/delete the Measures for the metering plan.
- On the Metrics tab, the application developer can add/edit/delete the Metrics for the metering plan.
- Navigate to a metric to maintain the details of the metric and its relevant functions - meter, accumulate, aggregate, and summarize.
Note: The abacus wiki provides sample plans. If you decide to use them keep in mind that you don't need to convert the plan toString() as this is done implicitly by the dashboard for you.
II. Using the CF CLI
To update your metering plan using the cf CLI use the cf update-service
command as described under Using-the-Project.
In order to submit a usage document, use the insert method, described in the API doc with the URL of the Usage Event Collector. You can see the structure of the data which is to be sent through a Usage Document here. See Use Abacus Broker.
You can get your usage summary report by using a GET method and the same credentials, used for sending metering data. See Usage Reports.
ABOUT | RESOURCE PROVIDER | ABACUS INTEGRATOR
*Abacus icon made by Freepik from www.flaticon.com