This documentation is for WSO2 Stream Processor 4.1.0. View documentation for the latest release.

All docs This doc
||
Skip to end of metadata
Go to start of metadata

The following table shows the APIs exposed from WSO2 Stream Processor.


MethodAPI ContextExampleDescriptionRuntimeAPI 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/Managerhttps://docs.wso2.com/display/DAS400/apidocs/siddhiapps/
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 -kUpdate 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}/statuscurl -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/statisticscurl -X GET "https://localhost:9443/statistics" -H "accept: application/json" -u admin:admin -k Returnsreal timestatistics of a worker
PUT/statisticscurl -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-detailscurl -X GET "https://localhost:9443/system-details" -H "accept: application/json" -u admin:admin -k Returns general details of worker
GET/siddhi-apps/statisticscurl -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}/statisticscurl -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/statisticscurl -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/singlecurl -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)













https://docs.wso2.com/ display/SP400/Simulating+Events


















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/feedcurl -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
DELETE/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=runcurl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=run" -H "accept: application/json"Run a feed simulation
POST/simulation/feed/{simulationName}?action=pausecurl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=pause" -H "accept: application/json"Pause a feed simulation
POST/simulation/feed/{simulationName}?action=resumecurl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=resume" -H "accept: application/json"Resume a feed simulation
POST/simulation/feed/{simulationName}?action=stopcurl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=stop" -H "accept: application/json"Stop a feed simulation
POST/simulation/feed/{simulationName}?action=resumecurl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=resume" -H "accept: application/json"Resume a feed simulation
GET/simulation/feed/{simulationName}/statuscurl -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/filescurl -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.csvUpdate a csv file
DELETE/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/workerscurl -X GET "https://localhost:9643/monitoring/apis/workers" -H "accept: application/json" -u admin:admin -k List all registered workersDashboard














Visualizing Data















POST/monitoring/apis/workerscurl -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}/statuscurl -X POST "https://localhost:9643/monitoring/apis/workers/localhost_9444/status" -H "accept: application/json" -u admin:admin -kTest the connection of a worker
GET/monitoring/apis/workers/{workerId}/history?period=’2 hr’,type=cpu,memory,latencycurl -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 -kGet 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 -kGet 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,memorycurl -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=managercurl -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/configcurl -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-statuscurl -X GET "https://localhost:9643/monitoring/apis/workers/localhost_9444/ha-status" -H "accept: application/json" -u admin:admin -k -vGet all HA Status
DashboardGET/portal/apis/dashboardscurl -X GET "https://localhost:9643/portal/apis/dashboards" -H "accept: application/json" -u admin:admin -kList dashboardsDashboard
GET/portal/apis/dashboards/{dashboard-id}curl -X GET "https://localhost:9643/portal/apis/dashboards/salesdashboard" -H "accept: application/json" -u admin:admin -kGet dashboard by ID
POST/portal/apis/dashboardscurl -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 -kCreate 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 -kUpdate a dashboard
DELETE/portal/apis/dashboards/{dashboard-id}curl -X DELETE "https://localhost:9643/portal/apis/dashboards/sampledashboard" -H "accept: application/json" -u admin:admin -kDelete a dashboard
GET/portal/apis/widgets/curl -X GET "https://localhost:9643/portal/apis/widgets" -H "accept: application/json" -u admin:admin -kList metadata of widgets
DELETE

/portal/apis/widgets/{id}

curl -X DELETE "https://localhost:9643/portal/apis/widgets/{id}"  -H "accept: application/json" -u admin:admin -k
This deletes the specified widget
Authentication APIPOST/login/{appName}

curl -X POST "https://localhost:9643/login/portal"
-H "Content-Type: application/x-www-form-urlencoded" -d "username=admin&password=admin&grantType=password"

Login to a dashboard appDashboard
GET/login/callback/{appName}curl -X GET "https://localhost:9643/login/callback/portal"Redirect URL by the IS in authorization grant type - OAuth2
POST/logout/{appName}curl -X POST "https://analytics.wso2.com/logout/portal" -H "accept: application/json" -H "Authorization: Bearer 12345678"Lgout of the dashboard app
Permission APIPOST/permissions

 curl -X POST https://localhost:9443/permissions/ -H 'content-type: application/json' -d ' { "appName":"MON", "permissionString":"MON.manager"}' -kAdd new permission string (Pass appname and
permission-string as json body). Return PERMISSION_ID
Dashboard/Worker
GET/permissions/app/{appName}

curl -X GET https://localhost:9443/permissions/app/MONGet permissionID for PermissionString
GET

permissions/auth/{permissionID}/{roleName}

curl -X GET https://localhost:9443/permissions/auth/8dc31fec-8364-3082-9f88-c7ca7d979873/adminCheck whether specific role has some permission or not
DELETE/permissions/{permissionID}

curl -X DELETE https://localhost:9443/permissions/e9687c6f-b5b2-3216-b3bd-82e7a8e14367Delete a permission string
GET/permissions/{permissionsID}/roles

curl -X GET https://localhost:9443/permissions/8dc31fec-8364-3082-9f88-c7ca7d979873/rolesList down roles which has the specific permission
defined as a path param
POST/permissions/revoke/{permissionID}

curl -X POST https://localhost:9443/permissions/revoke/8dc31fec-8364-3082-9f88-c7ca7d979873Revoke the specific permission defined in path
param for all the roles
POST(Permission)/permissions/roles/{roleID}?action=revoke/grantcurl -X POST 'https://localhost:9443/permissions/roles/admin?action=revoke' -H 'content-type: application/json' -d ' { "appName":"MON", "permissionString":"MON.manager"}'To grant or revoke permissions for a role. Pass the
permissions as an array in the body
Business Rules







DELETE/business-rules/instances/{businessRuleInstanceID}?force-delete=falsecurl -X DELETE "https://localhost:9643/business-rules/instances/business-rule-1?force-delete=false" -H "accept: application/json" -u admin:admin -kDeletes the business rule that has the given UUIDDashboard







GET/business-rules/instancescurl -X GET "https://localhost:9643/business-rules/instances" -u admin:admin -kGets available list of business rule instances
GET/business-rules/template-groups/{templateGroupID}curl -X GET "https://localhost:9643/business-rules/template-groups/sweet-factory" -u admin:admin -kGets template group that has the given UUID
GET/business-rules/template-groups/{templateGroupID}/templatescurl -X GET "https://localhost:9643/business-rules/template-groups/sweet-factory/templates" -u admin:admin -kGets rule templates available under the template group with the given UUID
GET/business-rules/template-groups/{templateGroupID}/templates/{ruleTemplateID}

curl -X GET "https://localhost:9643/business-rules/template-groups/sweet-factory/templates/identifying-continuous-production-decrease" -u admin:admin -k



Gets the rule template that has the given UUID, which is available under the template group with the given UUID
GET/business-rules/template-groupscurl -X GET "https://localhost:9643/business-rules/template-groups" -u admin:admin -kGets available template groups
GET/business-rules/instances/{businessRuleInstanceID}curl -X GET "https://localhost:9643/business-rules/instances/business-rule-1" -H "accept: application/json" -u admin:admin -kGets a business rule instance that has the given UUID
POST/business-rules/instances?deploy={deploymentStatus}curl -X POST "https://localhost:9643/business-rules/instances?deploy=true" -H "accept: application/json" -H "content-type: multipart/form-data" -F 'businessRule={"name":"Business Rule 5","uuid":"business-rule-5","type":"template","templateGroupUUID":"sweet-factory","ruleTemplateUUID":"identifying-continuous-production-decrease","properties":{"timeInterval":"6","timeRangeInput":"5","email":"example@email.com"}}' -u admin:admin -kCreates and saves a business rule from template / from scratch instance, from the given form data, and deploys/not as specified in the query parameter
PUT/business-rules/instances/{businessRuleInstanceID}?deploy={deploymentStatus}curl -X PUT "https://localhost:9643/business-rules/instances/business-rule-5?deploy=true" -H "accept: application/json" -H "content-type: application/json" -d '{"name":"Business Rule 5","uuid":"business-rule-5","type":"template","templateGroupUUID":"sweet-factory","ruleTemplateUUID":"identifying-continuous-production-decrease","properties":{"timeInterval":"9","timeRangeInput":"8","email":"newexample@email.com"}}' -u admin:admin -kUpdates a business rule instance that has the given UUID, and re-deploys/not as specified in the query parameter
Store APIPOST/stores/querycurl -X POST https://localhost:9443/stores/query -H "content-type: application/json" -u "admin:admin" 
-d '{"appName" : "AggregationTest", "query" : "from stockAggregation select *" }' -k
To retrieve the records in a siddhi store. For appName, the user needs to give the siddhiApp which has the siddhi store which user wants to query data from. For the query, user needs to provide the query saying from which table he/she wants to query and the condition to filter the dataWorker





  • No labels