vRealize Orchestrator – VCO CLI setup and use cases

I wanted to understand how to get more of a IDE user experience when using vRealize Orchestrator and a colleague mentioned the VCO CLI tool found here – https://labs.vmware.com/flings/vco-cli. Its a plugin you install via the vRO configuration and a batch file that launches a vCO CLI GUI. Whilst I wouldn’t classify the VCO CLI tool and a classic IDE or a tool that you should develop workflows in, it does offer IDE auto complete to 2nd level and deeper methods, attributes and properties, whereas the vRealize Orchestrator client only offers top level IDE autocomplete on object types it knows about configured as inputs or attributes.

vCO CLI setup

To set up the VCO CLI tool, you need java 1.7 installed (although I’ve not tested with other versions). It’s also important you have you java home directory set in your environment variables.

Screen_Shot_2015-03-08_at_18_45_56

Then download the VCO CLI package and install the plugin using vRO Configurator

vco-plugin

Then once you have the plugin installed, you need to then open up the vRealize Orchestrator and run the vCO CLI Start Session workflow:

Screen Shot 2015-03-08 at 19.20.12

Once you have a session started, you can then connect to that session when you run the vCO CLI GUI. To run the vCO CLI GUI, go to the folder you have downloaded and unzipped the vCO CLI zip file and run the vcocli-gui bat file. This should open up the vCO CLI GUI tool.

Screen Shot 2015-03-08 at 19.16.26

Click on the attach button and a window will appear listing all the open sessions that are available to connect to and you should see the one you started when you ran the vCO CLI Start Session workflow.

vco-cli-session

This should now open the vCO CLI GUI tool. (click to enlarge)

Screen Shot 2015-03-08 at 20.03.41

Using vCO CLI

So now we have a vCO CLI client running, we can see how the nested dot notations work. Take this code for example:


var catItems = Server.findAllForType("vCACCAFE:CatalogItem");

for each (var catItem in catItems){
catItem.name + " " + catItem.status.value();
};

When using the vCO CLI tool, we get auto complete on the available attributes and methods. Here’s a screen shot showing an example with the code above:

Screen Shot 2015-03-08 at 19.43.24

auto complete of catItem

Screen Shot 2015-03-08 at 19.44.16

auto complete on catItem.status

If you look at the API browser, you’ll see the same methods and attributes.

Also,  check the output of the code when I run it. This appears in the output window in the vCO CLI GUI.

Screen Shot 2015-03-08 at 19.46.43

You can see that is outputs the results without having to use the System.log() method.

If I try to use auto complete on catItem in vRealize Orchestrator like I have done in vCO CLI, I just get the old familiar error message:

Screen Shot 2015-03-08 at 19.48.07

Great!

So my conclusion is that the vCO CLI tool is really good if you want to write code quickly without having to browse the API explorer or keep using System.log() to see the output. What this can do is make writing code quicker, however it’s not a substitute to vRealize Orchestrator and you have to cater when using the object types by using Server.findAllForType(“vCACCAFE:CatalogItem”), where in vRealize Orchestrator we can use inputs or attributes and specify our type there and we do get auto complete on these object types and scripting classes in vRealize Orchestrator, but only at the top level. So having said that, I would love to see this type of auto complete feature that is offered vCO CLI in the vRealize Orchestrator client and then everyone’s a winner, well apart from the vCO CLI GUI 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s