In my previous post I had worked with a version of Runecast and provided an initial look at the awesome app that helps keep your vSphere environment running at peak operational configuration.
As part of my feedback I suggested they start looking at a REST API, as it turns out the smart guys at Runecast were already way ahead of me and on June 13th released a new version with a great REST API and API Explorer to work with it, within a couple of clicks I updated my Runecast deployment to the latest version (super easy) and it gave me the latest and greatest features to work with including the API which can be found under the settings page and API Access token and then clicking the “Runecast API” link at the top, this brings up a swagger based API Explorer as seen below:
You can use the API live here or through any other REST based client, personally I like to try postman and start to understand the API a little more by creating a collection, this is exactly what I did and have made available via a github repo for you to download, use against your environment and also contribute back to with more samples in the collection.
Getting started with the Runecast Postman collection
Getting started couldn’t be easier just follow the below steps to use the collection against your Runecast server:
- Ensure you have Runecast 22.214.171.124 or above as this has the API
- Download and install Postman if you don’t have it already from https://www.getpostman.com/
- Download or clone my Runecast Postman Collection from my github repo from here
- You should now have 2 files from that repo, the first is the collection of REST calls and the second is an environment, the environment is used to specify 2 key pieces of information so we don’t have to keep retying these and also makes the collection portable.
- Open postman and click the import button at the top left, import the two files from the github repo and close the import button.
- You will now see the collection in the left hand pane and the environment will be available for you to adjust on the right hand side as seen below:
7. Next you will need to edit the environment and change the information to match your setup, firstly change the IP to the hostname or IP of your Runecast server.
8. Secondly change the APIKey to an APIKey that you have generated from the Runecast app, to do this go to Settings -> API Access tokens and select “Generate API access token“. Provide a description so you know what it is used for and once you click on “Generate“, your access token will be ready. Make sure to copy it, as you’ll not be able to see the same token again and we will need it in Postman. Paste the APIKey into the postman environment replacing the one in there at the moment and close the environment.
9. If all was done correctly above you should now be able to click on the collections and use the SEND button to call the API and see the results, note that some of these APIs require an ID which you will need to customize in the URL in postman as at the moment it has my IDs for things like my VC.
An example of me using postman to call the Runecast API is below:
Using the Runecast API either by the API Explorer built into the app or via a standard REST based tool from the internet is super easy to do and allows integration and access to the wealth of details in the Runecast App, I hope the guys from Runecast extend this API to include configuration items in the future to allow a zero touch deployment of the app for automated rollouts but this is a great start.
Stay tuned for my next post where I will show you how we can easily integrate this with PowerCLI and get interesting information using a combination of PowerShell functions I have written and PowerCLI.