Last Updated: 21-Feb-2022
VMware Cloud Foundation has a number of Public APIs, the documentation around this can easily be found by logging into the SDDC Manager UI and selecting the Developer Center. From here you can even execute an API on the running system.
Whilst this is all available right there in the SDDC Manager UI, its also possible that you may want to experiment with the Public APIs if your looking to develop your own automation, I like to use Postman for such experimentation and development and I was looking for a quick way to create a collection for the VMware Cloud Foundation APIs.
In the post I will walk you through the process, first by obtaining the swagger JSON file, making some minor adjustments and finally creating the collection.
Create VMware Cloud Foundation API Collection in Postman
- Connect to the SDDC Manager appliance as vcf using WinSCP and transfer the swagger.json file to your local computer.
For VCF 4.2: The swagger.json file is located at /opt/vmware/vcf/sddc-manager-ui-app/client/dist/client/assets/spec For VCF 4.4: The swagger.json file is located at /opt/vmware/vcf/sddc-manager-ui-app/client/dist/client/assets/spec/external
NOTE: You will find two swagger JSON files one for vSAN Ready Nodes (swagger.json) and one for VxRail Nodes (swagger_vxrail.json)
- Before we can import the swagger.json file we need to make a small modification otherwise the import complains about the format. Open the swagger.json file and after "title" enter a "version" value. In the example below, I entered "version": "4.2.0"
Now select the whole contents of the file and copy it to the clipboard.
In Postman select File > Import.
On the Import dialog, select Raw Text and paste the clipboard into the box.
- Click Continue, then click Import.
- Once the import finishes you will have a collection of all the VMware Cloud Foundation Public APIs.