diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 43b1287..ec6b80f 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -495,7 +495,7 @@ def add_humbug_subscriptions(verbose): zephyr_subscriptions.add(cls) if len(zephyr_subscriptions) != 0: - res = humbug_client.subscribe(list(zephyr_subscriptions)) + res = humbug_client.add_subscriptions(list(zephyr_subscriptions)) if res.get("result") != "success": print "Error subscribing to streams:" print res["msg"] diff --git a/common.py b/common.py index 56040f0..9696b69 100644 --- a/common.py +++ b/common.py @@ -103,12 +103,12 @@ class HumbugAPI(): def get_public_streams(self, request = {}): return self.do_api_query(request, "/api/v1/get_public_streams") - def get_subscriptions(self, request = {}): - return self.do_api_query(request, "/api/v1/get_subscriptions") + def list_subscriptions(self, request = {}): + return self.do_api_query(request, "/api/v1/subscriptions/list") - def subscribe(self, streams): + def add_subscriptions(self, streams): request = {'streams': streams} - return self.do_api_query(request, "/api/v1/subscribe") + return self.do_api_query(request, "/api/v1/subscriptions/add") def call_on_each_message(self, callback, options = {}): max_message_id = None diff --git a/examples/get-subscriptions b/examples/list-subscriptions similarity index 82% rename from examples/get-subscriptions rename to examples/list-subscriptions index 70472f2..81f4500 100755 --- a/examples/get-subscriptions +++ b/examples/list-subscriptions @@ -3,11 +3,11 @@ import sys import os import optparse -usage = """get-subscriptions --user= [options] +usage = """list-subscriptions --user= [options] Prints out a list of the user's subscriptions. -Example: get-subscriptions --user=tabbott@humbughq.com --site=http://127.0.0.1:8000 +Example: list-subscriptions --user=tabbott@humbughq.com --site=http://127.0.0.1:8000 """ parser = optparse.OptionParser(usage=usage) parser.add_option('--site', @@ -30,4 +30,4 @@ client = api.common.HumbugAPI(email=options.user, verbose=True, site=options.site) -print client.get_subscriptions() +print client.list_subscriptions() diff --git a/examples/subscribe b/examples/subscribe index beea5bc..5e19c2b 100755 --- a/examples/subscribe +++ b/examples/subscribe @@ -38,4 +38,4 @@ if options.streams == "": print >>sys.stderr, "Usage:", parser.usage sys.exit(1) -print client.subscribe(options.streams.split()) +print client.add_subscriptions(options.streams.split())