Reputation: 41
Is there a way to programmatically (via REST api) access the usage of service within a public bluemix account?
Does Public Bluemix exposes API to access the usage history of bluemix account
Upvotes: 0
Views: 316
Reputation: 1787
Updated answer:
You can use the following Bluemix CLI command to retrieve the monthly usage and costs of your account:
bluemix bss account-usage [-d YYYY-MM] [--json]
Prerequisites: Endpoint, Login
Command options:
-d MONTH_DATE (optional)
Display data for month and date specifying by using the YYYY-MM format. If not specified, usage of the current month is shown.
--json (optional)
Display the usage result in JSON format.
Here's an example that show an account usage and cost report in 2016-06:
bluemix bss account-usage -d 2016-06
If you run the command with "export BLUEMIX_TRACE=true”, you can see the API endpoints that are being used.
There are other commands and more information available at the following URL:
https://console.ng.bluemix.net/docs/cli/reference/bluemix_cli/index.html#bluemix_bss_account_usage
Upvotes: 1