Flow, how does it tie together?

Documentation

Writing code

The vROAST team advises VS Code as the editor of choice, download here.
After cloning the GIT repository you end up with a directory structure like this:

 

The ‘action’ subfolder holds a folder structure similar to the vRO UI, with categories as folders and actions as (typescript) files.

 

The *.ts files in this folder structure are editable. The code structure of a file must follow this template:

/// <reference path="./../../includes.d.ts"/>

namespace <folder name here> {
	export function <action name here>([arguments go here]): [return type here] {
	}
}

So a simple action would be this:

 

There are a few restrictions to take into account:

  • The namespace must match the folder name (category) exactly
  • The first ‘/// <reference‘ line is mandatory
  • The function must be exported
  • Arguments must all be nullable (the ? after the name)
  • Changes to actions in the ‘com.vmware.*’ namespace will never be synced to vRO

 

After pushing your changes to GIT vROAST will create a vRO action from your typescript file. This is how your typescript file maps to your vRO action:

back to top

Executing actions

The vROAST CLI has the ability to execute actions on the fly using:

vRoast exec -c [job config name] -f myacion.ts

 

Which will give you the actions output on the command-line.

 

Your cloned GIT repository comes with a predefined .vscode/tasks.json which will make it more convenient to run this on the currently selected file in VS Code. First make sure the .vscode/tasks.json has the correct path to your vROAST CLI and job configname. Select the file you want to execute, and press CTRL-SHIFT-P in VS code.

And select ‘Run task’, this will give you a list containing ‘vRO execute’, choose that:

 

If you need to provide values for the inputs, you can place a <filename>.ts.json next to your ts file with json content as input, like this:

 

In the case of a complex type you must use the ‘Id’ of that object as a string value. Arrays of complex types are not yet supported.

back to top

Troubleshooting

Sync jobs are run by a task scheduler (typically every minute). The task scheduler has a portal where the basic logging of tasks can be monitored. The portal is opened by after logging in by browsing to the ‘Jobs dashboard’ from the operations menu. Here you want to select the latest completed job:

Which will provide basic logging on the bottom:

 

More detailed logging is provided by the log files that can be downloaded from the portal start page here:

back to top