Openstack的keystone的user-role-list命令的使用

CL.TANG發表於2016-10-18

直接在shell模式下執行

[root@node-5 ~]# keystone user-role-list
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
'Client' object has no attribute 'auth_tenant_id'

執行

[root@node-5 ~]# keystone help user-role-list
usage: keystone user-role-list [--user <user>] [--tenant <tenant>]

List roles granted to a user

Arguments:
  --user <user>, --user-id <user>
                        List roles granted to a user
  --tenant <tenant>, --tenant-id <tenant>
                        List roles granted on a tenant

表示需要提供使用者ID,租戶ID,最終得到的是一個使用者在一個專案中的角色列表。

[root@node-5 ~]# keystone user-role-list --user-id 0be5b5d8a7334b0797ba38d017b4779c --tenant-id 6afef8e2e5db4074b1a445f7563345ba 
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+----------------------------------+--------+----------------------------------+----------------------------------+
|                id                |  name  |             user_id              |            tenant_id             |
+----------------------------------+--------+----------------------------------+----------------------------------+
| 2262da376eb549a6a8ffcde6920c1a67 | Member | 0be5b5d8a7334b0797ba38d017b4779c | 6afef8e2e5db4074b1a445f7563345ba |
| 975b2c24fa53461f97ef1186e55b6ecf | admin  | 0be5b5d8a7334b0797ba38d017b4779c | 6afef8e2e5db4074b1a445f7563345ba |
+----------------------------------+--------+----------------------------------+----------------------------------+

相關文章