Change default site in API clients
(imported from commit 185cf8e27cb6ecd1cd8ccca834d30ca0de2236b8)
This commit is contained in:
parent
7a19875c37
commit
b88df2cf8e
|
@ -16,7 +16,7 @@ parser.add_option('--verbose',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: feedback-bot --site=http://127.0.0.1:9991
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,9 @@ parser.add_option('--calendar',
|
||||||
metavar='URL')
|
metavar='URL')
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store',
|
action='store',
|
||||||
help='Humbug site [default: https://app.humbughq.com]',
|
help='Humbug site [default: https://humbughq.com]',
|
||||||
metavar='URL')
|
metavar='URL')
|
||||||
parser.add_option('--interval',
|
parser.add_option('--interval',
|
||||||
dest='interval',
|
dest='interval',
|
||||||
|
|
|
@ -46,7 +46,7 @@ parser.add_option('--no-auto-subscribe',
|
||||||
action='store_false')
|
action='store_false')
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--user',
|
parser.add_option('--user',
|
||||||
dest='user',
|
dest='user',
|
||||||
|
|
|
@ -11,7 +11,7 @@ assert(requests.__version__ > '0.12')
|
||||||
|
|
||||||
class HumbugAPI():
|
class HumbugAPI():
|
||||||
def __init__(self, email, api_key, verbose=False, retry_on_errors=True,
|
def __init__(self, email, api_key, verbose=False, retry_on_errors=True,
|
||||||
site="https://app.humbughq.com", client="API"):
|
site="https://humbughq.com", client="API"):
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
self.email = email
|
self.email = email
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Two quick API tests using curl
|
# Two quick API tests using curl
|
||||||
|
|
||||||
curl https://app.humbughq.com/api/v1/send_message \
|
curl https://humbughq.com/api/v1/send_message \
|
||||||
-d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
|
-d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
|
||||||
-d "email=tabbott@humbughq.com" \
|
-d "email=tabbott@humbughq.com" \
|
||||||
-d "type=personal" -d "content=test" \
|
-d "type=personal" -d "content=test" \
|
||||||
-d "recipient=tabbott@humbughq.com"
|
-d "recipient=tabbott@humbughq.com"
|
||||||
|
|
||||||
curl https://app.humbughq.com/api/v1/get_messages \
|
curl https://humbughq.com/api/v1/get_messages \
|
||||||
-d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
|
-d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
|
||||||
-d "email=tabbott@humbughq.com"
|
-d "email=tabbott@humbughq.com"
|
||||||
|
|
||||||
# Or replace https://app.humbughq.com with your local test instance
|
# Or replace https://humbughq.com with your local test instance
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: get-public-streams --user=tabbott@humbughq.com --site=http://127.0.0.1:
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--api-key',
|
parser.add_option('--api-key',
|
||||||
dest='api_key',
|
dest='api_key',
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: get-subscriptions --user=tabbott@humbughq.com --site=http://127.0.0.1:8
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--api-key',
|
parser.add_option('--api-key',
|
||||||
dest='api_key',
|
dest='api_key',
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: print-messages --user=tabbott@humbughq.com --site=http://127.0.0.1:8000
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--api-key',
|
parser.add_option('--api-key',
|
||||||
dest='api_key',
|
dest='api_key',
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: print-next-messages --user=tabbott@humbughq.com --site=http://127.0.0.1
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--api-key',
|
parser.add_option('--api-key',
|
||||||
dest='api_key',
|
dest='api_key',
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: send-message --user=tabbott@humbughq.com --site=http://127.0.0.1:8000
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--api-key',
|
parser.add_option('--api-key',
|
||||||
dest='api_key',
|
dest='api_key',
|
||||||
|
|
|
@ -12,7 +12,7 @@ Example: subscribe --user=tabbott@humbughq.com --site=http://127.0.0.1:8000
|
||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://app.humbughq.com",
|
default="https://humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--api-key',
|
parser.add_option('--api-key',
|
||||||
dest='api_key',
|
dest='api_key',
|
||||||
|
|
Loading…
Reference in a new issue