Merge "Command doc: snapshot"

This commit is contained in:
Jenkins 2015-01-09 09:17:42 +00:00 committed by Gerrit Code Review
commit f8d4dd25b4
3 changed files with 145 additions and 12 deletions

View File

@ -0,0 +1,133 @@
========
snapshot
========
Volume v1
snapshot create
---------------
Create new snapshot
.. program:: snapshot create
.. code:: bash
os snapshot create
[--name <name>]
[--description <description>]
[--force]
<volume>
.. option:: --name <name>
Name of the snapshot
.. option:: --description <description>
Description of the snapshot
.. option:: --force
Create a snapshot attached to an instance. Default is False
.. _snapshot_create-snapshot:
.. describe:: <volume>
Volume to snapshot (name or ID)
snapshot delete
---------------
Delete snapshot(s)
.. program:: snapshot delete
.. code:: bash
os snapshot delete
<snapshot> [<snapshot> ...]
.. _snapshot_delete-snapshot:
.. describe:: <snapshot>
Snapshot(s) to delete (name or ID)
snapshot list
-------------
List snapshots
.. program:: snapshot list
.. code:: bash
os snapshot list
.. option:: --long
List additional fields in output
snapshot set
------------
Set snapshot properties
.. program:: snapshot set
.. code:: bash
os snapshot set
[--name <name>]
[--description <description>]
[--property <key=value> [...] ]
<snapshot>
.. _snapshot_restore-snapshot:
.. option:: --name <name>
New snapshot name
.. option:: --description <description>
New snapshot description
.. option:: --property <key=value>
Property to add or modify for this snapshot (repeat option to set multiple properties)
.. describe:: <snapshot>
Snapshot to modify (name or ID)
snapshot show
-------------
Display snapshot details
.. program:: snapshot show
.. code:: bash
os snapshot show
<snapshot>
.. _snapshot_show-snapshot:
.. describe:: <snapshot>
Snapshot to display (name or ID)
snapshot unset
--------------
Unset snapshot properties
.. program:: snapshot unset
.. code:: bash
os snapshot unset
[--property <key>]
<snapshot>
.. option:: --property <key>
Property to remove from snapshot (repeat option to remove multiple properties)
.. describe:: <snapshot>
Snapshot to modify (name or ID)

View File

@ -110,7 +110,7 @@ referring to both Compute and Volume quotas.
* ``server``: (**Compute**) virtual machine instance * ``server``: (**Compute**) virtual machine instance
* ``server image``: (**Compute**) saved server disk image * ``server image``: (**Compute**) saved server disk image
* ``service``: Identity - a cloud service * ``service``: Identity - a cloud service
* ``snapshot``: Volume - a point-in-time copy of a volume * ``snapshot``: (**Volume**) a point-in-time copy of a volume
* ``token``: (**Identity**) a bearer token managed by Identity service * ``token``: (**Identity**) a bearer token managed by Identity service
* ``usage``: (**Compute**) display host resources being consumed * ``usage``: (**Compute**) display host resources being consumed
* ``user``: (**Identity**) individual cloud resources users * ``user``: (**Identity**) individual cloud resources users

View File

@ -28,7 +28,7 @@ from openstackclient.common import utils
class CreateSnapshot(show.ShowOne): class CreateSnapshot(show.ShowOne):
"""Create snapshot command""" """Create new snapshot"""
log = logging.getLogger(__name__ + '.CreateSnapshot') log = logging.getLogger(__name__ + '.CreateSnapshot')
@ -37,7 +37,7 @@ class CreateSnapshot(show.ShowOne):
parser.add_argument( parser.add_argument(
'volume', 'volume',
metavar='<volume>', metavar='<volume>',
help='The name or ID of the volume to snapshot', help='Volume to snapshot (name or ID)',
) )
parser.add_argument( parser.add_argument(
'--name', '--name',
@ -104,7 +104,7 @@ class DeleteSnapshot(command.Command):
class ListSnapshot(lister.Lister): class ListSnapshot(lister.Lister):
"""List snapshot command""" """List snapshots"""
log = logging.getLogger(__name__ + '.ListSnapshot') log = logging.getLogger(__name__ + '.ListSnapshot')
@ -167,7 +167,7 @@ class ListSnapshot(lister.Lister):
class SetSnapshot(command.Command): class SetSnapshot(command.Command):
"""Set snapshot command""" """Set snapshot properties"""
log = logging.getLogger(__name__ + '.SetSnapshot') log = logging.getLogger(__name__ + '.SetSnapshot')
@ -176,14 +176,14 @@ class SetSnapshot(command.Command):
parser.add_argument( parser.add_argument(
'snapshot', 'snapshot',
metavar='<snapshot>', metavar='<snapshot>',
help='Name or ID of snapshot to change') help='Snapshot to modify (name or ID)')
parser.add_argument( parser.add_argument(
'--name', '--name',
metavar='<snapshot-name>', metavar='<name>',
help='New snapshot name') help='New snapshot name')
parser.add_argument( parser.add_argument(
'--description', '--description',
metavar='<snapshot-description>', metavar='<description>',
help='New snapshot description') help='New snapshot description')
parser.add_argument( parser.add_argument(
'--property', '--property',
@ -219,7 +219,7 @@ class SetSnapshot(command.Command):
class ShowSnapshot(show.ShowOne): class ShowSnapshot(show.ShowOne):
"""Show snapshot command""" """Display snapshot details"""
log = logging.getLogger(__name__ + '.ShowSnapshot') log = logging.getLogger(__name__ + '.ShowSnapshot')
@ -228,7 +228,7 @@ class ShowSnapshot(show.ShowOne):
parser.add_argument( parser.add_argument(
'snapshot', 'snapshot',
metavar='<snapshot>', metavar='<snapshot>',
help='Name or ID of snapshot to display') help='Snapshot to display (name or ID)')
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -254,14 +254,14 @@ class UnsetSnapshot(command.Command):
parser.add_argument( parser.add_argument(
'snapshot', 'snapshot',
metavar='<snapshot>', metavar='<snapshot>',
help='snapshot to change (name or ID)', help='Snapshot to modify (name or ID)',
) )
parser.add_argument( parser.add_argument(
'--property', '--property',
metavar='<key>', metavar='<key>',
action='append', action='append',
default=[], default=[],
help='Property key to remove from snapshot ' help='Property to remove from snapshot '
'(repeat to remove multiple values)', '(repeat to remove multiple values)',
) )
return parser return parser