Re: [Openstack] How to use the novaclient python API
Thanks Vishvanda, that did help. I'm having an issue with endpoints, but I think when I installed openstack I might not have add all the needed endpoints: File "/usr/lib/python2.7/dist-packages/novaclient/service_catalog.py", line 67, in url_for raise novaclient.exceptions.EndpointNotFound() novaclient.exceptions.EndpointNotFound JR On 2/21/2013 5:42 PM, Vishvananda Ishaya wrote: > Looks like those docs are pretty outdated. I have a github repository where I > have been putting together some examples of doing common commands with > a) cli > b) python-*client > c) curl > > It is incomplete but this should help get you started: > > # helper method to create the client > https://github.com/vishvananda/openstack-examples/blob/master/helper.py > > # keypair methods > https://github.com/vishvananda/openstack-examples/blob/master/keypair.py > > Vish > > On Feb 21, 2013, at 2:20 PM, JR wrote: > >> 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: .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 >>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 >> >> ___ >> Mailing list: https://launchpad.net/~openstack >> Post to : openstack@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~openstack >> More help : https://help.launchpad.net/ListHelp > ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] How to use the novaclient python API
Looks like those docs are pretty outdated. I have a github repository where I have been putting together some examples of doing common commands with a) cli b) python-*client c) curl It is incomplete but this should help get you started: # helper method to create the client https://github.com/vishvananda/openstack-examples/blob/master/helper.py # keypair methods https://github.com/vishvananda/openstack-examples/blob/master/keypair.py Vish On Feb 21, 2013, at 2:20 PM, JR wrote: > 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: .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 >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 > > ___ > Mailing list: https://launchpad.net/~openstack > Post to : openstack@lists.launchpad.net > Unsubscribe : https://launchpad.net/~openstack > More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
[Openstack] 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: .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 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 ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp