VMware Cloud Community
Batmergen
Contributor
Contributor
Jump to solution

VRO/VRA8 How to use "Invoke a REST operation" as a custom resources or as a subscription

I want to invoke a rest operation to ansible when I provision a VM to do more configuration on the VM. 
When I add Invoke a REST operation workflow as a custom resources it says:
"The currently selected create workflow does not return a single instance of an SDK object type. Please select a workflow which has at least one singular (no 'Array/' prefix) SDK object type output parameter."

Batmergen_0-1633316836481.png

I've added the workflow as a subscription but I’m having trouble figuring out how to send the required inputs to Invoke a REST operation workflow. 

Batmergen_1-1633317002488.png

I know it's GET method at the moment but if I know how to send the required parameters I think it's pretty much the same.
How to tell the workflow that I want to invoke a REST on this particular ansible host?
How to choose this operation? /job_templates/{ans_job_id}/launch/
I think it requires param_0 as {ans_job_id}. How to declare this parameter in my vra blueprint

0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

First, you need an Event Broker Subscription and not a Custom Resource (in fact, you can use custom resources but that solution is much more complex).

You need to create a wrapper workflow for Invoke a REST operation, and within that wrapper workflow you extract information of the given VM and pass it as parameters to the REST workflow. See Create a Wrapper Workflow and vRA 8 Event Subscriptions - YouTube

View solution in original post

0 Kudos
1 Reply
xian_
Expert
Expert
Jump to solution

First, you need an Event Broker Subscription and not a Custom Resource (in fact, you can use custom resources but that solution is much more complex).

You need to create a wrapper workflow for Invoke a REST operation, and within that wrapper workflow you extract information of the given VM and pass it as parameters to the REST workflow. See Create a Wrapper Workflow and vRA 8 Event Subscriptions - YouTube

0 Kudos