After reading an excellent article from VMware vSphere Automation REST API Postman Resources and Samples , I wondered if I could apply the technique to the REST APIs for Veeam Availability Console (VAC), and create a Collection (which is effectively a collection of all available API requests).
This should not replace the excellent built in Swagger UI interface for VAC, but rather compliment it.
Setup
The article above provides a download link with the relevant .json built using the Postman client.
The first thing you will need to do is download and install the latest version of the Postman Client, available here https://www.getpostman.com/ , Installation is extremely straight forward, with no options to change/set, so a simple ‘next, next, finish’.
Import
Thanks to Vladimir Rogozhin over on the Veeam forums for showing me this method.
Launch the Postman client.
Now in a browser open the VAC API url https://<vac-server>:1281 and click on the ‘Swagger’ link
On the next URL you will need to copy the API doc url
Copy and paste the url into a new tab/page in your browser, and you’ll see the raw text for the API documents.
Now select all the text from the body of the page and copy to the clipboard.
Back in Postman click on ‘Import’ in top left hand corner
In the Import dialog box click on ‘Paste Raw Text’ , insert the text copied from the previous step and click ‘Import’
You will now have a folder structure visible on the left hand side, under collections
Cleanup
You will need to clean up some of the items, let’s look at changing the title of the API call and the URL.
Select the call you want to clean up, in this example I’m cleaning up the ‘backupPolicies’ call.
clean up the URL
Click save
Now over in the collections folder click on the 3 dots and select ‘Edit’ from the drop down menu
Give the item a more suitable name and enter a description.
Click ‘Update’ to complete.
If you need to create a sub folder, then hover over the top folder, click on the ‘Add Folder’
Now enter details for folder and click ‘Create’
You can now group related requests into a nice folder structure.
Now I have done the hard work for you and created the folder structures/API names, which you can download the required .json file from here Cragdoo Github
import json file using the ‘Import File’
Postman Environment Variables
You will notice that I have defined {{VAC}} in my collection, this is a quick and easy way to save time copying/pasting API urls
To setup an environment click on the cog in the top right hand corner of Postman
From the drop down list select ‘Manage Environments’
Give your Environment a name and enter ‘Key’ as VAC ,the url of the VAC API page (including the port number 1281) and click ‘Add’
Now you can use the variable {{VAC}} in your API calls , for example
Summary
As you can see the Collection feature of Postman is easy to setup and a time saver. With some tweaks I would imagine it would be easy to create collections from your RestAPI provider.