
- NSX API Access Points
- API to Backup NSX Config
- API to Get the VMC Gateway Routing Table
- API to Request AWS Public IP
- API to Get the NSX Capacity Usage
VMware NSX-T provides a programmatic API to automate management activities. The API follows a resource-oriented Representational State Transfer (REST) architecture, using JSON object encoding. Clients interact with the API using RESTful web service calls over the HTTPS protocol. This blog post explores the lesser-known but highly valuable VMC-AWS Networking APIs. Despite not being widely recognized, these APIs provide substantial practical advantages in real-world applications.
NSX API Access Points
In VMC, the NSX API endpoint can be accessed in two ways.
- Access NSX Manager via the Internet (Public). In this scenario, the endpoint follows this format: Public URL + /vmc/reverse-proxy/api/orgs/{{org-id}}/sddcs/{{sddc-id}}. One example of the VMC NSX Endpoint is https://nsx-44-239-236-63.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/948600b1-815a-4607-ae2f-0a55ddc833b4/sddcs/34deb106-e4a1-4be5-822f-4d9615f235cd, where where ‘948600b1-815a-4607-ae2f-0a55ddc833b4′ represents your CSP organization ID and ’34deb106-e4a1-4be5-822f-4d9615f235cd’ is your SDDC ID.
- Access NSX Manager via internal network (Private): In this scenario, the endpoint is the Private URL of NSX manager. An example of the VMC NSX private URL is https://nsxmanager.sddc-44-239-11-101.vmwarevmc.com
When you try to access your VMC SDDC NSX Manager via the internal network, you need to add the corresponding firewall rules to allow connectivity on the VMC MGW.
API to Backup NSX Config
GET /policy/api/v1/infra?filter=Type-
This API can be utilized to back up all NSX-related configurations in your SDDC, including network segments, CGW and MGW gateway firewall rules, distributed firewall policies and rules, groups, services, DHCP, NAT etc.
API to Get the VMC Gateway Routing Table
GET policy/api/v1/infra/tier-0s/vmc/routing-table?enforcement_point_path=/infra/sites/default/enforcement-points/vmc-enforcementpoint
You can use this API to retrieve the routing table from your SDDC’s NSX VMC router.
API to Request AWS Public IP
PUT /cloud-service/api/v1/infra/public-ips/{ip-id}
Body:
{
"display_name" : "456"
}
You can use this to request AWS public IPs for your SDDC. It is extremely helpful when you require a large number of public IPs for your VMC-AWS workloads. In the API, ‘ip-id’ is represented as a number, for example, 10.
API to Get the NSX Capacity Usage
Get /policy/api/v1/infra/capacity/usage
You can use this API to check the current usage of various NSX resources, such as ‘NUMBER_OF_GROUPS’ and ‘NUMBER_OF_EDGE_CLUSTERS’. Regarding the VMC Networking supported configmax, please refer to https://configmax.esp.vmware.com/.
This blog is a living document. I will continue to add new APIs here if I find them helpful. Thank you for reading.