Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Development on the Cloud

Adriana Dimitrova edited this page Mar 2, 2018 · 2 revisions

When you have an application or service which is ready to send metering data, you can follow the steps below.

1. Create a Service Instance

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. The service name has to be unique for your space.
    With this step three empty plans will be created.

2. Bind the Service to Your Application

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>

3. Edit your metering plans in 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.

  1. Navigate to the metering plan to maintain the Measures and Metrics of the metering plan.
  2. On the Measures tab, the application developer can add/edit/delete the Measures for the metering plan.
  3. On the Metrics tab, the application developer can add/edit/delete the Metrics for the metering plan.
  4. Navigate to a metric to maintain the details of the metric and its relevant functions - meter, accumulate, aggregate, and summarize.

4. Submit Your Usage

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 Submitting Usage.

5. Develop your application/service to send usage data according to your metric

6. Get your Usage summary report

You can get your usage summary report by using a GET method and the same credentials, used for sending metering data. See Usage Reports.

Clone this wiki locally