我想连接到控制集线器,并希望使用Shell脚本运行特定的StreamSets 管线。
发布于 2020-03-18 18:21:26
在StreamSets控件集线器web中,单击RESTful API,然后单击Job 。您将看到使用curl从命令行进行身份验证的说明。向下滚动,您将看到在给定作业id的情况下启动作业的API。
把它们放在一起,你需要做的事情如下:
# login to Control Hub security app
curl -X POST -d '{"userName":"SCHUserID", "password": "SCHUserPassword"}' \
https://cloud.streamsets.com/security/public-rest/v1/authentication/login \
--header "Content-Type:application/json" --header "X-Requested-By:SCH" \
-c cookie.txt
# generate auth token from security app
sessionToken=$(cat cookie.txt | grep SSO | rev | grep -o '^\S*' | rev)
echo "Generated session token : $sessionToken"
# Start a job using the auth token
curl -X GET https://cloud.streamsets.com/jobrunner/rest/v1/job/{jobId}/start \
--header "Content-Type:application/json" --header "X-Requested-By:SCH" \
--header "X-SS-REST-CALL:true" --header "X-SS-User-Auth-Token:$sessionToken" \
-i发布于 2022-08-29 07:20:27
如果您在本地使用流集,则另一个答案对您无效。有关更多细节,请查看http://localhost:18630/collector/restapi。
https://stackoverflow.com/questions/60723390
复制相似问题