Exploring the Lesser-Known Yet Powerful VMC-AWS Networking APIs

  1. NSX API Access Points
  2. API to Backup NSX Config
  3. API to Get the VMC Gateway Routing Table
  4. API to Request AWS Public IP
  5. 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.

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.

Leave a comment