Last active
March 20, 2019 15:39
-
-
Save dlinsley/e1c64db887b245f3d4a681277d6051dc to your computer and use it in GitHub Desktop.
Get Entitlements of BusinessGroup - vRealize Automation (vRA)
This file contains hidden or 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 (vRO) action sample | |
// | |
// Returns all of the Catalog Entitlements associated with a BusinessGroup | |
// | |
// For vRO/vRA 7.0+ | |
// | |
// Action Inputs: | |
// businessGroup - vCACCAFE:Subtenant | |
// | |
// Return type: Array/vCACCAFE:Entitlement | |
var host = vCACCAFEEntitiesFinder.getHostForEntity(businessGroup); | |
var cc = host.createCatalogClient(); | |
var ces = cc.getCatalogEntitlementService(); | |
var filters = [vCACCAFEFilterParam.equal("organization/subTenant/id", vCACCAFEFilterParam.string(businessGroup.id))]; | |
var query = vCACCAFEOdataQuery.query().addFilter(filters); | |
var odataRequest = new vCACCAFEPageOdataRequest(query); | |
var entitlements = ces.get(host.tenant, odataRequest); | |
for each (var item in entitlements) { | |
System.log(item.name); | |
} | |
return entitlements; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
added an update action for this. Thanks for posting, Dan!
https://gist.github.com/nhlpens66/66fd1f6fc6dd82dbe5c14a272e2ec0a4#file-setentitlementofbusinessgroup-js