VMware Aria Operations Cloud Operations VMware Aria

VCF Operations – How to run a report on the last day of the month

Context

Customers are generating a variety of IT Operations Management reports through the VCF Operations user interface. One key requirement is the ability to generate reports on the last day of the month, as this would provide a comprehensive month-to-date report for the entire month.

The VCF Operations product allows users to schedule reports; however, as of version 8.18.3, scheduling reports to run on the last day of the month is not supported through the user interface. Since the last day of the month varies (e.g., January has 31 days, February has 28 or 29 days, and April has 30 days), selecting a specific day, like the 31st, as a recurrence option doesn’t work for all months. Below is a screenshot of the report schedule definition in the VCF Operations 8.18.3 user interface.

Solution

The following are some of the solutions for generating a report on the last day of the month:

  1. Schedule report to run daily
  2. Run the report directly in the user interface on the last day of the month
  3. Automate report generation using the VCF Operations REST APIs and an external program

Schedule report to run daily

While scheduling the report to run daily addresses the issue of generating a report on the last day of the month, it also results in unnecessary report generation on other days of the month.

Run the report directly in the user interface on the last day of the month

While running a report directly in the user interface manually on the last day of the month is one of the viable options, it requires manual human interaction.

Automate report generation using the VCF Operations REST API and an external program

The VCF operations REST APIs can be used to automate report generation on the last day of the month using an external program. This external program can be written in any programming language that can invoke REST APIs.

Here are the high level steps to be performed in the external program to automate report generation on the last day of the month:

  1. Get ID of the report definition
VCF Operations REST API DetailsValues
Endpoint/api/reportdefinitions
MethodGET
Parameters“name” array containing report definition/template name. Refer to the API documentation for the other parameters that can also be used. 
ResponseGet ID of the report definition from the response
  1. Get resource ID for the object on which the report definition must be run
VCF Operations REST API DetailsValues
Endpoint/api/resources
MethodGET
Parameters“name” array containing resource name. Refer to the API documentation for the other parameters that can also be used. 
ResponseGet value of the “identifier” key in the JSON response.
  1. Generate a report on the last day of the month using the report definition ID and the resource ID that were retrieved in earlier steps. Determining the last day of the month must be handled within the external program.
VCF Operations REST API DetailsValues
Endpoint/api/reports
MethodPOST
Body{  “resourceId” : “c40bb51e-34f7-4864-b540-bbb8420d6288”,  “reportDefinitionId” : “59c32c79-adea-4c58-bb6f-56daa23bcb5e”  }
Replace resourceId and reportDefinitionId values using the values from earlier steps.
ResponseExtract report ID from the JSON response.
  1. Download the report using the report ID from the earlier step.
VCF Operations REST API DetailsValues
Endpoint/api/reports/{id}/download
MethodGET
ParametersFormat: PDF or CSVId: 6758cdf1-361c-4d6a-a5f2-1f854c85d225
Replace value for ID parameter using the extracted ID value from the JSON response. 
Response bodyFile