Stream Processor REST API Guide
The following table shows the APIs exposed from WSO2 Stream Processor.
| Method | API Context | Example | Description | Runtime | API Docs |
|---|---|---|---|---|---|---|
Stream Processor API | POST | /siddhi-apps | curl -X POST "https://localhost:9443/siddhi-apps" -H "accept: application/json" -H "Content-Type: text/plain" -d @TestSiddhiApp.siddhi -u admin:admin -k | Send Siddhi App as the Body | Worker/Manager | |
PUT | /siddhi-apps | curl -X PUT "https://localhost:9443/siddhi-apps" -H "accept: application/json" -H "Content-Type: text/plain" -d @TestSiddhiApp.siddhi -u admin:admin -k | Update the siddhi App | |||
DELETE | /siddhi-apps/{appName} | curl -X DELETE "https://localhost:9443/siddhi-apps/TestSiddhiApp" -H "accept: application/json" -u admin:admin -k | Pass Siddhi App name as url param | |||
GET | /siddhi-apps | curl -X GET "https://localhost:9443/siddhi-apps?isActive=true" -H "accept: application/json" -u admin:admin -k | Lists all active Siddhi Apps with query If isActive=true, then list the active Siddhi Apps, else list the inactive Siddhi Apps. | |||
GET | /siddhi-apps/{appName} | curl -X GET "https://localhost:9443/siddhi-apps/SiddhiTestApp" -H "accept: application/json" -u admin:admin -k | Fetch a speciffic Siddhi App | |||
GET | /siddhi-apps/{appName}/status | curl -X GET "https://localhost:9443/siddhi-apps/TestSiddhiApp/status" -H "accept: application/json" -u admin:admin -k | Fetches the status of the Siddhi Application. | |||
POST | /siddhi-apps/{appName}/backup | curl -X POST "https://localhost:9443/siddhi-apps/TestSiddhiApp/backup" -H "accept: application/json" -u admin:admin -k | Take a snapshot of the provided Siddhi App | |||
POST | /siddhi-apps/{appName}/restore /siddhi-apps/{appName}/restore?version= | curl -X POST "https://localhost:9443/siddhi-apps/TestSiddhiApp/restore?revision=1514981290838_TestSiddhiApp" -H "accept: application/json" -u admin:admin -k | Restore the Siddhi App with the created snapshot | |||
GET | /statistics | curl -X GET "https://localhost:9443/statistics" -H "accept: application/json" -u admin:admin -k | Returnsreal timestatistics of a worker | |||
PUT | /statistics | curl -X PUT "https://localhost:9443/statistics" -H "accept: application/json" -H "Content-Type: application/json" -d "{“statsEnable”:”true”}" -u admin:admin -k | Enable/disable worker statistics | |||
GET | /system-details | curl -X GET "https://localhost:9443/system-details" -H "accept: application/json" -u admin:admin -k | Returns general details of worker | |||
GET | /siddhi-apps/statistics | curl -X GET "https://localhost:9443/siddhi-apps/statistics" -H "accept: application/json" -u admin:admin -k | Returns statistics details of All Siddhi Apps | |||
PUT | /siddhi-apps/{appName}/statistics | curl -X PUT "https://localhost:9443/siddhi-apps/TestSiddhiApp/statistics" -H "accept: application/json" -H "Content-Type: application/json" -d "{“statsEnable”:”true”}" -u admin:admin -k | Enable/disable statistics of a given Siddhi App | |||
PUT | /siddhi-apps/statistics | curl -X PUT "https://localhost:9443/siddhi-apps/statistics" -H "accept: application/json" -H "Content-Type: application/json" -d "{“statsEnable”:”true”}" -u admin:admin -k | Enable/disable statistics of all Siddhi Apps | |||
Event Simulator API | POST | /simulation/single | curl -X POST "http://localhost:9390/simulation/single" -H "accept: application/json" -H "content-type: text/plain" -d "{ \"streamName\": \"FooStream\", \"siddhiAppName\": \"TestSiddhiApp\", \"timestamp\": \"1500319950004\", \"data\": [ \"foo\", \"bar\", \"12345\" ]}" | Send single event for simulation | Worker (https port: 9443, http port:9090) (for worker environment need to be add authorization header -u admin:admin )
Editor (port:9390) | |
POST | /simulation/feed | curl -X POST "http://localhost:9390/simulation/feed" -H "accept: application/json" -H "content-type: text/plain" -d "{\"properties\":{\"simulationName\":\"TestFeedSimulation\",\"startTimestamp\":\"1500319950003\",\"endTimestamp\":\"1500319950009\",\"noOfEvents\":\"100\",\"description\":\"Test feed simulator\",\"timeInterval\":\"1000\"},\"sources\":[{\"siddhiAppName\":\"TestSiddhiApp\",\"streamName\":\"FooStream\",\"timestampInterval\":\"1000\",\"simulationType\":\"CSV_SIMULATION\",\"fileName\":\"foostream.csv\",\"delimiter\":\",\",\"isOrdered\":true,\"indices\":\"0,1,2\"}]}" | Upload feed simulation config | |||
GET | /simulation/feed | curl -X GET "http://localhost:9390/simulation/feed" -H "accept: application/json" | Retrieve all feed simulation configurations | |||
PUT | /simulation/feed/{simulationName} | curl -X PUT "http://localhost:9390/simulation/feed/TestFeedSimulation" -H "accept: application/json" -H "content-type: text/plain" -d "{\"properties\":{\"simulationName\":\"TestFeedSimulation\",\"startTimestamp\":\"\",\"endTimestamp\":\"\",\"noOfEvents\":\"100\",\"description\":\"Test feed simulator\",\"timeInterval\":\"1000\"},\"sources\":[{\"siddhiAppName\":\"TestSiddhiApp\",\"streamName\":\"BarStream\",\"timestampInterval\":\"1000\",\"simulationType\":\"CSV_SIMULATION\",\"fileName\":\"foostream.csv\",\"delimiter\":\",\",\"isOrdered\":true,\"indices\":\"0,1,2\"}]}" | Update a feed simulation config | |||
GET | /simulation/feed/{simulationName} | curl -X GET "http://localhost:9390/simulation/feed/TestFeedSimulation" -H "accept: application/json" | Retreieve a feed simulation config | |||
DELET | /simulation/feed/{simulationName} | curl -X DELETE "http://localhost:9390/simulation/feed/TestFeedSimulation" -H "accept: application/json" | Delete a feed simulation config | |||
POST | /simulation/feed/{simulationName}?action=run | curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=run" -H "accept: application/json" | Run a feed simulation | |||
POST | /simulation/feed/{simulationName}?action=pause | curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=pause" -H "accept: application/json" | Pause a feed simulation | |||
POST | /simulation/feed/{simulationName}?action=resume | curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=resume" -H "accept: application/json" | Resume a feed simulation | |||
POST | /simulation/feed/{simulationName}?action=stop | curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=stop" -H "accept: application/json" | Stop a feed simulation | |||
POST | /simulation/feed/{simulationName}?action=resume | curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=resume" -H "accept: application/json" | Resume a feed simulation | |||
GET | /simulation/feed/{simulationName}/status | curl -X GET "http://localhost:9390/simulation/feed/TestFeedSimulation/status" -H "accept: application/json" | Retrieve a simulation configuration status by name. | |||
POST | /simulation/files | curl -X POST -F 'file=@foostream.csv' http://localhost:9390/simulation/files | Upload a csv file | |||
GET | /simulation/files | curl -X GET "http://localhost:9390/simulation/files" -H "accept: application/json" | Get CSV file names | |||
PUT | /simulation/files/{fileName} | curl -X PUT -F 'file=@foostream.csv' http://localhost:9390/simulation/files/foostream.csv?fileName=foostream.csv | Update a csv file | |||
DELET | /simulation/files/{fileName} | curl -X DELETE "http://localhost:9390/simulation/files/CSVTestFile.csv" -H "accept: application/json" | Delete a csv file | |||
POST | /simulation/connectToDatabase |
| Test a database connection. | |||
POST | /simulation/connectToDatabase/retrieveTableNames |
| Retreive database tables | |||
POST | /simulation/connectToDatabase/{tableName}/retrieveColumnNames |
| Retreive database table columns | |||
Status Dashboard APIs | GET | /monitoring/apis/workers | curl -X GET "https://localhost:9643/monitoring/apis/workers" -H "accept: application/json" -u admin:admin -k | List all registered workers | Dashboard | |
POST | /monitoring/apis/workers | curl -X POST "https://localhost:9643/monitoring/apis/workers" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"host\": \"localhost\", \"port\": \"9443\"}" -u admin:admin -k | Add a worker | |||
DELETE | /monitoring/apis/workers/{workerId} | curl -X DELETE "https://localhost:9643/monitoring/apis/workers/localhost_9095" -H "accept: application/json" -u admin:admin -k | Delete a worker | |||
POST | /monitoring/apis/workers/{workerId}/system-details | curl -X POST "https://localhost:9643/monitoring/apis/workers/localhost_9444/system-details" -H "accept: application/json" -u admin:admin -k | Get general details of a worker | |||
POST | /monitoring/apis/workers/{workerId}/status | curl -X POST "https://localhost:9643/monitoring/apis/workers/localhost_9444/status" -H "accept: application/json" -u admin:admin -k | Test the connection of a worker | |||
GET | /monitoring/apis/workers/{workerId}/history?period=’2 hr’,type=cpu,memory,latency | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/history?period=5min" -H "accept: application/json" -u admin:admin -k | Get history statistics details of a worker | |||
GET | /monitoring/apis/workers/{workerId}/siddhi-apps | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/siddhi-apps" -H "accept: application/json" -u admin:admin -k | Get details of all Siddhi Apps of a given worker | |||
GET | /monitoring/apis/workers/{workerId}/siddhi-apps/{appName} | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9095/siddhi-apps/TestSiddhiApp" -H "accept: application/json" -u admin:admin -k | Get text view and flow of a siddhi-app | |||
GET | /monitoring/apis/workers/{workerId}/siddhi-apps | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/siddhi-apps" -H "accept: application/json" -u admin:admin -k | Get details of all Siddhi Apps of a given worker | |||
PUT | /monitoring/apis/workers/{workerId}/siddhi-apps/{appName}/statistics | curl -X PUT "https://localhost:9643/monitoring/apis/workers/localhost_9444/siddhi-apps/TestSiddhiApp/statistics" -H "accept: application/json" -H "Content-Type:application/json" -d "{statsEnable: false}" -u admin:admin -k -v | Enable/disable Siddhi App statistics | |||
GET | /monitoring/apis/workers/{workerId}/siddhi-apps/{appName}/history?period=’2hr’,type=cpu,memory | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/siddhi-apps/TestSiddhiApp/history?period=5min" -H "accept: application/json" -u admin:admin -k | Get history statistics details of a siddhi app | |||
GET | /monitoring/apis/workers/{workerId}/siddhi-apps/{appName}/components | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/siddhi-apps/TestSiddhiApp/components" -H "accept: application/json" -u admin:admin -k -v | Get the component list and the component current metrics. | |||
GET | /monitoring/apis/workers/{workerId}/siddhi-apps/{appName}/components/{componentType}/{componentId}/history?period=’2hr’,type=cpu,... | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/siddhi-apps/TestSiddhiApp/components/Streams/FooStream/history?period=5min" -H "accept: application/json" -u admin:admin -k | Get history statistics details of a siddhi app component | |||
GET | /monitoring/apis/workers/roles?permissionSuffix=manager | curl -X GET "https://localhost:9643/monitoring/apis/workers/roles?permissionSuffix=metrics.manager" -H "accept: application/json" -u admin:admin -k | Get user roles of a specified user | |||
GET | /monitoring/apis/workers/config | curl -X GET "https://localhost:9643/monitoring/apis/workers/config" -H "accept: application/json" -u admin:admin -k | Reading the dashboard configuration details from thedeplomentYML of dashboard running server | |||
GET | /monitoring/apis/workers/{workerId}/ha-status | curl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/ha-status" -H "accept: application/json" -u admin:admin -k -v | Get all HA Status | |||
Dashboard | GET | /portal/apis/dashboards | curl -X GET "https://localhost:9643/portal/apis/dashboards" -H "accept: application/json" -u admin:admin -k | List dashboards | Dashboard |
|
GET | /portal/apis/dashboards/{dashboard-id} | curl -X GET "https://localhost:9643/portal/apis/dashboards/salesdashboard" -H "accept: application/json" -u admin:admin -k | Get dashboard by ID | |||
POST | /portal/apis/dashboards | curl -X POST "https://localhost:9643/portal/apis/dashboards" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"url\":\"sampledashboard\",\"name\":\"Sample Dashboard\",\"description\":\"This is a sample dashboard\",\"landingPage\":\"overview\",\"parentId\":\"1\",\"owner\":\"test\",\"pages\":[]}" -u admin:admin -k | Create dashboard | |||
PUT | /portal/apis/dashboards/{dashboard-id} | curl -X PUT "https://localhost:9643/portal/apis/dashboards/sampledashboard" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"url\":\"sampledashboard\",\"name\":\"Sample Dashboard\",\"description\":\"This is a sample dashboard 2\",\"landingPage\":\"overview\",\"parentId\":\"1\",\"owner\":\"test\",\"pages\":[]}" -u admin:admin -k | Update a dashboard | |||
DELETE | /portal/apis/dashboards/{dashboard-id} |