mirror of
https://github.com/uroni/urbackup-server-python-web-api-wrapper.git
synced 2025-10-26 11:38:16 +00:00
Merge branch 'master' into implement-livelog-call
This commit is contained in:
commit
7fae133848
@ -16,6 +16,10 @@ for line in computernames:
|
||||
|
||||
|
||||
clients = server.get_status()
|
||||
usage = server.get_usage()
|
||||
|
||||
if len(clients) != len(usage):
|
||||
print("Failed to retreive usage or status information. Length of both lists is different.")
|
||||
|
||||
# Uncomment to format time differently
|
||||
# locale.setlocale(locale.LC_TIME, "german")
|
||||
|
||||
@ -356,6 +356,20 @@ class urbackup_server:
|
||||
self._lastlogid = log["logdata"][-1]['id']
|
||||
|
||||
return log["logdata"]
|
||||
|
||||
def get_usage(self):
|
||||
if not self.login():
|
||||
return None
|
||||
|
||||
usage = self._get_json("usage")
|
||||
|
||||
if not usage:
|
||||
return None
|
||||
|
||||
if not "usage" in usage:
|
||||
return None
|
||||
|
||||
return usage["usage"]
|
||||
|
||||
def get_extra_clients(self):
|
||||
if not self.login():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user