Ask Your Question
0

how to stop streamsets pipeline automatically after executing python script using shell executor ?

asked 2019-12-19 03:31:40 -0500

mspatil gravatar image

how to stop streamsets pipeline automatically after executing python script using shell executor ?

edit retag flag offensive close merge delete

Comments

Can you update your question and describe the flow a little more in detail?

iamontheinet gravatar imageiamontheinet ( 2019-12-19 10:07:36 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-12-23 06:52:17 -0500

Dean Han gravatar image

updated 2020-01-12 19:42:51 -0500

In the end of your python script, run a REST api to stop pipeline. You can use request module. e.g.

url = r'http://' + host + r':18630/rest/v1/pipeline/' + plid + r'/stop'
headers = {"X-Requested-By": "sdc"}
try:
    r = requests.post(url, auth=(mi.SDC_USER, mi.SDC_PASS), headers=headers)
    rc = r.status_code
except:
    print('error')
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2019-12-19 03:31:40 -0500

Seen: 56 times

Last updated: Jan 12