NSX-T has lots of interesting capabilities, but due to the rapid development and release cycle many are only available via API calls right now.
Making a request
While the NSX-T documentation has some nice examples such as:
- Configure an L2VPN service.
Use the POST /api/v1/vpn/l2vpn/services call.
It doesn’t exactly hold your hand to get going.
What you’ll need is a RESTful API client like Postman from Google and some important settings:
URL: https://<IP or FQDN of the NSX-T manager>/api/v1/vpn/l2vpn/services
(the part after /api will change depending on what call you are making)
Authorization:
Authorization: Basic Auth
Username: admin
Password: <admin password for NSX-T Manager>
Headers:
Content-Type application/json
(this only matters when you are sending a body in the request, such as a POST request like this one.)
Body:
Raw: <Copy the sample code, modified for your environment>
That should get the request set without any “UNSUPPORTED MEDIA TYPE” or “content type not supported” messages.
Adding all the APIs as a Postman Collection
Note that you can add the NSX-T API calls as a collection into Postman by doing :
GET https://<IP or FQDN of the NSX-T manager>/api/v1/spec/openapi/nsx_api.yaml
Select can copy all of the text in the returned body:
Then click Import in the top bar, select Paste Raw Text and paste the copied body in:
Before you click Import, scroll up ti the very top and change “host: nsxmanager.your.domain” to the FQDN of your NSX T manager. Then click Import.
After you see the imported message
You will have a new collection listed If you double-click on one of the requests, the request will populate with the call including the proper content type and the FQDN/IP of your NSX Manager: