Good day,
I am attempting to retrieve the Network configuration of all vApp networks to a vm( Explicitly the Gateway, Mask, and Name). My code worked in the 1.5 plugin, so I started digging. I can drill down to the vclVAppNetworkConfiguration Object, and even read its name, however if I try and do anything beneath that object, or even try a .toXml on the VAppNetworkConfiguration object, I get an error. below is my code so far. Any ideas?
Input: vCloud:vm
var vApp = vm.parent;
//vApp.updateInternalState()
var vdc = vApp.parent;
var Org = vdc.parent;
// Creation of two empty arrays
NetworkNames = new Array();
NetworksOut = new Array();
var NetworkConfig = vApp.getNetworkConfigSection();
//System.log(NetworkConfig.toXml());
NetworkConfigs = NetworkConfig.networkConfig.enumerate()
for(var i in NetworkConfigs){
try{
Configs = NetworkConfigs[i];
System.log( i+" :: "+Configs)
System.log("NetworkName: "+Configs.networkName)
System.log(Configs.toXml())
//This returns "null"
for(var j in Configs){
try{
System.log(j + ":: "+Configs[j])
//This returns " Property named '__iterator__' not found on object : VclVAppNetworkConfiguration "
}
catch(ex){
continue}
}