add doc for group command

Change-Id: Iaaa0aeb42f9f940af63863f5d09011b5f7529281
This commit is contained in:
wanghong 2014-12-23 12:14:32 +08:00
parent a24d6e7c6f
commit e5d71221ad
2 changed files with 210 additions and 18 deletions
doc/source/command-objects
openstackclient/identity/v3

@ -0,0 +1,192 @@
=====
group
=====
Identity v3
group add user
--------------
Add user to group
.. program:: group add user
.. code:: bash
os group add user
<group>
<user>
.. option:: <group>
Group that user will be added to (name or ID)
.. option:: <user>
User to add to group (name or ID)
group contains user
-------------------
Check user in group
.. program:: group contains user
.. code:: bash
os group contains user
<group>
<user>
.. option:: <group>
Group to check if user belongs to (name or ID)
.. option:: <user>
User to check (name or ID)
group create
------------
Create new group
.. program:: group create
.. code:: bash
os group create
[--domain <domain>]
[--description <description>]
[--or-show]
<group-name>
.. option:: --domain <domain>
References the domain ID or name which owns the group
.. option:: --description <description>
New group description
.. option:: --or-show
Return existing group
If the group already exists, return the existing group data and do not fail.
.. option:: <group-name>
New group name
group delete
------------
Delete group
.. program:: group delete
.. code:: bash
os group delete
[--domain <domain>]
<group> [<group> ...]
.. option:: --domain <domain>
Domain where group resides (name or ID)
.. option:: <group>
Group(s) to delete (name or ID)
group list
----------
List groups
.. program:: group list
.. code:: bash
os group list
[--domain <domain>]
[--user <user>]
[--long]
.. option:: --domain <domain>
Filter group list by <domain> (name or ID)
.. option:: --user <user>
List group memberships for <user> (name or ID)
.. option:: --long
List additional fields in output (defaults to false)
group remove user
-----------------
Remove user from group
.. program:: group remove user
.. code:: bash
os group remove user
<group>
<user>
.. option:: <group>
Group that user will be removed from (name or ID)
.. option:: <user>
User to remove from group (name or ID)
group set
---------
Set group properties
.. program:: group set
.. code:: bash
os group set
[--name <name>]
[--domain <domain>]
[--description <description>]
<group>
.. option:: --name <name>
New group name
.. option:: --domain <domain>
New domain that will now own the group (name or ID)
.. option:: --description <description>
New group description
.. option:: <group>
Group to modify (name or ID)
group show
----------
Show group details
.. program:: group show
.. code:: bash
os group show
[--domain <domain>]
<group>
.. option:: --domain <domain>
Domain where group resides (name or ID)
.. option:: <group>
Group to display (name or ID)

@ -39,12 +39,12 @@ class AddUserToGroup(command.Command):
parser.add_argument(
'group',
metavar='<group>',
help='Group name or ID that user will be added to',
help='Group that user will be added to (name or ID)',
)
parser.add_argument(
'user',
metavar='<user>',
help='User name or ID to add to group',
help='User to add to group (name or ID)',
)
return parser
@ -68,7 +68,7 @@ class AddUserToGroup(command.Command):
class CheckUserInGroup(command.Command):
"""Checks that user is in a specific group"""
"""Check user in group"""
log = logging.getLogger(__name__ + '.CheckUserInGroup')
@ -77,12 +77,12 @@ class CheckUserInGroup(command.Command):
parser.add_argument(
'group',
metavar='<group>',
help='Group name or ID that user will be added to',
help='Group to check if user belongs to (name or ID)',
)
parser.add_argument(
'user',
metavar='<user>',
help='User name or ID to add to group',
help='User to check (name or ID)',
)
return parser
@ -106,7 +106,7 @@ class CheckUserInGroup(command.Command):
class CreateGroup(show.ShowOne):
"""Create group command"""
"""Create new group"""
log = logging.getLogger(__name__ + '.CreateGroup')
@ -118,11 +118,11 @@ class CreateGroup(show.ShowOne):
help='New group name')
parser.add_argument(
'--description',
metavar='<group-description>',
metavar='<description>',
help='New group description')
parser.add_argument(
'--domain',
metavar='<group-domain>',
metavar='<domain>',
help='References the domain ID or name which owns the group')
parser.add_argument(
'--or-show',
@ -268,12 +268,12 @@ class RemoveUserFromGroup(command.Command):
parser.add_argument(
'group',
metavar='<group>',
help='Group name or ID that user will be removed from',
help='Group that user will be removed from (name or ID)',
)
parser.add_argument(
'user',
metavar='<user>',
help='User name or ID to remove from group',
help='User to remove from group (name or ID)',
)
return parser
@ -297,7 +297,7 @@ class RemoveUserFromGroup(command.Command):
class SetGroup(command.Command):
"""Set group command"""
"""Set group properties"""
log = logging.getLogger(__name__ + '.SetGroup')
@ -306,18 +306,18 @@ class SetGroup(command.Command):
parser.add_argument(
'group',
metavar='<group>',
help='Name or ID of group to change')
help='Group to modify (name or ID)')
parser.add_argument(
'--name',
metavar='<new-group-name>',
metavar='<name>',
help='New group name')
parser.add_argument(
'--domain',
metavar='<group-domain>',
help='New domain name or ID that will now own the group')
metavar='<domain>',
help='New domain that will now own the group (name or ID)')
parser.add_argument(
'--description',
metavar='<group-description>',
metavar='<description>',
help='New group description')
return parser
@ -341,7 +341,7 @@ class SetGroup(command.Command):
class ShowGroup(show.ShowOne):
"""Show group command"""
"""Show group details"""
log = logging.getLogger(__name__ + '.ShowGroup')
@ -350,7 +350,7 @@ class ShowGroup(show.ShowOne):
parser.add_argument(
'group',
metavar='<group>',
help='Name or ID of group to display',
help='Group to display (name or ID)',
)
parser.add_argument(
'--domain',