Skip to content

Commit

Permalink
add doc for domain command
Browse files Browse the repository at this point in the history
Change-Id: I8b5575a5f27362fa375746b955e1f17a5a8b29a6
  • Loading branch information
wanghonghw committed Dec 24, 2014
1 parent a24d6e7 commit d240b70
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 12 deletions.
115 changes: 115 additions & 0 deletions doc/source/command-objects/domain.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
======
domain
======

Identity v3

domain create
-------------

Create new domain

.. program:: domain create
.. code:: bash
os domain create
[--description <description>]
[--enable | --disable]
[--or-show]
<domain-name>
.. option:: --description <description>

New domain description

.. option:: --enable

Enable domain (default)

.. option:: --disable

Disable domain

.. option:: --or-show

Return existing domain

If the domain already exists, return the existing domain data and do not fail.

.. option:: <domain-name>

New domain name

domain delete
-------------

Delete domain

.. program:: domain delete
.. code:: bash
os domain delete
<domain>
.. option:: <domain>

Domain to delete (name or ID)

domain list
-----------

List domains

.. program:: domain list
.. code:: bash
os domain list
domain set
----------

Set domain properties

.. program:: domain set
.. code:: bash
os domain set
[--name <name>]
[--description <description>]
[--enable | --disable]
<domain>
.. option:: --name <name>

New domain name

.. option:: --description <description>

New domain description

.. option:: --enable

Enable domain

.. option:: --disable

Disable domain

.. option:: <domain>

Domain to modify (name or ID)

domain show
-----------

Show domain details

.. program:: domain show
.. code:: bash
os domain show
<domain>
.. option:: <domain>

Domain to display (name or ID)
24 changes: 12 additions & 12 deletions openstackclient/identity/v3/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


class CreateDomain(show.ShowOne):
"""Create domain command"""
"""Create new domain"""

log = logging.getLogger(__name__ + '.CreateDomain')

Expand All @@ -42,7 +42,7 @@ def get_parser(self, prog_name):
)
parser.add_argument(
'--description',
metavar='<domain-description>',
metavar='<description>',
help='New domain description',
)
enable_group = parser.add_mutually_exclusive_group()
Expand Down Expand Up @@ -87,7 +87,7 @@ def take_action(self, parsed_args):


class DeleteDomain(command.Command):
"""Delete domain command"""
"""Delete domain"""

log = logging.getLogger(__name__ + '.DeleteDomain')

Expand All @@ -96,7 +96,7 @@ def get_parser(self, prog_name):
parser.add_argument(
'domain',
metavar='<domain>',
help='Name or ID of domain to delete',
help='Domain to delete (name or ID)',
)
return parser

Expand All @@ -110,7 +110,7 @@ def take_action(self, parsed_args):


class ListDomain(lister.Lister):
"""List domain command"""
"""List domains"""

log = logging.getLogger(__name__ + '.ListDomain')

Expand All @@ -126,7 +126,7 @@ def take_action(self, parsed_args):


class SetDomain(command.Command):
"""Set domain command"""
"""Set domain properties"""

log = logging.getLogger(__name__ + '.SetDomain')

Expand All @@ -135,24 +135,24 @@ def get_parser(self, prog_name):
parser.add_argument(
'domain',
metavar='<domain>',
help='Name or ID of domain to change',
help='Domain to modify (name or ID)',
)
parser.add_argument(
'--name',
metavar='<new-domain-name>',
metavar='<name>',
help='New domain name',
)
parser.add_argument(
'--description',
metavar='<domain-description>',
metavar='<description>',
help='New domain description',
)
enable_group = parser.add_mutually_exclusive_group()
enable_group.add_argument(
'--enable',
dest='enabled',
action='store_true',
help='Enable domain (default)',
help='Enable domain',
)
enable_group.add_argument(
'--disable',
Expand Down Expand Up @@ -185,7 +185,7 @@ def take_action(self, parsed_args):


class ShowDomain(show.ShowOne):
"""Show domain command"""
"""Show domain details"""

log = logging.getLogger(__name__ + '.ShowDomain')

Expand All @@ -194,7 +194,7 @@ def get_parser(self, prog_name):
parser.add_argument(
'domain',
metavar='<domain>',
help='Name or ID of domain to display',
help='Domain to display (name or ID)',
)
return parser

Expand Down

0 comments on commit d240b70

Please sign in to comment.