Skip to content

Instantly share code, notes, and snippets.

@dlinsley
Last active March 20, 2019 15:39
Show Gist options
  • Save dlinsley/e1c64db887b245f3d4a681277d6051dc to your computer and use it in GitHub Desktop.
Save dlinsley/e1c64db887b245f3d4a681277d6051dc to your computer and use it in GitHub Desktop.
Get Entitlements of BusinessGroup - vRealize Automation (vRA)
// 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;
@jimsadlek
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment