How to generate range of monthly reports from vCloud Usage Meter CLI
search cancel

How to generate range of monthly reports from vCloud Usage Meter CLI

book

Article ID: 337125

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

This article provides steps to generate a report with more than one month of data or a specific date range in VMware vCloud Usage Meter.

Environment

VMware vCloud Usage Meter 3.3.x

Resolution

To generate a report with a custom date range:
  1. Connect and acquire token.

    1. Sign in to the Usage Meter appliance using SSH.
      • vCloud Usage Meter 3.3.x - Use the root account.
      • vCloud Usage Meter 3.4.x - Use the usgmtr account.

    2. Run this command:

      umtoken

      This will output the token for this session. VMWare recommends to use an application that allows you to copy from the command line.

  2. List and select the report to be generated.

    To list and select the reports, run the following command by copying the token from the previous steps into < token> and replace the < UM IP> with the FQDN or IP of the Usage Meter appliance:

    curl -v -k -H x-usagemeter-authorization:<token> https://<UM IP>:8443/um/api/reports

    A list of reports is displayed that changes by version but follows the convention.

    For example:

    <link href="/api/report/1" method="get" rel="Detailed Billing">

    Where, rel= is the name of the report and the number in the href= is the report identifier.

    In this example, the report name is Detailed Billing and the report identifier is 1.

  3. Generate selected report with custom date range.

    1. Change directory to the temporary folder using the command:

      cd /tmp

    2. Copy the following command into the SSH session.

      curl -v -k -H x-usagemeter-authorization:<token> https://<UM IP>:8443/um/api/report/<Report ID>?dateFrom=yyyymmddhh\&dateTo=yyyymmddhh > Report.tsv

      1. Copy the token from the previous steps into <token> and replace the <UM IP> with the FQDN or IP of the Usage Meter appliance.
      2. Replace <Report ID> with the report identifier found in the previous steps.
      3. To set the dates, replace yyyymmddhh with the desired date and hour.

        For example, April 1st 2016 at 12:00am would be 2016040100.

        Note: This generates a file using Tab Separated Values (TSV).

    3. Use SFTP or WinSCP to copy the Report.tsv from the appliance.