Community

Get real-time billing insights from your Bluemix account

Share this post:

I’m a Cloud technical sales in SPGI and so I meet current and future Bluemix customers regularly. One of the main questions that usually comes to the forefront during these meetings is how to organize and administrate their BX accounts. Besides, they don’t have a clear process to do the mapping between their company structure and Bluemix Account Hierarchy.

Bluemix Administration

In case you are not familiar with Bluemix administration, let me introduce its components first. A BX account has a two level hierarchy: organizations and spaces. Organizations are divided into spaces and each of these spaces puts a group of services and applications together.

You can get an overview of Bluemix administration at https://myadmin.mybluemix.net

 

Bluemix Account Hierarchy

Bluemix Console: Current Situation

Here is when the customer questions come up since organizations and spaces don’t have the same administration possibilities and there are also different user roles for each level of hierarchy. Throughout this article, I would like to address one of the most frequent questions:

‘I need to manage how my teams use Bluemix and I have already defined one space for each of my team’s projects, so How can I get the billing information by space?’

Today the Bluemix console only shows applications and service usage by organizations. That’s why I decided to create “My Billing App” based on the following customers’ requirements:

  • Users needs to check services and applications costs by spaces and not only by organizations
  • They want to export usage information and share it with other teams of their companies
  • They also need to do a quick usage comparison among spaces using a chart

Technologies

I developed ‘My Billing’ app server-side using NodeJS technology and AngularJS, Bootstrap and ChartJS in the client-side. In order to get the authorization token and the billing information I used the CF REST APIs that also bring users great possibilities of creating customized consoles and processes for Bluemix administration.

Capabilities

As I mentioned before I have developed ‘My Billing’ app based on customer requirements and it has the following capabilities:

  • The application is accessible for IBM and NON IBM users.

Non IBMers login form

To get the authorization token for NON IBM users I send the username and password to the UAA server. (https://api.<region>.bluemix.net/oauth/token)

IBMers login form

To get the authorization token for IBMers I send the IBM SSO passcode to the UAA server. (https://api.<region>.bluemix.net/oauth/token)

  • Users can check monthly applications and services usage for each space within an organization

  • It shows information about which services and applications have been deployed in every space and their usage.

To get the billing information I used the following API https://rated-usage.<regionID>.bluemix.net/v2/metering/organizations/<region>:<orgUID>/usage/yyyy-mm

  • Monthly usage comparison data is displayed in a single chart
  • Data can be exported to a CSV or EXCEL file

Access and Download My Billing App

I have deployed ‘My Billing’ app in Bluemix and it is available here.

In case you want to deploy your own instance of ‘My Billing app’,  you can download or fork the project from GitHub.

IBM Cloud IT Specialist

More Community stories
August 3, 2018

Five Exciting Things About Istio v1.0

Istio, an open platform to connect, secure, control, and observe microservices, was launched on May 24, 2017, with joint force by IBM, Google, and Lyft. Over the last year, numerous new features and improvements have been made to get to the current production-ready version 1.0.

Continue reading

July 18, 2018

Part III: Wimbledon Facebook Bot on IBM Cloud

Delivering at scale: In the final part of the series, we discuss integrations with on-site systems at the All England Club and how we used Multi-Region within IBM Cloud to ensure scale and availability.

Continue reading

July 12, 2018

Db2 on Cloud Announces Disaster Recovery Node

The Db2 on Cloud team is excited to announce Disaster Recovery (DR) capabilities for Db2 on Cloud. It leverages Db2's HADR technology and lets users add a DR Node on demand in an offsite data center of their choice. In an unlikely event where the primary data server is affected by external circumstances, such as a natural disaster, users can failover to their Geo-Replicated Disaster Recovery Node with a few clicks.

Continue reading