Skip to content

Commit 144b273

Browse files
committed
add download function
1 parent 53ff561 commit 144b273

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

urbackup_api/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,22 @@ def get_backup_content(self, clientid, backupid, path="/"):
460460

461461
return content["files"]
462462

463+
def download_backup_file(self, clientid, backupid, path="/"):
464+
if not self.login():
465+
return None
466+
467+
response = self._get_response("backups", {
468+
"sa": "filesdl",
469+
"clientid": clientid,
470+
"backupid": backupid,
471+
"path": path
472+
}, "GET")
473+
474+
if response.status != 200:
475+
return None
476+
477+
return response
478+
463479
def get_groups(self):
464480
if not self.login():
465481
return None

0 commit comments

Comments
 (0)