From fd3fd66a1db8925e5a9a3d34acdd213f49378877 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 30 Apr 2018 17:24:27 +0300 Subject: Add: notification service --- ick2/client.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ick2/client.py') diff --git a/ick2/client.py b/ick2/client.py index 47941b5..e654d29 100644 --- a/ick2/client.py +++ b/ick2/client.py @@ -172,6 +172,12 @@ class ControllerClient: logging.info('Authentication URL: %r', url) return url + def get_notify_url(self): # pragma: no cover + version = self.get_version() + url = version.get('notify_url') + logging.info('Notification URL: %r', url) + return url + def get_auth_client(self): url = self.get_auth_url() ac = AuthClient() @@ -249,6 +255,10 @@ class ControllerClient: url = self.url(path) return self._api.get_blob(url) + def notify(self, notify): # pragma: no cover + url = self.get_notify_url() + self._api.post(url, body=notify) + class AuthClient: -- cgit v1.2.1