-
Notifications
You must be signed in to change notification settings - Fork 0
Event Simulator
Madhawa Vidanapathirana edited this page Aug 21, 2017
·
5 revisions
Following operations are supported by WSO2 DAS 4.0 Event Simulator Client.
- Single Simulations
- Saving a simulation configuration
- Editing a simulation configuration
- Deleting a simulation configuration
- Retrieving a simulation configuration
- Uploading a CSV file
- Editing and uploaded CSV file
- Deleting an uploaded CSV file
- Pausing an event simulation
- Resuming an event simulation
- Stopping an event simulation
Refer Documentation of WSO2 DAS 4.0 Event simulator REST API for more details.
- Install DAS Python Client by following Installation Guide.
- WSO2 DAS 4.0 must be already installed and running. If not, follow the steps below.
- Obtain WSO2 DAS 4.0-M6 binary distribution from https://github.com/wso2/product-das/releases/tag/v4.0.0-M6.
- Extract
wso2das-4.0.0-SNAPSHOT.zipto a suitable location (sayDAS_HOME). - Navigate to
DAS_Home/bin/and runsh worker.sh.
from DAS4PythonAPI.DAS4PythonClient import DAS4PythonClient
from DAS4PythonAPI.EventSimulator.SingleSimulationConfiguration import SingleSimulationConfiguration
dasPythonClient = DAS4PythonClient('http://localhost:9090') # host URL of DAS
eventSimulatorClient = dasPythonClient.getEventSimulatorClient()
singleSimulationConfiguration = SingleSimulationConfiguration("TestSiddhiApp","FooStream",[None, 9, 45])
if eventSimulatorClient.simulateSingleEvent(singleSimulationConfiguration):
logging.info("Successfully Simulated Single Event")