Ask Your Question
0

Runtime parameters with REST API

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

davidha gravatar image

updated 2018-01-24 10:28:51 -0600

Roh 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 Stream sets, 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 use 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 -0600 )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 -0600 )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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

tmcgrath 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 -0600

Seen: 35 times

Last updated: Jan 24