VMware Cloud Community
vkalina
Contributor
Contributor

Getting VLAN ID's via REST API

Hi, I'm trying to use REST API to get a list of networks (distributed port groups) together with their VLAN ID's but with no success. The only way I can get the list is to go the switch's page in vCenter web interface, go to "Networks" tab and click "Export" button. Then I get a CSV with networks together with their VLAN ID's. But I need to automate it. Is there any way to get the information via REST API? I'm trying to use "/rest/vcenter/network" or "/api/vcenter/network" endpoints but they only return "name", "type" and "network" in the structure for each network. No VLAN ID included. Is there any other way to get this information? Thanks in advance for any help.

Tags (5)
0 Kudos
1 Reply
vkalina
Contributor
Contributor

I forgot to mention that we have two vSpheres: 7.0.3 and 8.0.1. Both behave equally, I'm unable to retrieve VLAN ID's from any of them.

0 Kudos