March 2018
Beginner
584 pages
14h 51m
English
In this example, we will create a logical switch using the HTTP POST REST API request via Python:
# Import Requests library import requests # NSX Variables nsxmanager = 'https://nsxmgr-01a.corp.local' nsxurl = '/api/2.0/vdn/scopes/vdnscope-1/virtualwires' nsxheaders = {'Content-Type': 'application/xml'} nsxuser = 'admin' nsxpass = 'VMware1!' nsxpayload = ''' <virtualWireCreateSpec> <name>Python-Logical-Switch</name> <description>Logical Switch created from Python</description> <tenantId>Python Tenant</tenantId> <controlPlaneMode>UNICAST_MODE</controlPlaneMode> <guestVlanAllowed>false</guestVlanAllowed> ...Read now
Unlock full access