Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save BenNeise/7db859e0fd656de97761aa38acd035ca to your computer and use it in GitHub Desktop.
Save BenNeise/7db859e0fd656de97761aa38acd035ca to your computer and use it in GitHub Desktop.
vRealize Orchestrator action to resolve a custom property using the Property Dictionary
const model = "ManagementModelEntities.svc";
const entitySet = "PropertyDefinitions";
// Create a filter, looking for a PropertyName matching our propertyName input string
var customFilterProperties = new Properties();
customFilterProperties.put("PropertyName",propertyName);
// Find all PropertyDefinition entities matching the filter
var propertyDefinitions = vCACEntityManager.readModelEntitiesByCustomFilter(
vcacVcacHost.id,
model,
entitySet,
customFilterProperties,
null
);
if (propertyDefinitions.length == 1){
// If we find a single entity with the correct name, return the entities' DisplayName
return propertyDefinitions[0].getProperty("DisplayName")
}
else {
// If we can't find a matching property definition, then just return the original string
return propertyName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment