python-novaclient Python API

asked 2012-03-29 03:03:11 -0500

michael-lin gravatar image

Dear all,

I am trying to use "python-novaclient 2012.1" version for test purpose.

But when I try to use "Quick-start using keystone", I have some problem that I don't know how to solve it.

This is my code below,

from novaclient.v1_1 import client nt = client.Client('admin', '111111', 'admin', 'http://localhost:5000/v2.0/') nt.flavors.list()

and then, I got these error message,

Could not find any suitable endpoint. Correct region? Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/stack/python-novaclient/novaclient/v1_1/", line 39, in list return self._list("/flavors/detail", "flavors") File "/opt/stack/python-novaclient/novaclient/", line 71, in _list resp, body = self.api.client.get(url) File "/opt/stack/python-novaclient/novaclient/", line 136, in get return self._cs_request(url, 'GET', **kwargs) File "/opt/stack/python-novaclient/novaclient/", line 113, in _cs_request self.authenticate() File "/opt/stack/python-novaclient/novaclient/", line 229, in authenticate auth_url = self._v2_auth(auth_url) File "/opt/stack/python-novaclient/novaclient/", line 284, in _v2_auth self._authenticate(url, body) File "/opt/stack/python-novaclient/novaclient/", line 309, in _authenticate return self._extract_service_catalog(url, resp, body) File "/opt/stack/python-novaclient/novaclient/", line 166, in _extract_service_catalog service_name=self.service_name) File "/opt/stack/python-novaclient/novaclient/", line 67, in url_for raise novaclient.exceptions.EndpointNotFound() novaclient.exceptions.EndpointNotFound

Is anyone can help me to solve this question, thanks a lot :D

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2012-03-30 15:32:36 -0500

gongysh gravatar image

we have to specify the version and service_type among other things. See my codes below: ''' Created on Mar 30, 2012

@author: gongys '''

from novaclient import client

if __name__ == '__main__': nt = client.Client('1.1', 'admin', 'password', 'admin', 'http://localhost:5000/v2.0', service_type="compute") flavors = nt.flavors.list() print str(flavors)

edit flag offensive delete link more

answered 2012-04-05 07:38:12 -0500

michael-lin gravatar image

Thanks yong sheng gong, that solved my question.

edit flag offensive delete link more

answered 2012-03-29 06:10:59 -0500

zhonghuabaima0913 gravatar image

Dear all:

  How did you install nova services by nova-2012.1~e4.tar.gz?Could you tell me the relation of nova-2012.1~e4.tar.gz and  python-novaclient-2012.1~e4.tar.gz .


edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2012-03-29 03:03:11 -0500

Seen: 187 times

Last updated: Apr 05 '12