Skip to content

Commit

Permalink
added pipeline_id as attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
harshits committed Jan 2, 2020
1 parent 342c8e8 commit e3f400a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion qds_sdk/quest.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class Quest(Resource):
""" all commands use the /pipelines endpoint"""

rest_entity_path = "pipelines"
pipeline_id = None

@staticmethod
def get_pipline_id(response):
Expand Down Expand Up @@ -181,6 +182,7 @@ def create(pipeline_name, create_type, **kwargs):
"type": "pipelines"}}
url = Quest.rest_entity_path + "?mode=wizard"
response = conn.post(url, data)
Quest.pipeline_id = Quest.get_pipline_id(response)
return response

@staticmethod
Expand Down Expand Up @@ -704,6 +706,7 @@ def create_pipeline(pipeline_name, schema, source_data_format, sink_data_format,
"""
response = Quest.create(pipeline_name, QuestAssisted.create_type)
log.info(response)
final_reponse = None
pipeline_id = Quest.get_pipline_id(response)
pipeline_id = str(pipeline_id)
src_response = QuestAssisted.add_source(pipeline_id, schema, source_data_format, source_data_store,
Expand Down Expand Up @@ -739,6 +742,7 @@ def create_pipeline(pipeline_name, schema, source_data_format, sink_data_format,
can_retry=can_retry,
command_line_options=command_line_options)
log.info(property_response)
final_reponse = property_response
if operator:
operator_response = QuestAssisted.add_operator(pipeline_id, operator,
condition=condition,
Expand All @@ -749,10 +753,12 @@ def create_pipeline(pipeline_name, schema, source_data_format, sink_data_format,
window_interval_frequency=window_interval_frequency,
other_columns=other_columns)
log.info(operator_response)
final_reponse = operator_response
if channel_id:
response = QuestAssisted.set_alert(pipeline_id, channel_id)
log.info(response)
return response
final_reponse = response
return final_reponse

@staticmethod
def add_operator(pipeline_id, operator,
Expand Down

0 comments on commit e3f400a

Please sign in to comment.