<div dir="ltr">Another helpful article about your question :-)<br><br><a href="http://www.ibm.com/developerworks/cloud/library/cl-openstack-pythonapis/index.html">http://www.ibm.com/developerworks/cloud/library/cl-openstack-pythonapis/index.html</a><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-11 17:15 GMT+08:00 Dmitry Mescheryakov <span dir="ltr"><<a href="mailto:dmescheryakov@mirantis.com" target="_blank">dmescheryakov@mirantis.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Nader,<br>
<br>
You should use python-keystoneclient [1] to obtain the token. You can<br>
find example usage in helper script [2].<br>
<br>
Dmitry<br>
<br>
[1] <a href="https://github.com/openstack/python-keystoneclient" target="_blank">https://github.com/openstack/python-keystoneclient</a><br>
[2] <a href="https://github.com/openstack/savanna/blob/master/tools/get_auth_token.py#L74" target="_blank">https://github.com/openstack/savanna/blob/master/tools/get_auth_token.py#L74</a><br>
<br>
<br>
<br>
2014-03-10 21:25 GMT+04:00 Nader Lahouti <<a href="mailto:nader.lahouti@gmail.com">nader.lahouti@gmail.com</a>>:<br>
<div><div class="h5">> Hi All,<br>
><br>
><br>
> I have a question regarding using novaclient API.<br>
><br>
><br>
> I need to use it for getting a list of instances for an user/project.<br>
><br>
> In oder to do that I tried to use :<br>
><br>
><br>
> from novaclient.v1_1 import client<br>
><br>
> nc = client.Client(username,token_id, project_id, auth_url,insecure,cacert)<br>
><br>
> nc.servers.list()<br>
><br>
><br>
> ( however, the comment on the code/document says different thing which as<br>
> far as tried it didn't work.<br>
><br>
>>>> client = Client(USERNAME, PASSWORD, PROJECT_ID, AUTH_URL)<br>
><br>
><br>
> so it seems token_id has to be provided.<br>
><br>
> I can get the token_id using keystone REST API<br>
> (<a href="http://localhost:5000/v2.0/tokens" target="_blank">http://localhost:5000/v2.0/tokens</a> …-d ' the credentials …username and<br>
> password'.<br>
><br>
> And my question is: how to get credentials for an user in the code when<br>
> using the keystone's REST API? Is there any api to get such an info?<br>
><br>
><br>
> Appreciate your comments.<br>
><br>
><br>
> Regards,<br>
><br>
> Nader.<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>ChangBo Guo(gcb)</div></div>
</div>