You can generate vRealize Business for Cloud reports by using public APIs.

About this task

The API is supported with vRealize Automation 6.x and 7.x versions.

Prerequisites

Install the Wget utility.

Procedure

  1. Run the command to generate the token for vRealize Automation and vRealize Business for Cloud authentication.

    wget --no-check-certificate -S -q --header "Accept: application/json" --header='Content-Type: application/json' --post-data '{"username":”<USER_NAME>","password”:”<PASSWORD>","tenant”:”<TENANT>"}' -O - <CAFE_SERVER>/identity/api/tokens, where

    • <USER_NAME> - The user name with administrator permissions to access vRealize Business for Cloud.

    • <PASSWORD> - The password for the administrator account.

    • <TENANT> - The vRealize Business for Cloud registered tenant.

    • <CAFE_SERVER> - The IP address or FQDN of the vRealize Automation server.

    • <vRB_SERVER> - The IP address or FQDN of the vRealize Business for Cloud server.

    You see the following output.

    HTTP/1.1 200 OK
      Server: Apache-Coyote/1.1
      Cache-Control: no-cache, no-store
      Pragma: no-cache
      Expires: Wed, 31 Dec 1969 23:59:59 GMT
      Content-Type: application/json;charset=UTF-8
      Content-Length: 383
      Date: Wed, 25 Nov 2015 17:25:11 GMT
    {"expires":"2015-11-226T01:25:11.000Z","id":
    "MTQ0ODQ3MjMxMTQzMDo2MjlhMWU4MTdhOTEwNTM5Y2MyNzp0ZW5hbnQ6aXRibXN1c2VybmFtZTphZG1pbkBpdGJtcy5jb21AdnNwaGVyZS5sb2NhbGV4cGlyYXRpb246MTQ0O
    DUwMTExMTAwMDpjNTQzNjE3YjM3NDMyZTEwMTI4MzViZDNlYzEyNDA4MGQwMjI5NTVhMTU4OTUxNjM0ZDIzZjlhOTk4OTQ0ZDM5YmY2Y2UwZjUxNDVjYjRhNGUzZWZjMjNmYjM1
    NGRjZDdkYTdlOGJjMzA1MjBhM2ZhZDg0NTdhYmNiMDEwZTA3OA==","tenant":"itbms"}
    

    The ID value is the token to authenticate.

    Note:

    The token has an expiry date.

  2. Run the command to get a custom report or an out-of the-box report.
    • For a custom report, run the following command:

      wget --no-check-certificate -S -q --header "Accept: application/json" --header='Content-Type: application/json' --header="Authorization: Bearer <TOKEN>" -O - https://<VRB_SERVER>/itfm-cloud/rest/reports-api/export-csv?name=<REPORT_NAME>,

      where <Report_Name> is the name you provide for a custom report.

    • For an out-of-the report, run the following command:

      wget --no-check-certificate -S -q --header "Accept: text/plain" --header='Content-Type: text/plain' --header "accept-encoding: gzip" --header="Authorization: Bearer <TOKEN>" -O - https://<VRB_SERVER>/itfm-cloud/rest/reports/export-filters/<OOB_REPORT_NAME>>out.xls,

      where <OOB_Report_Name> can be one of the following values.

      Report Type

      Report Name

      vCenter Server reports

      • servers

      • datastores

      • vsan-datastores

      • vms

      • clusters

      vCloud Director reports

      • vcd-orgs

      • vcd-org-vdcs

      • vcd-vms

      • vcd-vapps

      vRealize Automation virtual machine reports

      vcac-vms

      Storage reports

      • storage-arrays

      • storage-luns

      vCloud Air reports

      • vca-vms

      • vca-vdcs

      • vca-services

      AWS reports

      • aws-resources

      • aws-vms

      Showback reports

      • showback-vms

      • showback-add-svcs

      Budget reports

      rest/budget/export

    The out-of-the report is generated in an XLS file.