Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@trisharia
Last active March 25, 2017 01:25
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/b115731412ad8307a997f4c2ef774d69 to your computer and use it in GitHub Desktop.
Save trisharia/b115731412ad8307a997f4c2ef774d69 to your computer and use it in GitHub Desktop.
Get all Catalog Resources associated with a vRA Catalog Item Request
// VMware vRealize Orchestrator action sample
//
// Gets all Catalog Resources (deployments, machines, etc.) for the given catalog item request
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCACCAFE:VCACHost - vRA CAFE Host
// request - vCACCAFE:CatalogItemRequest - vRA Catalog Item Request
//
// Return type: Array/vCACCAFE:CatalogResource - the vRA Catalog Resources for the catalog item request
var requestId = request.id;
var resources = vCACCAFEEntitiesFinder.findCatalogResources(host);
var catalogResources = new Array();
for each (var resource in resources) {
if (resource.requestId === requestId) {
catalogResources.push(resource);
}
}
if (catalogResources.length === 0) {
System.warn("Catalog Resource not found for the given Request.");
}
return catalogResources;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment