Note

This page is still a work in progress!

Event Simulation APIs

Sending a single event for simulation

Overview

Description Sends a single event for simulation.
API Context /simulation/single
HTTP Method POST
Request/Response format Request: text/plain
Response: application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

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

Possible codes are 200 and 404.

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

Uploading a feed simulation configuration

Overview

Description Uploads a feed simulation configuration.
API Context /simulation/feed
HTTP Method POST
Request/Response format Request: text/plain
Response: application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

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

Possible codes are 200, 403, 404, and 409.

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

Retrieving all feed simulation configurations

Overview

Description Retrieves all feed simulation configurations.
API Context /simulation/feed
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

curl command syntax

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200 and 404.

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

Updating a feed simulation configuration

Overview

Description Updates a feed simulation configuration.
API Context /simulation/feed/{simulationName}
HTTP Method PUT
Request/Response format Request: text/plain
Response: application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter description

Parameter Description
{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

Possible codes are 200 and 404.

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

Retrieving a specific feed simulation configuration

Overview

Description Retrieves a specific feed simulation configuration.
API Context /simulation/feed/{simulationName}
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

Parameter Description
{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

Possible codes are 200 and 404.

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

Deleting a feed simulation configuration

Overview

Description Deletes a feed simulation configuration.
API Context /simulation/feed/{simulationName}
HTTP Method DELETE
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

Parameter Description
{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

Possible codes are 200 and 404.

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

Running a feed simulation configuration

Overview

Description Runs a feed simulation configuration.
API Context /simulation/feed/{simulationName}?action=run
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

Parameter Description
{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

Possible codes are 200, 403, 404, and 409.

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

Pausing a feed simulation

Overview

Description Pauses a currently active feed simulation.
API Context /simulation/feed/{simulationName}?action=pause
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

Parameter Description
{simulationName} The name of the simulation configuration that needs to be paused.

curl command syntax

curl -X POST "http://<HOST_NAME>:<PORT>/simulation/feed/<FEED_NAME>/?action=pause" -H "accept: application/json"

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200, 403, 404, and 409.

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

Resuming a feed simulation

Overview

Description Resumes a paused feed simulation.
API Context /simulation/feed/{simulationName}?action=resume
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

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

curl command syntax

curl -X POST "http://<HOST_NAME>:<PORT>/simulation/feed/<SIMULATION_NAME>/?action=resume" -H "accept: application/json"

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200, 403, 404, and 409.

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

Stopping a feed simulation

Overview

Description Stops a currently active feed simulation.
API Context /simulation/feed/{simulationName}?action=stop
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

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

curl command syntax

curl -X POST "http://<HOST_NAME>:<PORT>/simulation/feed/<SIMULATION_NAME>/?action=stop" -H "accept: application/json"

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200, 404, and 409.

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

Retrieving a simulation configuration status by name

Overview

Description Retrieves the status of a given simulation configuration.
API Context /simulation/feed/{simulationName}/status
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

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

curl command syntax

curl -X GET "http://<HOST_NAME>:<PORT>/simulation/feed/<SIMULATION_NAME>/status" -H "accept: application/json"

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200 and 404.

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

Uploading a CSV file

Overview

Description Uploads a CSV file for feed simulation.
API Context /simulation/files
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

curl command syntax

Sample curl command

Sample output

Response

HTTP Status Code

Possible codes are 200 and 404.

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

Fetching CSV file names

Overview

Description Fetches the names of CSV files that are currently uploaded in the system.
API Context /simulation/files
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

curl command syntax

curl -X GET "http://<HOST_NAME>:<PORT>/simulation/files" -H "accept: application/json"

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200 and 404.

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

Updating a CSV file

Overview

Description Updates a CSV file that is already uploaded in the system.
API Context /simulation/files/{fileName}
HTTP Method PUT
Request/Response format
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

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

curl command syntax

Sample curl command

curl -X PUT -F '[email protected]' http://localhost:9390/simulation/files/foostream.csv?fileName=foostream.csv

Sample output

Response

HTTP Status Code

Possible codes are 200 and 404.

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

Deleting a CSV file

Overview

Description Deletes the specified CSV file.
API Context /simulation/files/{fileName}
HTTP Method DELETE
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

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

curl command syntax

curl -X DELETE "http://<HOST_NAME>:<PORT>/simulation/files/<FILE_NAME>.csv" -H "accept: application/json"

Sample curl command

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

Sample output

Response

HTTP Status Code

Possible codes are 200 and 404.

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

Testing a database connection

Overview

Description Tests a database connection.
API Context /simulation/connectToDatabase
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

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

Possible codes are 200 and 404.

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

Retrieving database tables

Overview

Description Retrieves database tables.
API Context /simulation/connectToDatabase/retrieveTableNames
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

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

Possible codes are 200 and 404.

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

Retrieving database table columns

Overview

Description Retrieves database table columns.
API Context /simulation/connectToDatabase/{tableName}/retrieveColumnNames
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime server/tooling

Parameter Description

Parameter Description
{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

Possible codes are 200 and 404.

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

Top