September 29, 2017 | Written by: Maria Borbones Garcia
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.
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 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
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.
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.
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)
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.