Integrating a REST Operation into a Workflow

User Guides for VMware Solutions

Audience
Public
Content Type
User Guides
Source Type
Documentation

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: