Created
September 27, 2016 18:05
-
-
Save BenNeise/7db859e0fd656de97761aa38acd035ca to your computer and use it in GitHub Desktop.
vRealize Orchestrator action to resolve a custom property using the Property Dictionary
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
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