Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit 7dc65d1

Browse files
committed
Update gateway url.
1 parent 5ef8d1b commit 7dc65d1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

zenaton/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class Client(metaclass=Singleton):
1818
ZENATON_API_URL = 'https://api.zenaton.com/v1' # Zenaton api url
1919
ZENATON_WORKER_URL = 'http://localhost' # Default worker url
20-
ZENATON_ALFRED_URL = "https://alfred.zenaton.com/api"; # Zenaton alfred url
20+
ZENATON_GATEWAY_URL = "https://gateway.zenaton.com/api"; # Zenaton gateway url
2121
DEFAULT_WORKER_PORT = 4001 # Default worker port
2222
WORKER_API_VERSION = 'v_newton' # Default worker api version
2323

@@ -61,13 +61,13 @@ def __lazy_init__(self, app_id, api_token, app_env):
6161
self.app_env = self.app_env or app_env
6262

6363
"""
64-
Gets the url for alfred, the GraphQL API
64+
Gets the gateway url (GraphQL API)
6565
:param String resource the endpoint for the worker
6666
:param String params url encoded parameters to include in request
6767
:returns String the workers url with parameters
6868
"""
69-
def alfred_url(self):
70-
url = os.environ.get('ZENATON_ALFRED_URL') or self.ZENATON_ALFRED_URL
69+
def gateway_url(self):
70+
url = os.environ.get('ZENATON_GATEWAY_URL') or self.ZENATON_GATEWAY_URL
7171
return url
7272

7373
"""
@@ -128,8 +128,8 @@ def start_task(self, task):
128128
}))
129129

130130
def start_scheduled_workflow(self, flow, cron):
131-
url = self.alfred_url()
132-
headers = self.alfred_headers()
131+
url = self.gateway_url()
132+
headers = self.gateway_headers()
133133
query = self.graphql.CREATE_WORKFLOW_SCHEDULE
134134
variables = {
135135
'createWorkflowScheduleInput': {
@@ -146,8 +146,8 @@ def start_scheduled_workflow(self, flow, cron):
146146
return res['data']['createWorkflowSchedule']
147147

148148
def start_scheduled_task(self, task, cron):
149-
url = self.alfred_url()
150-
headers = self.alfred_headers()
149+
url = self.gateway_url()
150+
headers = self.gateway_headers()
151151
query = self.graphql.CREATE_TASK_SCHEDULE
152152
variables = {
153153
'createTaskScheduleInput': {
@@ -260,7 +260,7 @@ def add_app_env(self, url, params):
260260
app_id = '{}={}&'.format(self.APP_ID, self.app_id) if self.app_id else ''
261261
return '{}{}{}{}'.format(url, app_env, app_id, urllib.parse.quote_plus(params, safe='=&'))
262262

263-
def alfred_headers(self):
263+
def gateway_headers(self):
264264
return {'Accept': 'application/json',
265265
'Content-type': 'application/json',
266266
'app-id': self.app_id,

0 commit comments

Comments
 (0)