summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/tests/volume/v2/test_backup.py4
-rw-r--r--openstackclient/volume/v2/backup.py7
2 files changed, 11 insertions, 0 deletions
diff --git a/openstackclient/tests/volume/v2/test_backup.py b/openstackclient/tests/volume/v2/test_backup.py
index ce26a2d6..31bfa64c 100644
--- a/openstackclient/tests/volume/v2/test_backup.py
+++ b/openstackclient/tests/volume/v2/test_backup.py
@@ -79,6 +79,7 @@ class TestBackupCreate(TestBackup):
"--description", self.new_backup.description,
"--container", self.new_backup.container,
"--force",
+ "--incremental",
"--snapshot", self.new_backup.snapshot_id,
self.new_backup.volume_id,
]
@@ -87,6 +88,7 @@ class TestBackupCreate(TestBackup):
("description", self.new_backup.description),
("container", self.new_backup.container),
("force", True),
+ ("incremental", True),
("snapshot", self.new_backup.snapshot_id),
("volume", self.new_backup.volume_id),
]
@@ -100,6 +102,7 @@ class TestBackupCreate(TestBackup):
name=self.new_backup.name,
description=self.new_backup.description,
force=True,
+ incremental=True,
snapshot_id=self.new_backup.snapshot_id,
)
self.assertEqual(self.columns, columns)
@@ -126,6 +129,7 @@ class TestBackupCreate(TestBackup):
name=None,
description=self.new_backup.description,
force=False,
+ incremental=False,
snapshot_id=None,
)
self.assertEqual(self.columns, columns)
diff --git a/openstackclient/volume/v2/backup.py b/openstackclient/volume/v2/backup.py
index fed5f09e..49226bcc 100644
--- a/openstackclient/volume/v2/backup.py
+++ b/openstackclient/volume/v2/backup.py
@@ -59,6 +59,12 @@ class CreateBackup(command.ShowOne):
default=False,
help=_("Allow to back up an in-use volume")
)
+ parser.add_argument(
+ '--incremental',
+ action='store_true',
+ default=False,
+ help=_("Perform an incremental backup")
+ )
return parser
def take_action(self, parsed_args):
@@ -75,6 +81,7 @@ class CreateBackup(command.ShowOne):
name=parsed_args.name,
description=parsed_args.description,
force=parsed_args.force,
+ incremental=parsed_args.incremental,
snapshot_id=snapshot_id,
)
backup._info.pop("links", None)