Last active
November 9, 2017 21:39
-
-
Save trisharia/e72101e6178344f9aa5bd5cdfac5ff7a to your computer and use it in GitHub Desktop.
Get the children of a vRA Catalog Resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VMware vRealize Orchestrator action sample | |
// | |
// Get the children of a vRA Catalog Resource. | |
// For example, find the Machine resource(s) of a Deployment. | |
// | |
// For vRO/VRA 7.0+ | |
// | |
// Action Inputs: | |
// cafeHost - vCACCAFE:VCACHost - vRA CAFE Host | |
// parentCatalogResource - vCACCAFE:CatalogResource - parent Catalog Resource for which to get children | |
// | |
// Return type: Array/vCACCAFE:CatalogResource - the children Catalog Resources | |
var childResources = []; | |
var parentResourceId = parentCatalogResource.id; | |
var allResources = vCACCAFEEntitiesFinder.findCatalogResources(cafeHost); | |
for each (var r in allResources) { | |
if (r.parentResourceRef && r.parentResourceRef.getId() === parentResourceId) { | |
childResources.push(r); | |
} | |
} | |
return childResources; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment