Use of Apache Libcloud within Cloud Ikoula

Introduction to the use of apache libcloud within your cloud ikoula.

That is what libcloud?

Apache Libcloud is a python library open source under the Apache 2.0 license. It allows to interact with a lot of cloud services provider, using a unified API.

It was created to facilitate the life of the developers who want to create applications compatible with various cloud services that the library currently supports.

The latest version supports more than 30 different providers (including Ikoula).

To discover more detail so it by here

In passing we warmly thank Tomaž Muraus, flesh project of the Apache libcloud project for his involvement on the creation of libcloud Ikoula driver!

Installation of apache libcloud

We will install apache libcloud on a machine Ubuntu 13.10. Obviously the installation may vary from one os to another.

 ikoula  @ubuntu1310:  ~ /   apache libcloud  $ sudo apt   get install python   pip
ikoula  @ubuntu1310:  ~ /   apache libcloud  $ sudo pip install apache   libcloud

This is! that's it! Now take your favorite editor (vim randomly...)

You will start your first python program using the libcloud library. This will be a first little script that will allow you to list the available ikoula cloud computing offerings. We will call the script

To make it work, you will need your api key with your secret key. To retrieve please follow this FAQ

  #! / usr/bin/env python
 from  pprint  import pprint
 from  libcloud.compute.types  import Provider
 from  libcloud.compute.providers  import get_driver
api_key  =  ' your API key '
SECRET_KEY  =  ' your secret key '
CLS  = get_driver Provider (. IKOULA)
driver  = cls (api_key, secret_key)
sizes  = driver . list_sizes()
 print  '  \n  available computing offerings:  \n  '
 for  in sizes s:
  print s . name

By launching the script (by making it executable for example using a chmod + x) you'll get a return of the kind:

 ikoula  @ubuntu1310:  ~ /   apache libcloud  $ . / get_compute_offerings . py
Calculation offers available:
M1 . wide
M1 . medium
T1 . micro
M1 . small
M1 . extralarge

This script connects to the cloud Ikoula and retrieved the list of offers available calculations then has their names.

In a next article we will see how to use libcloud to provision your instances. Already you can go refer to the sample and navigate the various classes here

Add new comment