summaryrefslogtreecommitdiff
path: root/cinderclient/v2/volume_backups.py
diff options
context:
space:
mode:
authorXing Yang <xing.yang@emc.com>2015-07-21 15:06:39 -0400
committerXing Yang <xing.yang@emc.com>2015-08-11 10:18:01 -0400
commit2c3169e55e533154bb24e9b1eb9aa94a3e01719a (patch)
treea5cb6b9a00c94d776b7ccbd6412f513094a235f6 /cinderclient/v2/volume_backups.py
parentb573e90d67c4777e1f6d0f2d4ab16013b02c0feb (diff)
downloadpython-cinderclient-2c3169e55e533154bb24e9b1eb9aa94a3e01719a.tar.gz
CLI: Non-disruptive backup
This is the CLI change required to support non-disruptive backup for volumes in 'in-use' status. A force flag is added to the create backup CLI. The force flag needs to be True when backing up an 'in-use' volume. By default it is False and it is not needed when backing up an 'available' volume. The Cinder server side change is merged: https://review.openstack.org/#/c/193937/ Partial-implements blueprint non-disruptive-backup Change-Id: I53aff3973cc6365a5b1d40c21b0885c1d8166df5
Diffstat (limited to 'cinderclient/v2/volume_backups.py')
-rw-r--r--cinderclient/v2/volume_backups.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cinderclient/v2/volume_backups.py b/cinderclient/v2/volume_backups.py
index 59f0724..70fda60 100644
--- a/cinderclient/v2/volume_backups.py
+++ b/cinderclient/v2/volume_backups.py
@@ -38,7 +38,7 @@ class VolumeBackupManager(base.ManagerWithFind):
def create(self, volume_id, container=None,
name=None, description=None,
- incremental=False):
+ incremental=False, force=False):
"""Creates a volume backup.
:param volume_id: The ID of the volume to backup.
@@ -46,13 +46,15 @@ class VolumeBackupManager(base.ManagerWithFind):
:param name: The name of the backup.
:param description: The description of the backup.
:param incremental: Incremental backup.
+ :param force: If True, allows an in-use volume to be backed up.
:rtype: :class:`VolumeBackup`
"""
body = {'backup': {'volume_id': volume_id,
'container': container,
'name': name,
'description': description,
- 'incremental': incremental}}
+ 'incremental': incremental,
+ 'force': force, }}
return self._create('/backups', body, 'backup')
def get(self, backup_id):