In the last post, I wrote about how Ravello Systems brought a new way of doing cloud computing, specializing in cloud abstraction, nested virtualizaion and L2/L3 networking.
Naturally, as a mature application, Ravello also has a REST API that allows to manage its resources in a programmatically way. That is what I’m going to talk about today.
Well documented, the API is accessed basically by HTTP GET, POST, PUT and DELETE methods, passing as arguments the username and password, JSON structure as data and an API URL poiting to a resource. Like this:
The response is a JSON seriallized object, which is easily trated in a language like Python as a dictonary (or hash) object.
Get a list of applications:
In the respose, you can see that I have just one application, named app003.
#Upload a public key:
First, the key.json file, a JSON serialized object:
The HTTP POST request:
And the response:
To use more features, read the docs, they are great!
If you use Python, Ravello offers python-sdk, a thin and simple layer between the language and the API.
Also comes with good documentation, providing a bunch of methods to interact with the principals API’s resources.
I wrote a little (maybe not so useful) program to create an application with CentOS 7 (an image from repository). You can read it to get some idea how to develop over the SDK. Check it out in the Github Repository.
Personally I did not test this Ravello Powershell Module, but it looks amazing! LucD made an excelent job, writing over 4800 SLOC. If you may use, leave a comment talking about it :)
I already told that Ravello is awesome (certainly more than twice), and its REST API is the icing on the cloud cake. As software eats the world, everyone working directly with IT should learn to code, and dealing with web resources is a great way to start doing something useful, automating mundane tasks and getting more time free.