From 98c053010d7a5bbd1a4dd0fa759437afd29ac223 Mon Sep 17 00:00:00 2001 From: mwubbema Date: Thu, 31 May 2018 09:46:49 +0200 Subject: [PATCH] Update __init__.py Added additional definitions to allow access to client file and image backups through the API. --- urbackup_api/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/urbackup_api/__init__.py b/urbackup_api/__init__.py index 042c6b3..e4e5ebe 100644 --- a/urbackup_api/__init__.py +++ b/urbackup_api/__init__.py @@ -416,6 +416,22 @@ class urbackup_server: def start_full_image_backup(self, clientname): return self._start_backup(clientname, 'full_image'); + def get_clientimagebackups(self, clientid = 0): + if not self.login(): + return None + + backups = self._get_json("backups", { "sa": "backups", "clientid": clientid }) + + return backups["backup_images"] + + def get_clientbackups(self, clientid = 0): + if not self.login(): + return None + + backups = self._get_json("backups", { "sa": "backups", "clientid": clientid }) + + return backups["backups"] + def add_extra_client(self, addr): if not self.login(): return None