// VMware vRealize Orchestrator action sample. Valid for vRA/vRO 7.0+ // // Get or Create a Configuration Element // // Action Inputs: // categoryPath string Configuration Category Path (full path) // configName string Name of Configuration Element // // Action Output: // return type: ConfigurationElement var configElement = null; try { var configCategory = Server.getConfigurationElementCategoryWithPath(categoryPath); if(configCategory) { System.log("Found configuration category '"+configCategory.name+"'"); //Find Configuration Element var configElements = configCategory.configurationElements; for (var i in configElements) { ce = configElements[i]; if (ce.name == configName) { configElement = ce; break; } } if(configElement) { System.log("Found configuration '"+configElement.name+"'"); } else { configElement = Server.createConfigurationElement(configCategory, configName); System.debug("Created configuration element '"+configElement.name+"'"); } } else { configElement = Server.createConfigurationElement(categoryPath, configName); System.debug("Created category path '"+categoryPath+"' and configuration element '"+configElement.name+"'"); } } catch(e) { System.warn(e); } return configElement;