Skip to content

Siddhi App Management

Madhawa Vidanapathirana edited this page Aug 21, 2017 · 4 revisions

Using DAS Python Client following operations can be undertaken on Siddhi App Management of WSO2 DAS 4.0.

  • List all Siddhi Apps.
  • Retrieve Siddhi App using name.
  • Retrieve Status of Siddhi App.
  • Save a new Siddhi App in DAS.
  • Update a Siddhi App stored in DAS.
  • Delete a Siddhi App stored in DAS.

Pre-requisites

  1. Install DAS Python Client by following Installation Guide.
  2. WSO2 DAS 4.0 must be already installed and running. If not, follow the steps below.

List all Siddhi Apps

from DAS4PythonAPI.DAS4PythonClient import DAS4PythonClient

dasPythonClient = DAS4PythonClient('http://localhost:9090') # host URL of DAS
siddhiAppManagementClient = dasPythonClient.getSiddhiAppManagementClient()

print(siddhiAppManagementClient.listSiddhiApps()) # prints a list of siddhi apps

Retrieve Siddhi App using Name

from DAS4PythonAPI.DAS4PythonClient import DAS4PythonClient
dasPythonClient = DAS4PythonClient('http://localhost:9090') # host URL of DAS
siddhiAppManagementClient = dasPythonClient.getSiddhiAppManagementClient()

app = siddhiAppManagementClient.retrieveSiddhiApp("TestSiddhiApp")
print(app)

Retrieve Siddhi App Status

from DAS4PythonAPI.DAS4PythonClient import DAS4PythonClient
dasPythonClient = DAS4PythonClient('http://localhost:9090') # host URL of DAS
siddhiAppManagementClient = dasPythonClient.getSiddhiAppManagementClient()

status = siddhiAppManagementClient.retrieveStatusSiddhiApp("TestSiddhiApp")
print (status) # prints status of siddhi app (active)

Clone this wiki locally