Data Management For VMware Tanzu API Postman Collection
Tags: vmware, api, collection, datamanagement
Published: 2021-08-31 17:36:27

---
title: Data Management For VMware Tanzu API Postman Collection
published: true
date: 2021-08-12 21:51:26 UTC
tags: VMware,API,Collection,DataManagement
canonical_url: https://veducate.co.uk/dms-api/?utm_source=rss&utm_medium=rss&utm_campaign=dms-api
---

Whilst working with the “Data Management for VMware Tanzu” product, I decided to have a stab at working with the API as well.

Using my favourite API tool, [Postman](https://www.postman.com/), I created an easy-to-use collection.

I’ve posted this here:

- [VMware Code Sample](https://code.vmware.com/samples?id=7657)
- [Github Repository](https://github.com/saintdle/Data-Management-For-VMware-Tanzu-API-Postman-Collection)

The commands in this collection are built from the Swagger API, which can be accessed from the following URL:

- [https://{Provider}/provider/swagger-ui/index.html](https://%7BProvider%7D/provider/swagger-ui/index.html)

The official documentation for the API can be [found here](https://docs.vmware.com/en/Data-Management-for-VMware-Tanzu/1.0/tanzu-data-management/GUID-use_api.html).

So far, I’ve created the following areas/use cases:

- Get/Create Organisation
- Get/Create/Delete User
  - Get/Reset User Passwords
- Get/Create/Delete Database
  - Get Database configuration details
- Get Environments
- Get Database Templates
- Get/Create/Delete Instance Plans
- Get Provider Appliance Health

###### Variables inside the collection

The main variables you will need to set before use are:

- baseUrl
- userName
- Password

[![Data Management for Tanzu - API Postman Collection - Variables](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Variables.jpg?resize=604%2C186&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Variables.jpg?ssl=1)

###### Getting Started

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.

[![Data Management for Tanzu - API Postman Collection - Get Access Token](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Get-Access-Token.jpg?resize=604%2C396&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Get-Access-Token.jpg?ssl=1)

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.

###### How did I create this?

I used the Swagger UI to validate the requests. Which you can access by browsing to:

- https://{Provider}/provider/swagger-ui/index.html

Then in the Swagger UI:

1. You have five definitions to choose from which offer different capabilities
  1. Authentication
  2. Provider
  3. Monitoring
  4. Appliance
  5. Update Manager
2. This small blue hyperlink is a YAML download or Raw API format file, you can import or paste this into Postman. Which will then understand the schema provided and create a collection where possible.
3. In the SwaggerUI you can authorize yourself as a user for testing the various API Calls.
4. You can try all the available API calls tested. Be warned this will be live on your system.

[![Data Management for Tanzu - API Postman Collection - Swagger UI](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Swagger-UI.jpg?resize=604%2C286&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Swagger-UI.jpg?ssl=1)

###### Why did you create this collection if we can just use Swagger?

Downloading the files from Swagger UI and importing them into Postman does create you a collection and API to use.

However, the importing of this may not be easily useable, and the example body for POST methods for example will display every single possible “key:value” pair. Also the URL wouldn’t be accurate for use straight away, as you’d need to input the definition. So again, if you were new to using APIs this might be a bit too complex too soon.

I’ve included a screenshot of importing the files from Swagger and what they look like once they are available.

[![Data Management for Tanzu - API Postman Collection - Import file](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Import-file.jpg?resize=300%2C220&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Import-file.jpg?ssl=1) [![Data Management for Tanzu - API Postman Collection - Import file 2](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Import-file-2.jpg?resize=604%2C495&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/08/Data-Management-for-Tanzu-API-Postman-Collection-Import-file-2.jpg?ssl=1)

I decided to create a cleaner simpler collection, and for the Body requests focus on the minimum information you would need to get going as well.

###### Wrap-up

So hopefully this is helpful to anyone using this new VMware product.  You can also view my blog posts which take you from Zero to using Database as a Service features as quickly as possible.

- Data Management for VMware Tanzu
  - [Getting Started](http://vexpert.me/dms-tanzu-getting-started) – Deploying and configuring the infrastructure
  - [Self-Service DBaaS](http://vexpert.me/dms-self-service) – How to use the platform to create DBs on demand

Regards

[Follow @Saintdle](https://twitter.com/saintdle)<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

[Dean Lewis](https://uk.linkedin.com/in/saintdle?trk=profile-badge)

The post [Data Management For VMware Tanzu API Postman Collection](https://veducate.co.uk/dms-api/) appeared first on [vEducate.co.uk](https://veducate.co.uk).