CalmCloud
Enthusiast
Enthusiast

Updating Configuration Element

Jump to solution

Hi All,

Is it possible to udpate Configuration Element in a script?

Thanks

0 Kudos
1 Solution

Accepted Solutions
ChristianWehner
VMware Employee
VMware Employee

Yes this is possible. Take a look into the API Explorer (on the right top 'Tools' --> 'API Explorer' and search in the API for the ConfigurationElement.

Read an attribute of a configuration element:

var myAttributeValue = ConfigurationElement.getAttributeWithKey( "Attribute Name" );

Write an attribute value to a configuration element:

ConfigurationElement.setAttributeWithKey( "Attribute Name",myAttributeValue );

You also can loop through all attributes of a configuration element:

for each ( var myAttribute in ConfigurationElement.attributes ) {
     System.log( myAttribute.name + ": " + myAttribute.value );
}
-
Chris

View solution in original post

0 Kudos
3 Replies
tschoergez
Leadership
Leadership
CalmCloud
Enthusiast
Enthusiast

I have gone through that blog... My requirement is to read configuration element and update attribute value.

0 Kudos
ChristianWehner
VMware Employee
VMware Employee

Yes this is possible. Take a look into the API Explorer (on the right top 'Tools' --> 'API Explorer' and search in the API for the ConfigurationElement.

Read an attribute of a configuration element:

var myAttributeValue = ConfigurationElement.getAttributeWithKey( "Attribute Name" );

Write an attribute value to a configuration element:

ConfigurationElement.setAttributeWithKey( "Attribute Name",myAttributeValue );

You also can loop through all attributes of a configuration element:

for each ( var myAttribute in ConfigurationElement.attributes ) {
     System.log( myAttribute.name + ": " + myAttribute.value );
}
-
Chris
0 Kudos