← Back to team overview

openstack team mailing list archive

Re: Issue about get all instance servers using admin token

 

Hi zhiqiang,
you can use admin tenant and it's token to get server details like this:
nova --debug show instance_uuid
and you will see the request detail like this:
REQ: curl -i http://localhost:8774/v1.1/1c05803250e04a84864888e913e80584/servers/2652ce2e-d661-44bf-b561-3487d309cb6b -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: 277c1d5679ff40579c79d058835540d8"
"277c1d5679ff40579c79d058835540d8" this token is belong to amdin tenant "1c05803250e04a84864888e913e80584".
the 2652ce2e-d661-44bf-b561-3487d309cb6b is belong to a common user not admin,and I can get it's details by request above.

2013-01-09



Wangpan



发件人:Zhiqiang Zhao
发送时间:2013-01-09 10:08
主题:[Openstack] Issue about get all instance servers using admin token
收件人:"openstack"<openstack@xxxxxxxxxxxxxxxxxxx>
抄送:

Hi experts,


I'm using openstack rest admin api recently. I notice that we can use admin token to get all tenants id.
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. 
for example:
GET http://host:8774/v2/tenant_id/servers
X-Auth-Token : tenant_tokenid


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.
for example:
POST http://host:35357/v2.0/tokens
X-Auth-Token : admin_token
{
    "auth":{
        "passwordCredentials":{
            "username":"admin_name",
            "password":"admin_pwd"
        },
        "tenantName":"***"
    }
}


If admin role is not a member of one project then we can't get a token id for that project.
But when I use GUI web page and login by admin account, I can see all projects and also I can manage them.
So do you have any idea that we can only use admin token to get all projects details?


Thank you!


Best Regards!
Henry

References