Lucas Lucas - 1 year ago 95
reST (reStructuredText) Question

How can I define a new stream by REST call on Spring Cloud Data Flow?

I would like to define and deploy a new stream on spring cloud data flow using the REST API. But on documentations, there is no reference about how I need to structure my "POST" call.

When I send a POST call to http://localhost:9393/streams/definitions

{ "name": "chp",
"dslText": "time | log", }

I get as answer:

"logref": "MissingServletRequestParameterException",
"message": "Required String parameter 'name' is not present",
"links": []

Anyone knows what is the format to use REST API?

Thank you so much !

Answer Source

The simplest method would be to make sure the relevant properties are included in the URL parameter with proper encoding.

For example, ticktock stream creation would be:

curl -X POST http://localhost:9393/streams/definitions\?definition\=time+%7C+log\&name\=foo

For example, ticktock stream deployment would be:

curl -X POST http://localhost:9393/streams/deployments/foo

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download