cloudsoft.io

Usage Metering Automation

The purpose of the metering microservice is to:

  • Provide distributed AMPs an endpoint to record entity and location usage
  • Provide a management endpoint that can be queried to retrieve the usage information

The following sections provide details about it, how to deploy it and configure AMP to use it.

Quick Install

You can deploy it using this blueprint or you can run it as a standalone service:

 java -jar target/metering-microservice-1.0-SNAPSHOT.jar 
 --spring.datasource.username=[username] 
 --spring.datasource.password=[password] 
 --spring.datasource.url=jdbc:mysql://localhost:3306/mydb
 --security.user.password=[password]

Setting up AMP to use the metering microservice

 brooklyn.usageManager.listeners=io.cloudsoft.metering.MeteringPusher
 amp.metering.listener.ampId=my_amp_id_1
 amp.metering.listener.push.endpoint=http://192.168.0.1:8080
 amp.metering.listener.push.username=example_username
 amp.metering.listener.push.password=example_password

Full Installation Docs

This guide will help walk you through the necessary steps to install and run the metering microservice.

Prerequisites

As a customer of AMP you should have access to the cloudsoft-amp-all tarball. If you do not have access to this, please contact Cloudsoft. Ensure that this tarball has been expanded and is in an accessible place.

Ensure that you have an up to date BR CLI installed. If you do not, the quickest way to get one is to go to your running AMP server, select the menu icon in the top right and select the CLI download page. From that page, please select the flavour that will work with your operating system.

Installation

In the expanded cloudsoft-amp-all directory, navigate to:

extras/metering-microservice-{version} 

In this folder you will find a file named metering-microservice-jar-{verison}.jar. This jar is the stand-alone metering microservice application. Please host this file in a location that is accessible to the cloud in which you are going to deploy the microservice. For example, it could be hosted in an S3 bucket or your enterprise’s artifact repository.

Once that has been done we need to add the metering bundle to your running AMP. This bundle contains the entities required to deploy the microservice from AMP. Please use the BR CLI to login to your AMP server:

br login http://localhost:8081

Then add the metering microservice bundle to your AMP:

br catalog add metering-microservice-bundle-{verison}.jar

Running

To create an instance of the metering microservice, navigate to the home page of your AMP server. In the quick launch section, find and select the metering microservice icon. You will be presented with a dialog box. Please enter the location in which you want to run the microservice. Also, please enter the URI of the metering-microservice-jar (this will have been made accessible in the Installation section). After selecting deploy, your AMP will setup the metering microservice in your target location.