[openstack-dev] [nova][novaclient] How to get user's credentials for using novaclient API?

Nader Lahouti nader.lahouti at gmail.com
Mon Mar 10 17:25:48 UTC 2014


Hi All,


I have a question regarding using novaclient API.


I need to use it for getting a list of instances for an user/project.

In oder to do that I tried to use :


from novaclient.v1_1 import client

nc = client.Client(*username*,*token_id*, project_id,
auth_url,insecure,cacert)

nc.servers.list()


( however, the comment on the code/document says different thing which as
far as tried it didn't work.

>>> client = Client(USERNAME, *PASSWORD*, PROJECT_ID, AUTH_URL)


so it seems token_id has to be provided.

I can get the token_id using keystone REST API
(*http://localhost:5000/v2.0/tokens
<http://localhost:5000/v2.0/tokens> ...-d ' the credentials ...username and
password'*.

And my question is: how to get credentials for an user in the code when
using the keystone's REST API? Is there any api to get such an info?


Appreciate your comments.


Regards,

Nader.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140310/eb7c6a17/attachment.html>


More information about the OpenStack-dev mailing list