In this example, we will create a logical switch using the HTTP POST REST API request via cURL script:
- Run the following cURL script from a command prompt:
curl -k -X POST https://nsxmgr-01a.corp.local/api/2.0/vdn/scopes/vdnscope-1/virtualwires -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin:VMware1! -d "<virtualWireCreateSpec><name>cURL-Logical-Switch</name><description>Logical Switch created from cURL</description><tenantId>cURL Tenant</tenantId><controlPlaneMode>UNICAST_MODE</controlPlaneMode><guestVlanAllowed>false</guestVlanAllowed></virtualWireCreateSpec>"
- The cURL script will return a Virtual Wire ID in this virtualwire-8 example:
- Verify in the vSphere Web Client ...