vRealize Orchestrator 7 User Guide: Running Custom REST API Operations
For the most part, Pure Storage introduced a plugin for vRealize Orchestrator so that customers did not have to manually understand the underlying REST APIs. By creating inventory synchronization, actions, and workflows, the need to delve into the REST API is minimal. In general, follow the instructions here first if you feel the need to make custom REST calls in vRO.
vRealize Orchestrator 7 User Guide: Workflows
With that being said, not every REST operation is built into the vRO plugin, and often underlying feature support in the plugin might not arrive in time to coincide with your need for it. To give customers a simpler to use option, the plugin offers two workflows to run direct REST operations against Pure Storage platforms--one for the FlashArray or Cloud Block Store, and one for the FlashBlade.
This allows users to take advantage of the native plugin authentication but still have full access to the underlying REST API of the Pure Storage platforms.
Running Custom REST API Operations against the FlashArray or Cloud Block Store
Before you can run a REST API operation, you must authenticate first against a target. This is described in detail here:
vRealize Orchestrator 7 User Guide: Authentication
Once complete, you can run the REST API workflow against a FlashArray or Cloud Block Store platform.
To run a REST API operation, right-click on the workflow Run REST API un the FlashArray REST APIs folder and click Start Workflow.
The first step is to choose a FlashArray target:
1) Click to choose a FlashArray | 2) Choose a FlashArray object | 3) Click Next |
![]() |
![]() |
![]() |
The next step is to configure the REST operation. The FlashArray REST API documentation can be found in a few places:
- The support site: https://support.purestorage.com/FlashArray/PurityFA/Purity_FA_REST_API/Reference/FlashArray_REST_API_PDF_Reference_Guides
- Your FlashArray Web Interface. Click Help -> REST API Guide
Run Basic REST Operations
Once you have identified the operation, go back to vRO. Enter the resource URI. This includes the root object and any parameters, filters, or sorts. The workflow automatically adds the FlashArray address and REST version.
So if you want to pull all volumes from a FlashArray you would enter /volume (don't forget the preceding forward slash) and choose GET and click Submit (note that this is a default workflow--use that instead of doing it here, using this though as a simple example).
If you want to pull the space stats of a volume named activeDRpodA::ActiveDRVMFS-01 and with a query parameter of ?space=true
Run REST Operations with a JSON Request Body
If you are executing a REST operation that requires a body, you can paste it into the Request Body input. So for instance, the creation of a volume. While this is a default workflow and that should be used instead of a custom REST operation, this is just an example.
Creation of a volume is a POST operation with a resource URI of /volume/<volume name> with a JSON body of {"size":"10T"}. So if I want to create volume called newvol-vro01 that is 1 TB in size:
If I want to create a volume named newvol-vro02 with a 1 GB/s bandwidth limit that is 10 TB in size:
The workflow logs the response:
Integrating a REST Operation into a Workflow
Though the most likely scenario is that this response is passed into some other custom workflow of your creation. So the REST response is also stored in an output variable called actionResult:
So if you include this in your workflow you would pass that output into your next item:
The response is returned in a JSON form, so to easily manipulate the data returned, it should be parsed and converted into a Javascript object. The best method for this is to use the JSON.parse() operation.
var restResponse = JSON.parse(actionResult);
So to pull the volume capacity metrics and print out the data reduction ratio the Javascript would be:
var restResponse = JSON.parse(actionResult); System.log("The volume named " + restResponse.name + " has a data reduction ratio of " + restResponse.data_reduction + " to 1");
So with the following request:
The resulting log would be: