Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Converting string type to VC:DistributedVirtualPortgroup type

$
0
0

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.


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>