SDDC Import/Export for VMware Cloud on AWS – Part IV – Adding a New Feature – Finding API Calls

In Part III of this blog series, we showed you how to import your SDDC config. In Part IV, we show how to to find API calls to add a new feature to this Fling.

We had a feature request to add Service Access configuration to the tool. Service Access is a feature that lets you enable access to native AWS services across the ENI. In order to implement this feature, I need to find the API calls that retrieve (GET) the configuration and save (PUT) the configuration.

To figure out the API calls, I first bring up FireFox and and find the Web Developer menu.

I want to view all Network requests, so I click on Network

The web developer tools open up at the bottom of the browser. I’m interested in all of the traffic between my browser and vmwarevmc.com, the URL that hosts all of the VMC API calls. I enter vmwarevmc.com in the filter.

The configuration for Service Access is behind the Connected VPC. I navigate to the correct section in the VMC CSP. Just before I click on the Connected VPC, I click on the ‘Clear’ icon to get rid of all of the API calls from the log. This will let me see only the calls that I’m interested in.

I see 2 calls – one for connected-services and one for linked-vpcs. Connected-services sounds promising, so I check there.

First I look at the headers:

Here’s the GET request:

GET https://nsx-34-194-236-229.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/2a8ac0ba-c93d-4748-879f-7dc9918beaa5/sddcs/c65fe3f0-515b-4741-bd34-1a92330eb726/cloud-service/api/v1/infra/linked-vpcs/vpc-4196d724/connected-services

The API call uses the org ID, the SDDC ID, and it’s also passing a VPC ID, so I know I’ll also have to have an API call to find the connected VPC ID.

Fortunately, that API call had to be executed in order to load this webpage. I click on the linked-vpcs API call

GET https://nsx-34-194-236-229.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/2a8ac0ba-c93d-4748-879f-7dc9918beaa5/sddcs/c65fe3f0-515b-4741-bd34-1a92330eb726/cloud-service/api/v1/infra/linked-vpcs

This API call uses the org ID, the SDDC ID, and nothing else. So I know I will be able to retrieve the linked VPC ID using this API call.

I check the response and one of the JSON properties is linked_vpc_id, this is what I need to pull in order to export the configuration.

I examine the JSON but I don’t see anything about S3 service access being enabled (I know it is enabled in this SDDC).

I click disable and enable to on the S3 service to see the call made to save the properties.

PUT https://nsx-34-194-236-229.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/2a8ac0ba-c93d-4748-879f-7dc9918beaa5/sddcs/c65fe3f0-515b-4741-bd34-1a92330eb726/cloud-service/api/v1/infra/linked-vpcs/vpc-4196d724/connected-services/s3

I now see an additional call to an API using the VPC ID – the connected-services API.

I go to the Developer Center in VMC, searching for the connected-services API.

I find 2 – a GET and a PUT for connected-services

I execute the GET request, passing it the linked VPC ID. This gives me a ConnectedServiceStatus result.

I now see the enabled S3 configuration.

I now have what I need to implement the required Python code, which we will do in the next post.

1 comment

Leave a Reply

Your email address will not be published. Required fields are marked *