diff options
| author | Yuriy Nesenenko <ynesenenko@mirantis.com> | 2015-07-30 16:57:39 +0300 |
|---|---|---|
| committer | Yuriy Nesenenko <ynesenenko@mirantis.com> | 2015-08-19 18:05:34 +0300 |
| commit | 8cc3ee2782260498cfb3d36f5469e7086b4fe6f5 (patch) | |
| tree | ff956a8ac50a535db8e50e2531172cf4c43063d3 /cinderclient/v2/volume_backups.py | |
| parent | bae0bb3276f08b7b4a5441d8178a38e0dfc1e3e6 (diff) | |
| download | python-cinderclient-8cc3ee2782260498cfb3d36f5469e7086b4fe6f5.tar.gz | |
Add support '--all-tenants' for cinder backup-list
Also added support '--name', '--status', '--volume-id' arguments
for cinder backup-list.
DocImpact
Closes-Bug: #1422046
Depends On: I73f6377c7d6fd92d0464d13f9c8dd6682fef78e3
Change-Id: I5f2ab6370a8333a9ee498c6158037b0433f36a23
Diffstat (limited to 'cinderclient/v2/volume_backups.py')
| -rw-r--r-- | cinderclient/v2/volume_backups.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cinderclient/v2/volume_backups.py b/cinderclient/v2/volume_backups.py index 26a6b22..59f0724 100644 --- a/cinderclient/v2/volume_backups.py +++ b/cinderclient/v2/volume_backups.py @@ -16,7 +16,7 @@ """ Volume Backups interface (1.1 extension). """ - +from six.moves.urllib.parse import urlencode from cinderclient import base @@ -68,10 +68,16 @@ class VolumeBackupManager(base.ManagerWithFind): :rtype: list of :class:`VolumeBackup` """ - if detailed is True: - return self._list("/backups/detail", "backups") - else: - return self._list("/backups", "backups") + search_opts = search_opts or {} + + qparams = dict((key, val) for key, val in search_opts.items() if val) + + query_string = ("?%s" % urlencode(qparams)) if qparams else "" + + detail = '/detail' if detailed else '' + + return self._list("/backups%s%s" % (detail, query_string), + "backups") def delete(self, backup): """Delete a volume backup. |
