VMware {code} Community
rickyelqasem
Enthusiast
Enthusiast

networkFolder TraversalSpec

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";

Ricky El-Qasem VCI/VCP - MCSE - RHCT
0 Kudos
4 Replies
lamw
Community Manager
Community Manager

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.

0 Kudos
rickyelqasem
Enthusiast
Enthusiast

I can get the moref of the vswitch from you suggestion but I need to tie moref with vswitch name..

Ricky El-Qasem VCI/VCP - MCSE - RHCT
0 Kudos
rickyelqasem
Enthusiast
Enthusiast

I worked it out.

Ricky El-Qasem VCI/VCP - MCSE - RHCT
0 Kudos
lamw
Community Manager
Community Manager

Yea, once you have moref of the vSwitch, should be pretty trivial to get it's name Smiley Wink

0 Kudos