Python OCA bindings

I am happy to announce first release of the Python OCA bindings. These bindings wrap OpenNebula’s XML-RPC methods in the Python objects, which allows developers to interact with OpenNebula in a more pythonic way.

The package is available on pypi so if you want to try it just run:

$ easy_install oca

Or download the code from github and install it by running:

$ python install

Here is an example that shows how you can add new host using Python bindings:

#!/usr/bin/env python

client = oca.Client(‘user:password’, ‘http:’)
new_host_id = oca.Host.allocate(client, ‘host_name’, ‘im_xen’, ‘vmm_xen’, ‘tm_nfs’)
hostpool = oca.HostPool(client)
for i in hostpool:
if == new_host_id:
host = i
print, host.str_state

For more details how to use Python OCA read the documentation

Try it and share your thoughts, any feedback is welcome.