How to view the portgroupID property?

This post was originally published on this site

I need it to be able to create and Edge via the NSX API, for which I need a portgroupId which i havent been able to find anywhere.
Ive seen the other post here on forum, but the guide appears to be for a web interface different than mine, since im not finding the URL revealing the portgroupID as explained in that solution. Also I would very much prefer to be able to get a list of portgroupIDs via the API if possible.

Ive tried:

  • Using the port group NAMES
  • Listing portgroupID /Networks in the web interface but no ID property is revealed here
  • Listing portgroupID/Networks via the API but I haven’t been able to identify a query that does this from the API documentation

 

The API query im currently using which is missing the portgroupID:

curl -k -X POST -H “Content-Type: application/xml” -u user:password -d ‘<edge><datacenterMoid>datacenter-2</datacenterMoid><name>APICreated-LBSS-Edge</name><tenant>Default</tenant><vseLogLevel>info</vseLogLevel><appliances><applianceSize>compact</applianceSize><appliance><resourcePoolId>123</resourcePoolId><datastoreId>123</datastoreId></appliance></appliances><vnics><vnic><index>0</index><name>APICreated-LBSS-Edge-Interface</name><type>uplink</type><portgroupId>AZT-vlan12</portgroupId><addressGroups><addressGroup><primaryAddress>213</primaryAddress><secondaryAddresses><ipAddress>123</ipAddress></secondaryAddresses><subnetPrefixLength>28</subnetPrefixLength></addressGroup></addressGroups><mtu>1500</mtu><enableProxyArp>false</enableProxyArp><enableSendRedirects>false</enableSendRedirects><isConnected>true</isConnected><inShapingPolicy><averageBandwidth>20000000</averageBandwidth><peakBandwidth>20000000</peakBandwidth><burstSize>0</burstSize><enabled>true</enabled><inherited>false</inherited></inShapingPolicy><outShapingPolicy><averageBandwidth>20000000</averageBandwidth><peakBandwidth>20000000</peakBandwidth><burstSize>0</burstSize><enabled>true</enabled><inherited>false</inherited></outShapingPolicy></vnic></vnics><cliSettings><userName>admin</userName><password>123</password><remoteAccess>false</remoteAccess></cliSettings></edge>’ ‘https://123/api/4.0/edges

Kind regards

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.