← Back to team overview

openstack team mailing list archive

How to use the novaclient python API

 

Greetings all,

http://docs.openstack.org/developer/python-novaclient/api.html says that:

from novaclient import OpenStack
nova = OpenStack(USERNAME, PASSWORD, AUTH_URL)

Should work.  But:

(virtual-python2.7)ftc-ms01:test# pip search python-novaclient |head -3
python-novaclient         - Client library for OpenStack Nova API.
  INSTALLED: 9999.98.daee5438f2232c0467d93029bd636fc2114e4c09
  LATEST:    2.11.1
(virtual-python2.7)ftc-ms01:test# cat a.py
from novaclient import OpenStack
(virtual-python2.7)ftc-ms01:test# which python
/src/virtual-python2.7/bin/python
(virtual-python2.7)ftc-ms01:test# python a.py
Traceback (most recent call last):
  File "a.py", line 1, in <module>
    from novaclient import OpenStack
ImportError: cannot import name OpenStack

I've heard that the python api isn't well documented but, looking at the
code there seems to be lots of functionality.  Could someone give me a
hint on how to use it?

Thanks
JR


Follow ups

References