From 79d0e21a4519de57a25ccd4a06a26795dba5636d Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Mon, 5 Jan 2015 20:26:35 -0500 Subject: [PATCH] Command doc: backup Change-Id: Iecd4dbddea637bd6540d94b37253a9ba434c9db3 --- doc/source/command-objects/backup.rst | 104 ++++++++++++++++++++++++++ doc/source/commands.rst | 2 +- openstackclient/volume/v1/backup.py | 22 +++--- 3 files changed, 116 insertions(+), 12 deletions(-) create mode 100644 doc/source/command-objects/backup.rst diff --git a/doc/source/command-objects/backup.rst b/doc/source/command-objects/backup.rst new file mode 100644 index 0000000000..ec201aa3d5 --- /dev/null +++ b/doc/source/command-objects/backup.rst @@ -0,0 +1,104 @@ +====== +backup +====== + +Volume v1 + +backup create +------------- + +Create new backup + +.. program:: backup create +.. code:: bash + + os backup create + [--container ] + [--name ] + [--description ] + + +.. option:: --container + + Optional backup container name + +.. option:: --name + + Name of the backup + +.. option:: --description + + Description of the backup + +.. _backup_create-backup: +.. describe:: + + Volume to backup (name or ID) + +backup delete +------------- + +Delete backup(s) + +.. program:: backup delete +.. code:: bash + + os backup delete + [ ...] + +.. _backup_delete-backup: +.. describe:: + + Backup(s) to delete (ID only) + +backup list +----------- + +List backups + +.. program:: backup list +.. code:: bash + + os backup list + +.. _backup_list-backup: +.. option:: --long + + List additional fields in output + +backup restore +-------------- + +Restore backup + +.. program:: backup restore +.. code:: bash + + os backup restore + + + +.. _backup_restore-backup: +.. describe:: + + Backup to restore (ID only) + +.. describe:: + + Volume to restore to (name or ID) + +backup show +----------- + +Display backup details + +.. program:: backup show +.. code:: bash + + os backup show + + +.. _backup_show-backup: +.. describe:: + + Backup to display (ID only) diff --git a/doc/source/commands.rst b/doc/source/commands.rst index 4b2e6355e4..4649b012c2 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -72,7 +72,7 @@ referring to both Compute and Volume quotas. * ``access token``: Identity - long-lived OAuth-based token * ``availability zone``: (**Compute**) a logical partition of hosts or volume services * ``aggregate``: (**Compute**) a grouping of servers -* ``backup``: Volume - a volume copy +* ``backup``: (**Volume**) a volume copy * ``catalog``: (**Identity**) service catalog * ``console log``: (**Compute**) server console text dump * ``console url``: (**Compute**) server remote console URL diff --git a/openstackclient/volume/v1/backup.py b/openstackclient/volume/v1/backup.py index eab388a59f..71c8ed3832 100644 --- a/openstackclient/volume/v1/backup.py +++ b/openstackclient/volume/v1/backup.py @@ -27,7 +27,7 @@ from openstackclient.common import utils class CreateBackup(show.ShowOne): - """Create backup command""" + """Create new backup""" log = logging.getLogger(__name__ + '.CreateBackup') @@ -36,13 +36,13 @@ class CreateBackup(show.ShowOne): parser.add_argument( 'volume', metavar='', - help='The name or ID of the volume to backup', + help='Volume to backup (name or ID)', ) parser.add_argument( '--container', metavar='', required=False, - help='Optional backup container name.', + help='Optional backup container name', ) parser.add_argument( '--name', @@ -84,7 +84,7 @@ class DeleteBackup(command.Command): 'backups', metavar='', nargs="+", - help='Backup(s) to delete (name or ID)', + help='Backup(s) to delete (ID only)', ) return parser @@ -99,7 +99,7 @@ class DeleteBackup(command.Command): class ListBackup(lister.Lister): - """List backup command""" + """List backups""" log = logging.getLogger(__name__ + '.ListBackup') @@ -156,7 +156,7 @@ class ListBackup(lister.Lister): class RestoreBackup(command.Command): - """Restore backup command""" + """Restore backup""" log = logging.getLogger(__name__ + '.RestoreBackup') @@ -165,11 +165,11 @@ class RestoreBackup(command.Command): parser.add_argument( 'backup', metavar='', - help='ID of backup to restore') + help='Backup to restore (ID only)') parser.add_argument( 'volume', - metavar='', - help='ID of volume to restore to') + metavar='', + help='Volume to restore to (name or ID)') return parser def take_action(self, parsed_args): @@ -184,7 +184,7 @@ class RestoreBackup(command.Command): class ShowBackup(show.ShowOne): - """Show backup command""" + """Display backup details""" log = logging.getLogger(__name__ + '.ShowBackup') @@ -193,7 +193,7 @@ class ShowBackup(show.ShowOne): parser.add_argument( 'backup', metavar='', - help='Name or ID of backup to display') + help='Backup to display (ID only)') return parser def take_action(self, parsed_args):