So you want to run a vRB report via a vRO workflow and not a vRA report?
If it is vRB (ITBM) then you can do this using the API of vRB, the documentation actually contains an example of how to do this using REST calls without vRO (Use Public API to Generate vRealize Business for Cloud Reports).
You can wrap these REST calls into vRO workflows easily enough, I did something similar for a customer by creating a vRO workflow that was published into vRA as an XaaS blueprint so they could request a report from the vRA catalog page by selecting a report and the email address to send it to
Things to note/be awae of:
- The name of the report had to be entered manually, or stored in vRA as a static list. I did not find an API to allow me to pull out a list of possible report names from vRB, the APIs for vRB are not all publicly available for use unlike vRA.
- The report had to be exported from vRB and passed to vRO in the response of the REST call so it could then be saved locally and emailed by vRO. I could not make vRB send the report itself (like you can do in the GUI for 7.3). This means the report is saved to the local vRO file system and has to be deleted once emailed to keep things clean.
- You need to copy the out of the box vRO workflow for sending a notification to allow you to send an attachment with the email
I can't provide a copy of the workflow but can tell you the general steps used and the key api calls you need (values in <> would be attributes within your workflow containing the relevant values:
- Get authorisation token from vRA by sending a POST request to vRA API
https://<vra fqdn>/identity/api/tokens)
- with a content value of
'{"username": "' + <username> + '","password": "' + <password> + '","tenant": "' + <tenantName> +'"}'
The token is contained in the response as the id field. - Request the report from vRB by sending a GET request to vRB API
https://<vRB fqdn>/itfm-cloud/rest/reports-api/export-csv?name=<report name>
Pass in the vRA token value in the headers of this request as a value of "Bearer " + <token value>
and a label of "Authorization" . The contentAsString value provided by the request contains the report data - Save the report data to a csv value (vRO doesn't support office file extensions, you could also use txt file if it made more sense for the report you are using). I suggest using the temp directory of vRO as the location to save the file into. I used the FileWriter method to create the file.
- Email the saved report as an attachment. As mentioned I cloned the out of the box workflow and then added a line like the one below to allow the attachment to be included with the attribute <attachment> set as a MimeAttachment type in vRO
message.addMimePart(<attachment>, "application/json; charset=UTF-8")
- Delete the saved report from the vRO file system. I used the File method here, checking if the file exists first and then again once the deletion was completed to make sure it was gone.