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 setup.py 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:220.127.116.11:2633/RPC2') new_host_id = oca.Host.allocate(client, 'host_name', 'im_xen', 'vmm_xen', 'tm_nfs') hostpool = oca.HostPool(client) hostpool.info() for i in hostpool: if i.id == new_host_id: host = i break print host.name, host.str_state
For more details how to use Python OCA read the documentation
Try it and share your thoughts, any feedback is welcome.