add doc for role assignment command

Change-Id: I594d444b6d1ec4e72bed03394178293737f26069
This commit is contained in:
wanghong 2014-12-23 11:43:02 +08:00
parent a24d6e7c6f
commit e3ba13b320
2 changed files with 51 additions and 6 deletions

View File

@ -0,0 +1,45 @@
===============
role assignment
===============
Identity v3
role assignment list
--------------------
List role assignments
.. program:: role assignment list
.. code:: bash
os role assignment list
[--role <role>]
[--user <user>]
[--group <group>]
[--domain <domain>]
[--project <project>]
[--effective]
.. option:: --role <role>
Role to filter (name or ID)
.. option:: --user <user>
User to filter (name or ID)
.. option:: --group <group>
Group to filter (name or ID)
.. option:: --domain <domain>
Domain to filter (name or ID)
.. option:: --project <project>
Project to filter (name or ID)
.. option:: --effective
Returns only effective role assignments (defaults to False)

View File

@ -21,7 +21,7 @@ from openstackclient.common import utils
class ListRoleAssignment(lister.Lister): class ListRoleAssignment(lister.Lister):
"""Lists role assignments according to the given filters""" """List role assignments"""
log = logging.getLogger(__name__ + '.ListRoleAssignment') log = logging.getLogger(__name__ + '.ListRoleAssignment')
@ -36,29 +36,29 @@ class ListRoleAssignment(lister.Lister):
parser.add_argument( parser.add_argument(
'--role', '--role',
metavar='<role>', metavar='<role>',
help='Name or ID of role to filter', help='Role to filter (name or ID)',
) )
user_or_group = parser.add_mutually_exclusive_group() user_or_group = parser.add_mutually_exclusive_group()
user_or_group.add_argument( user_or_group.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
help='Name or ID of user to filter', help='User to filter (name or ID)',
) )
user_or_group.add_argument( user_or_group.add_argument(
'--group', '--group',
metavar='<group>', metavar='<group>',
help='Name or ID of group to filter', help='Group to filter (name or ID)',
) )
domain_or_project = parser.add_mutually_exclusive_group() domain_or_project = parser.add_mutually_exclusive_group()
domain_or_project.add_argument( domain_or_project.add_argument(
'--domain', '--domain',
metavar='<domain>', metavar='<domain>',
help='Name or ID of domain to filter', help='Domain to filter (name or ID)',
) )
domain_or_project.add_argument( domain_or_project.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
help='Name or ID of project to filter', help='Project to filter (name or ID)',
) )
return parser return parser