Change the state

To change the state of any stream (ON | OFF):

Method : PUT

URI : /stream/<schema_name>/<stream_name>/state

Body:

{"state":0} // [ 0 for switching OFF and 1 for ON, when in OFF state, stream can't ingest/process any event ]

Example

curl -H "Content-Type: application/json" -d'{"state":1}' -X PUT http://192.168.1.105:18080/stream/ecomm/visitor/state

Response

{
   "errcode":0,
   "error":[
      "the stream [ visitor ] is already enabled"
   ]
}

errcode 0 means success, but state was not changed as it's already in the enabled state.

Get the state

To get the state of the stream state we can call:

Method : GET

URI : /stream/<schema_name>/<stream_name>/state

Example

curl -X GET http://192.168.1.105:18080/stream/website/visitor/state

Response

{
   "state": 1
}