Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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