Elegant Network Design

SERVER TIME IS:
Wed, April, 1, 17:08

--BACK--

Finding Moref ID Easily and Using Curl for REST API Access!

CURL commands with NSX Manager:

GET REQUEST:

curl -k -X GET -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin:VMware1! 'https://nsxmgr-01a.corp.local/api/2.0/services/usermgmt/user/admin'

POST Request:

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

Fast Way to get NSX related morefs:
At NSX Manager user mode:
show cluster all
show cluster < cluster-id> (this should list all hosts and their host-id)

Once you have identified the cluster's constituents, you can narrow in on a specific host and then to the Vms:

show host -host-id-