VMware Aria Operations REST API – REPORTS

Hello! In this rather quick guide I want to show you how you can quickly retrieve Aria Operations Reports using its REST API in 4 Steps.

Luckily there is a good swagger documentation around that can be accessed on this URL:
https://<aria operations url>/suite-api/doc/swagger-ui.html

But now lets get into it:

1. Authentication

The authentication is handled via token that can be acquired on following endpoint:

POST https://<aria operations url>/suite-api/api/auth/token/acquire
Body of the request:

{
  "username" : "",
  "authSource" : "<domain name or local for local auth>",
  "password" : ""
}

This post call will provide a token which need to be used from now on for all other calls.

2. Retrieve data about ReportDefinitions

GET https://<aria operations url>/suite-api/api/reportdefinitions?name=my+capacity+report

Add this as Header Parameter:

Authorization: vRealizeOpsToken <token from privous call>

The name filter is optional but helpful in case you have many reports or you want to retrieve the reportdefinition Id of a single report.

3. Execute a report

POST https://<aria operations url>/suite-api/api/reports

Keep the header paramter:

Authorization: vRealizeOpsToken <token from privous call>

The reportDefinitionId can be retrieved from privouse call and the resourceId describes the resource on which the report should be executed. Therefore I would recommend you to run manually a report on the desired resource and to gather the ID with the GET method:
GET https://<aria operations url>/suite-api/api/reports

The body for the POST call should look like this:

{
  "resourceId" : "<resource ID>",
  "reportDefinitionId" : "<reportDefinitionId>",
 }

This call returns the ID of the report.

4. Download the Report

Final step is to download the report. Herby you can specify the format.
The default is PDF! If you want CSV it must be specified.

GET https://<aria operations url>/suite-api/api/reports/<Report ID>/download?format=csv

Remeber to keep the token set in the header.

Authorization vRealizeOpsToken <token from privous call>

The report ID can be obtained from step 3 or via a new call:

GET https://<aria operations url>/suite-api/api/reports

Some reports take a while until they are finalized. While they are still running they will return status “QUEUED”. So this need to be handled in some way when putting all calls together.