Skip to content

Commit 80c666e

Browse files
committed
Print group as well
1 parent 4da1fea commit 80c666e

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Versions should comply with PEP440. For a discussion on single-sourcing
1717
# the version across setup.py and the project code, see
1818
# https://packaging.python.org/en/latest/single_source_version.html
19-
version='0.8.1',
19+
version='0.9',
2020

2121
description='Python wrapper to access and control an UrBackup server',
2222
long_description=long_description,

test/list_backup_counts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo")
44

5-
clients = server.get_status()
5+
clients = server.get_clients_with_group()
66

77
for client in clients:
88

@@ -33,10 +33,10 @@
3333
else:
3434
incr_image+=1
3535

36-
print("Client {clientname} has {incr_file} incr file backups, {full_file} "
36+
print("Client {clientname} in group {groupname} has {incr_file} incr file backups, {full_file} "
3737
"full file backups, {incr_image} incr image backups and "
3838
"{full_image} full image backups".format(
3939
incr_file=incr_file, clientname=client["name"],
4040
full_file=full_file, incr_image=incr_image,
41-
full_image=full_image) )
41+
full_image=full_image, groupname=client["groupname"]) )
4242

urbackup_api/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,22 @@ def get_clientbackups(self, clientid = 0):
432432

433433
return backups["backups"]
434434

435+
def get_groups(self):
436+
if not self.login():
437+
return None
438+
439+
settings = self._get_json("settings")
440+
441+
return settings["navitems"]["groups"]
442+
443+
def get_clients_with_group(self):
444+
if not self.login():
445+
return None
446+
447+
settings = self._get_json("settings")
448+
449+
return settings["navitems"]["clients"]
450+
435451
def add_extra_client(self, addr):
436452
if not self.login():
437453
return None

0 commit comments

Comments
 (0)