Can anyone tell me how to drill down into a network folder so I can enumerate vswitches?
This is my code but its doesn't work
TraversalSpec dcToNf = new TraversalSpec();
dcToNf.type = "Datacenter";
dcToNf.path = "networkFolder";
dcToNf.skip = false;
dcToNf.name = "dcToNf";
dcToNf.selectSet = new SelectionSpec[] { new SelectionSpec() };
dcToNf.selectSet[0].name = "visitFolders";
The networkFolder will not contain vSS (standard vSwitch), it'll only contain networks (basically portgroups accessible in the datacenter, dvPortgroup or vDS) as defined by the API reference document. If you want to extract the standard vSwitches, you'll need to get a list of the HostSystem's and traverse each host to figure out the vSwitch configurations.
I can get the moref of the vswitch from you suggestion but I need to tie moref with vswitch name..
I worked it out.
Yea, once you have moref of the vSwitch, should be pretty trivial to get it's name