The official documentation for the API can be found here.
So far, I’ve created the following areas/use cases:
Operations Covered in this Collection:
Get Provider Health
Change Password for Current User
Get Root & Admin User Passwords
Get Database Alerts
Get Database Version
Create & Restore (inc. Point in Time Restore)
Create, Download, Delete
Get All, Create and Delete
Get Tasks, Events and Alarms
Get All Backups
Get Audit Logs
Variables inside the collection
The main variables you will need to set before use are:
Under the login folder, run the “Get Access Token” request. This has a test configured, so that from the returned data, it will copy the Bearer Token and OrgId for the User Account to the Environment Variable collection that is active.
Some API requests are only valid for certain Authenticated role types, such as creating Databases can only be successful with a user role of Org_Admin or Org_User.
Whilst working with vRA to deploy various Kubernetes clusters and then register them with Tanzu Mission Control (TMC), I decided to use Postman (a great API Explorer tool) to catalogue my work and build out several use cases.
Where the requests require some changes in the body that is best not to have as a variable, such as naming a backup, I’ve also tried to add information on the documentation.
Under the Login folder, run “Get Access Token”, which will connect to your TMC URL and use the CSP Refresh Token to generate an Access Token, this access token will be committed to a variable called “accessToken” for use with the other requests.
You will also probably want to run the “Get Organisation ID” as some of the requests require your Org ID, so this will commit it to a variable. This is gathered by looking at the details for your given CSP Token.
If you are running the API to attach a new cluster. Then you will want to run the second request “Get TMC Agent Installer information” which will give you the Installer Link to run in your Kubernetes environment. This data will be written to a variable.
For most of the request that List information, you can use the query “?searchScope.name=” with the API call to filter for necessary objects, or you can use the wildcard value *. I’ve added most of the search filters and value formatters to the requests.
To get the full details for a particular named cluster, I have written the queries for specified clusters, this requires you to provide the management cluster and provisioner of that specified cluster in the query. Essentially it returns the same information as the “Get Clusters List” combined with the SearchScope filter.
So, I won’t describe every set of requests I’ve created. I’ve tried to create these with the bare minimum information you need especially for the POST methods.
If you want to explore the APIs more, you can download an import the Swagger/Open API spec from VMware yourself and import into Postman, but personally I found this hard to work with, and the example bodies give you everything including the responses you won’t need for a POST.
If you’d like to contribute, please do this via the GitHub link!
Looking for more resources around TMC? Then you can check out my other blogs!