VMware Cloud Community
ShilpaNagaraja
Contributor
Contributor

access the configuration element in VMware Orchestrator Actions using the code in vRO8.2

Hi,

 

I am trying to access the configuration element namely “vpNames” in VMware Orchestrator Actions using the code below:

var configurationElementPath  = "Configurations/web-root";

var category = Server.getConfigurationElementCategoryWithPath(configurationElementPath); ->>This returns NULL

 

 

complete code below:

var configurationElementPath  = "Configurations/web-root";
var configurationElementName  = "vpNames";
var attributeName = "vpNames";
try{
var category = Server.getConfigurationElementCategoryWithPath(configurationElementPath);
}
catch(e){
    System.log(e);
}

for each ( var element in category.configurationElements) { 
    if (element.name == configurationElementName) {
        var configurationElement = element;
    }
 } 
return configurationElement.getAttributeWithKey(attributeName).value;

 

 

Can anyone provide any inputs?

The location of the config items is shown in the screenshot below:

 

ShilpaNagaraja_0-1611107177940.png

 

0 Kudos
0 Replies