Interacting with the public APIs of a VMware Cloud Foundation platform enables organizations to build custom end-to-end automation for their needs. The first step in the process involves obtaining an authentication token. A VMware Cloud Foundation platform consists of a number of core end points, each requiring slightly different parameters to carry out the interaction.
Whilst public API documentation is available across the VMware Cloud Foundation platform (see developer.broadcom.com), concrete examples of how to consume the various APIs is either not consistent or lacking, for this reason I decided to pull together this post to help with the specifics, this post covers the following end-points:
- VCF Installer
- VCF Operations
- SDDC Manager
VCF Installer
VCF Installer APIs Used
- POST /v1/tokens
Procedure
-
Connect to a system that has access to your infrastructure and is capable of running CURL.
-
Replace the values in the sample code with values for your VCF Installer instance and run the commands in the console.
vcfInstallerFqdn=$'sfo-ins01.sfo.rainpole.io'
vcfInstallerUser=$'admin@local'
vcfInstallerPass=$'VMw@re1!VMw@re1!'
- Authenticate to VCF Installer and obtain a token by running the following command:
vcfInstallerToken=$(curl -k -X POST https://$vcfInstallerFqdn/v1/tokens -H 'Content-Type:application/json' -d '{"username": "'$vcfInstallerUser'","password": "'$vcfInstallerPass'"}' | jq -r '.accessToken')
- Verify you were able to successfully obtain an authentication token by running the following command:
echo $vcfInstallerToken
VCF Operations
VCF Operations APIs Used
- POST /suite-api/api/auth/token/acquire
Procedure
-
Connect to a system that has access to your infrastructure and is capable of running CURL.
-
Replace the values in the sample code with values for your VCF Operations instance and run the commands in the console.
vcfOperationsFqdn=$'flt-ops01a.rainpole.io'
vcfOperationsUser=$'admin'
vcfOperationsPass=$'VMw@re1!VMw@re1!'
- Authenticate to VCF Operations and obtain a token by running the following command:
vcfOperationsToken=$(curl -k -X POST https://$vcfOperationsFqdn/suite-api/api/auth/token/acquire -H 'Content-Type:application/json' -d '{"username": "'$vcfOperationsUser'","password": "'$vcfOperationsPass'", "authSource": "LOCAL" }' | jq -r '.token')
- Verify you were able to successfully obtain an authentication token by running the following command:
echo $vcfOperationsToken
SDDC Manager
SDDC Manager APIs Used
- POST /v1/tokens
Procedure
-
Connect to a system that has access to your infrastructure and is capable of running CURL.
-
Replace the values in the sample code with values for your SDDC Manager instance and run the commands in the console.
sddcManagerFqdn=$'sfo-vcf01.sfo.rainpole.io'
sddcManagerUser=$'administrator@vsphere.local'
sddcManagerPass=$'VMw@re1!VMw@re1!'
- Authenticate to SDDC Manager and obtain a token by running the following command:
sddcManagerToken=$(curl -k -X POST https://$sddcManagerFqdn/v1/tokens -H 'Content-Type:application/json' -d '{"username": "'$sddcManagerUser'","password": "'$sddcManagerPass'"}' | jq -r '.accessToken')
- Verify you were able to successfully obtain an authentication token by running the following command:
echo $sddcManagerToken

Leave a comment