I am having problems creating a wrapper to convert a string (property value passed from vRA) to a VC:DistributedVirtualPortgroup.
I am able to get all the current portgroups in an array but I'm not able to get the correct object based on the name property.
This is what I have currently
var dvPortgroupName = "vxw-dvs-38-virtualwire-113-sid-5003"; var dvPortgroups = VcPlugin.getAllDistributedVirtualPortgroups(); for each (pg in dvPortgroups){ if (pg.name == dvPortgroupName){ System.log("dvPortgroupName found!"); } else { System.log("dvPortgroupName not found!"); } }
I am able to get the results that I want if I try creating a wrapper using another object like 'datastore'
var datastoreName = "vsanDatastore"; var dataStores = VcPlugin.getAllDatastores(); for each (ds in dataStores){ if (ds.name == datastoreName){ System.log("datastore name found!"); } else { System.log("datastore name not found!"); } }
Any help or guidance would be greatly appreciated.