-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

VMware vRealize Orchestrator Cookbook
By :

In this recipe, we will take a quick look at how to turn a string into an Orchestrator object (such as VC:VirtualMachine
). This technique is rather important when you use REST to start workflows.
We only need the Orchestrator Client with the right to create a workflow.
In this example, we turn a string into VC:VirtualMachine
:
Create a workflow with a string input (vmString
) and a VC:VirtualMachine
output (vmObject
).
Add a scriptable task and connect the in- and output parameter.
In the script, enter the following code:
query = "xpath:name='" + vmString + "'"; vms=Server.findAllForType("VC:VirtualMachine", query); vmObject=vms[0];
Run the workflow and enter a Virtual Machine name.
Check the output and logs.
The find
function looks for all elements of a given type and can be limited using a search
function. It's very important to write the correct type and the search string.
The next important...
Change the font size
Change margin width
Change background colour