Skip to content

Commit

Permalink
backup: add download_only parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Sep 21, 2021
1 parent f574743 commit 9122740
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions linstor/linstorapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3485,7 +3485,8 @@ def backup_restore(
resource_name=None,
bak_id=None,
passphrase=None,
stor_pool_map=None):
stor_pool_map=None,
download_only=False):
self._require_version("1.10.0", msg="Backups are not supported by server")

path = "/v1/remotes/{rn}/backups/restore".format(rn=remote_name)
Expand All @@ -3502,6 +3503,9 @@ def backup_restore(
body["passphrase"] = passphrase
if stor_pool_map:
body["stor_pool_map"] = stor_pool_map
if download_only:
body["download_only"] = download_only

return self._rest_request(
apiconsts.API_RESTORE_BACKUP,
"POST",
Expand Down Expand Up @@ -3541,7 +3545,8 @@ def backup_ship(
dst_node=None,
dst_net_if=None,
dst_stor_pool=None,
stor_pool_rename=None):
stor_pool_rename=None,
download_only=False):
self._require_version("1.10.0", msg="Backups are not supported by server")

path = "/v1/remotes/{rn}/backups/ship".format(rn=remote_name)
Expand All @@ -3560,6 +3565,8 @@ def backup_ship(
body["dst_stor_pool"] = dst_stor_pool
if stor_pool_rename:
body["stor_pool_rename"] = stor_pool_rename
if download_only:
body["download_only"] = download_only

return self._rest_request(
apiconsts.API_SHIP_BACKUP,
Expand Down

0 comments on commit 9122740

Please sign in to comment.