Ask Your Question
0

Runtime parameters with REST API

asked 2018-01-24 04:26:44 -0500

davidha gravatar image

updated 2019-02-08 10:39:17 -0500

metadaddy gravatar image

I am trying to use a parameter tablename to dynamically pipe data to a MapR cluster. I have tested with success using the GUI of StreamSets, while cannot get around with REST API. Is there any document for this usage of REST API, I am trying something like:

curl 'HTTP://<ip>:18630/rest/v1/pipeline/pipelineID/start?rev=0' --user user:password -H 'X-Requested-By:user' -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"tablename": "table_one"}'

I have just used the http://ip:18630/collector/restapi end point to test. At the "start" session, I have input the following as the runtime parameter: { "tablename": "tablea" } , but the pipeline is not working like I use "Start with parameter" in the GUI using the same parameter in bulk edit mode.

But so far no luck. Can anyone share the experience using the REST API or point me to document on that.

David

edit retag flag offensive close merge delete

Comments

I have just use the http://ip:18630/collector/restapi end point to test. At the "start" session, I have in put the following as the runtime parameter: { "tablename": "tablea" } , but the pipeline is not working like I use "Start with parameter" in the GUI using the same parameter in bulk edit mode.

davidha gravatar imagedavidha ( 2018-01-24 04:44:46 -0500 )edit

Can you post the response you're getting when it doesn't work? Use the -v curl option to get the HTTP response code.

metadaddy gravatar imagemetadaddy ( 2018-01-24 11:36:02 -0500 )edit

Hi, the respond is 200, and the pipeline indeed started, but no data is piped in. So my thought is that it did not get my parameter correctly or just ignoring it. Is there anyway to check what parameter I have input in a specific run?

davidha gravatar imagedavidha ( 2018-01-24 22:12:33 -0500 )edit

what does "rev" means in url "/rest/v1/pipeline/pipelineId?rev=0"? is it version number or ant other answer?

harley gravatar imageharley ( 2018-10-16 04:34:26 -0500 )edit

how to get the tablename value in pipeline??? I Tried ${tablename} but, it's failed

league3236 gravatar imageleague3236 ( 2019-03-11 01:27:19 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-03-11 09:37:17 -0500

iamontheinet gravatar image

If 'tablename" is your pipeline parameter, then ${tablename} is correct. What's the error and where are you using the parameter?

edit flag offensive delete link more
1

answered 2018-01-24 07:39:57 -0500

todd gravatar image

Try adding -X POST to your curl command as in

curl -X POST 'http://<ip>:18630/rest/v1/pipeline/pipelineID/start?rev=0' --user user:password -H 'X-Requested-By:user' -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"tablename": "table_one"}'
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-24 04:26:44 -0500

Seen: 778 times

Last updated: Mar 11