Lucas Lucas - 1 month ago 13
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
with:

{ "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

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