/ #api #nsx 

NSX-T API: Embedded Documentation and Postman Collection

NSX-T Manager provides a REST API to automate management activities. You can interact with the API using RESTful web service calls over HTTPS. But what about the API documentation?

There are multiple ways to get to the NSX-T API documentation, such as embedded API documentation in the Manager, the API Explorer or using a Postman Collection.

NSX-T API Documentation

The best choice, in my opinion, is to use the embedded API documentation which is accessible via the help link in the Manager UI.

NSX-T API Embedded Documentation Link

Of course, you can also check the VMware Docs website to get the API documentation for NSX-T by downloading the VMware NSX-T API Guide.

VMware NSX-T Documentation

Finally, you can use the API Explorer on code.vmware.com: for example, for NSX-T 2.0 or NSX-T 1.1.

VMware API Explorer for NSX-T 2.0 on code.vmware.com

NSX-T Postman Collection

In my Postman article, I wrote about Postman Collections and how useful they are. As a reminder, Postman Collections are used to group individual requests together: they help you to consolidate requests, parameters, descriptions, tests, scripts in folders.

For NSX-V, the NSX-V Postman Collection is available on Github, but what about NSX-T?

NSX-T API is described in an OpenAPI format; we can download the OpenAPI specification of NSX-T Manager API using a simple call.

GET https://{{nsxmanager}}/api/v1/spec/openapi/nsx_api.yaml

NSX-T 2.0 API Documentation: OpenAPI Specification

Using cURL, I send the API request and download the result.

Download the OpenAPI specification of NSX-T Manager API using cURL

The -k  parameter turns off cURL’s verification of the certificate (I’m using a self-signed certificate in my lab), and -O  redirects the output to a file instead of stdout.

NB: if you are now sure about the syntax, you can build the request in Postman and use the code snippets generator.

Once you have the file, you can just use Postman’s import function and BOOM: 772 1162 NSX-T API requests automatically populated and documented into Postman.

NSX-T Postman Collection

edit:

  • The NSX-T 2.0 Postman collection contains 772 API requests
  • The NSX-T 2.1 Postman collection contains 852 API requests
  • The NSX-T 2.3 Postman collection contains 960 API requests
  • The NSX-T 2.4 Postman collection contains 1162 API requests
Author

Romain

Staff Architect & Member of the CTO Ambassador Program at VMware, focusing on NSX and Cloud-Native Applications. He is a double VCDX (DCV and NV, #120), VCDX panelist, frequent VMUG/VMworld speaker and contributor to the community via this blog or social media (follow him on Twitter @woueb).