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

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

Sending a single event for simulation

Overview

DescriptionSends a singke event for simulation.
API Context/simulation/single
HTTP MethodPOST
Request/Response formatRequest format: text/plain
Response format: application/json 
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor

curl command syntax

 

Sample curl command

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\" ]}"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Uploading a feed simulation configuration

Overview

DescriptionUploads a feed simulation configuration.
API Context/simulation/feed
HTTP MethodPOST
Request/Response formatRequest format : text/plain
Response format : application/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor

curl command syntax

 

Sample curl command

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\"}]}"

Sample output

Response

HTTP Status Code

200, 403, 404, or 409.

For descriptions of the HTTP status codes, see HTTP Status Codes.

Retrieving all feed simulation configurations

Overview

DescriptionRetrieves all feed simulation configurations.
API Context/simulation/feed
HTTP MethodGET
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor

curl command syntax

 

Sample curl command

curl -X GET "http://localhost:9390/simulation/feed" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Updating a feed simulation configuration

Overview

DescriptionUpdates a feed simulation configuration.
API Context/simulation/feed/{simulationName}
HTTP MethodPUT
Request/Response formatRequest format : text/plain
Response format : application/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName} The name of the simulation configuration that needs to be updated.


curl command syntax

 

Sample curl command

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\"}]}"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Retrieving a specific feed simulation configuration

Overview

DescriptionRetrieves a specific feed simulation configuration.
API Context/simulation/feed/{simulationName}
HTTP MethodGET
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the feed simulation configuration that needs to be retrieved.

curl command syntax

 

Sample curl command

curl -X GET "http://localhost:9390/simulation/feed/TestFeedSimulation" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Deleting a feed simulation configuration

Overview

DescriptionDeletes a feed simulation configuration.
API Context/simulation/feed/{simulationName}
HTTP MethodDELETE
Request/Response format application/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the simulation configuration that needs to be deleted.

curl command syntax

 

Sample curl command

curl -X DELETE "http://localhost:9390/simulation/feed/TestFeedSimulation" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Running a feed simulation configuration

Overview

DescriptionRuns a feed simulation configuration.
API Context/simulation/feed/{simulationName}?action=run
HTTP MethodPOST
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the simulation configuration that needs to be run.

curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=run" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200, 403, 404, or 409

For descriptions of the HTTP status codes, see HTTP Status Codes.

Pausing a feed simulation

Overview

DescriptionPauses a currently active feed simulation.
API Context/simulation/feed/{simulationName}?action=pause
HTTP MethodPOST
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Password admin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the simulation configuration that needs to be run.

curl command syntax

curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=pause" -H "accept: application/json"

Sample curl command

 

Sample output

Response

HTTP Status Code

200, 403, 404, or 409

For descriptions of the HTTP status codes, see HTTP Status Codes.

Resuming a feed simulation

Overview

DescriptionResumes a paused feed simulation.
API Context/simulation/feed/{simulationName}?action=resume
HTTP MethodPOST
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Password admin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the simulation configuration that needs to be resumed.

curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=resume" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200, 403, 404, or 409

For descriptions of the HTTP status codes, see HTTP Status Codes.

Stopping a feed simulation

Overview

DescriptionStops a currently active feed simulation.
API Context/simulation/feed/{simulationName}?action=stop
HTTP MethodPOST
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the simulation configuration that needs to be stopped.

curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=stop" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200, 404, or 409.

For descriptions of the HTTP status codes, see HTTP Status Codes.

Retrieving a simulation configuration status by name

Overview

DescriptionRetrieves the status of a given simulation configuration.
API Context/simulation/feed/{simulationName}/status
HTTP MethodPOST
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{simulationName}The name of the simulation configuration of which the status needs to be checked.

curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9390/simulation/feed/TestFeedSimulation/?action=resume" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Uploading a CSV file

Overview

DescriptionUploads a CSV file for feed simulation.
API Context/simulation/files
HTTP MethodGET
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


curl command syntax

 

Sample curl command

curl -X GET "http://localhost:9390/simulation/feed/TestFeedSimulation/status" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Fetching CSV file names

Overview

DescriptionFetches the names of CSV files that are currently uploaded in the system.
API Context/simulation/files
HTTP MethodGET
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor

curl command syntax

 

Sample curl command

curl -X GET "http://localhost:9390/simulation/files" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Updating a CSV file

Overview

DescriptionUpdates a CSV file that is already uploaded in the system.
API Context/simulation/files/{fileName}
HTTP MethodPUT
Request/Response format
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{fileName}The name of the CSV file that needs to be updated.


curl command syntax

 

Sample curl command

curl -X PUT -F 'file=@foostream.csv' http://localhost:9390/simulation/files/foostream.csv?fileName=foostream.csv

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Deleting a CSV file

Overview

DescriptionDeletes the specified CSV file.
API Context/simulation/files/{fileName}
HTTP MethodDELETE
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor

Parameter Description

ParameterDescription
{fileName}The name of the CSV file that needs to be deleted.

curl command syntax

 

Sample curl command

curl -X DELETE "http://localhost:9390/simulation/files/CSVTestFile.csv" -H "accept: application/json"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Testing a database connection

Overview

DescriptionTests a database connection.
API Context/simulation/connectToDatabase
HTTP MethodPOST
Request/Response formatappliction/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor

curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9090/simulation/connectToDatabase" -H "accept: application/json" -H "content-type: application/json" -d "{ \"dataSourceLocation\": \"jdbc:mysql://localhost:3306/DatabaseFeedSimulation\", \"driver\": \"com.mysql.jdbc.Driver\", \"username\": \"root\", \"password\": \"password\"}"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Retrieving database tables

Overview

DescriptionRetrieves database tables.
API Context/simulation/connectToDatabase/retrieveTableNames
HTTP MethodPOST
Request/Response formatapplication/json
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9090/simulation/connectToDatabase/retrieveTableNames" -H "accept: application/json" -H "content-type: application/json" -d "{ \"dataSourceLocation\": \"jdbc:mysql://localhost:3306/DatabaseFeedSimulation\", \"driver\": \"com.mysql.jdbc.Driver\", \"username\": \"root\", \"password\": \"password\"}"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

Retrieving database table columns

Overview

DescriptionRetrieves database table columns
API Context/simulation/connectToDatabase/{tableName}/retrieveColumnNames
HTTP MethodPOST
Request/Response formatapplication/JSON
AuthenticationBasic
Usernameadmin
Passwordadmin
Runtime
  • Worker (https port: 9443, http port:9090)
  • Editor


Parameter Description

ParameterDescription
{tableName} The name of the database table of which the columns need to be retrieved.


curl command syntax

 

Sample curl command

curl -X POST "http://localhost:9090/simulation/connectToDatabase/DataTable/retrieveColumnNames" -H "accept: application/json" -H "content-type: application/json" -d "{ \"dataSourceLocation\": \"jdbc:mysql://localhost:3306/DatabaseFeedSimulation\", \"driver\": \"com.mysql.jdbc.Driver\", \"username\": \"root\", \"password\": \"password\"}"

Sample output

Response

HTTP Status Code

200 or 404

For descriptions of the HTTP status codes, see HTTP Status Codes.

  • No labels