Skip to content

Instantly share code, notes, and snippets.

@trisharia
Last active March 28, 2017 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trisharia/6f4c914d3602771241457c10e3376c71 to your computer and use it in GitHub Desktop.
Save trisharia/6f4c914d3602771241457c10e3376c71 to your computer and use it in GitHub Desktop.
Get the entitied actions of a vRA Catalog Resource
// VMware vRealize Orchestrator action sample
//
// Gets the entitied actions of a vRA Catalog Resource
//
// For vRO/vRA 7.0+
//
// Action Inputs:
// catalogResource - VCACCAFE:CatalogResource - catalog resource
//
// Return type: Array/VCACCAFE:CatalogResourceActions - actions of the catalog resource
var actions = new Array();
var operations = catalogResource.operations;
var action;
// Traverse all operations of the catalog resource and get each corresponding action:
if (operations) {
for each (op in operations) {
try {
action = vCACCAFEEntitiesFinder.getCatalogResourceAction(catalogResource, op.Id);
System.debug("Action available on this catalog resource: "+ action.name + " (" + action.id + ")");
actions.push(action);
} catch (e) {
System.warn("No catalog resource action found for operation "+ op.name);
}
}
} else {
System.warn("No actions available for catalog resource.");
}
return actions;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment