<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(scrollbar.css); --></STYLE>

<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>                   body{FONT-SIZE:12pt; FONT-FAMILY:宋体,serif;}         </STYLE>

<META name=GENERATOR content="MSHTML 8.00.7601.17824"><BASE 
target=_blank></HEAD>
<BODY 
style="LINE-HEIGHT: 1.3; BORDER-RIGHT-WIDTH: 0px; MARGIN: 12px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" 
marginheight="0" marginwidth="0">
<DIV><FONT color=#000000 size=3 face=宋体>Hi 
zhiqiang,</FONT></DIV>
<DIV>you can use admin tenant and it's token to get server details like 
this:</DIV>
<DIV>nova --debug show instance_uuid</DIV>
<DIV>and you will see the request detail like this:</DIV>
<DIV>REQ: curl -i <A 
href="http://localhost:8774/v1.1/1c05803250e04a84864888e913e80584/servers/2652ce2e-d661-44bf-b561-3487d309cb6b">http://localhost:8774/v1.1/1c05803250e04a84864888e913e80584/servers/2652ce2e-d661-44bf-b561-3487d309cb6b</A> 
-X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H 
"Accept: application/json" -H "X-Auth-Token: 
277c1d5679ff40579c79d058835540d8"</DIV>
<DIV>"277c1d5679ff40579c79d058835540d8" this token is belong to amdin tenant 
"<U><FONT color=#0066cc>1c05803250e04a84864888e913e80584".</FONT></U></DIV>
<DIV>the <FONT color=#0066cc><U>2652ce2e-d661-44bf-b561-3487d309cb6b</U> 
</FONT><FONT color=#000000>is belong to a common user not admin,and I can get 
it's details by request above.</FONT></DIV>
<DIV> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana>2013-01-09</FONT></DIV>
<DIV align=left><FONT size=2 face=Verdana>
<HR style="WIDTH: 122px; HEIGHT: 2px" id=SignNameHR align=left SIZE=2>
</FONT></DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana><SPAN 
id=_FlashSignName>Wangpan</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Verdana>
<HR>
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG>Zhiqiang Zhao</FONT></DIV>
<DIV><FONT size=2 
face=Verdana><STRONG>发送时间:</STRONG>2013-01-09 10:08</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG>[Openstack] Issue about get 
all instance servers using admin token</FONT></DIV>
<DIV><FONT size=2 
face=Verdana><STRONG>收件人:</STRONG>"openstack"<openstack@lists.launchpad.net></FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG></FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>
<DIV 
style="LINE-HEIGHT: 1.7; FONT-FAMILY: arial; COLOR: #000000; FONT-SIZE: 14px">
<DIV>Hi experts,</DIV>
<DIV><BR></DIV>
<DIV>I'm using openstack rest admin api recently. I notice that we can use admin 
token to get all tenants id.</DIV>
<DIV>And now I want to use admin  token to get all projects details(like 
servers). But according to nova REST api, we need to get all project tokens 
firstly. </DIV>
<DIV>for example:</DIV>
<DIV>GET http://host:8774/v2/tenant_id/servers</DIV>
<DIV>X-Auth-Token : tenant_tokenid</DIV>
<DIV><BR></DIV>
<DIV>And if we need to get these tokens, we would let admin role be at least a 
member of all projects. So that we can get tanant's token id.</DIV>
<DIV>for example:</DIV>
<DIV>POST http://host:35357/v2.0/tokens</DIV>
<DIV>X-Auth-Token : admin_token</DIV>
<DIV>{</DIV>
<DIV>    "auth":{</DIV>
<DIV>        "passwordCredentials":{</DIV>
<DIV>            "username":"admin_name",</DIV>
<DIV>            "password":"admin_pwd"</DIV>
<DIV>        },</DIV>
<DIV>        "tenantName":"***"</DIV>
<DIV>    }</DIV>
<DIV>}</DIV>
<DIV><BR></DIV>
<DIV>If admin role is not a member of one project then we can't get a token id 
for that project.</DIV>
<DIV>But when I use GUI web page and login by admin account, I can see all 
projects and also I can manage them.</DIV>
<DIV>So do you have any idea that we can only use admin token to get all 
projects details?</DIV>
<DIV><BR></DIV>
<DIV>Thank you!</DIV>
<DIV><BR></DIV>
<DIV>Best Regards!</DIV>
<DIV>Henry</DIV>
<DIV><BR></DIV></DIV><BR><BR><SPAN title=neteasefooter><SPAN 
id=netease_mail_footer></SPAN></SPAN></FONT></DIV></BODY></HTML>