Skip to content

Streaming Integrator REST API Guide

The following sections cover the different categories of REST API available for the Streaming Integrator the HTTP status codes thyat they can return.

Siddhi application management APIs

Creating a Siddhi application

Overview

Description Creates a new Siddhi Application.
API Context /siddhi-apps
HTTP Method POST
Request/Response format Request : text/plain
Response : application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager

curl command syntax

    curl -X POST "https://localhost:9443/siddhi-apps" -H "accept: application/json" -H "Content-Type: text/plain" -d @TestSiddhiApp.siddhi -u admin:admin -k

Sample curl command

    curl -X POST "https://localhost:9443/siddhi-apps" -H "accept: application/json" -H "Content-Type: text/plain" -d @TestSiddhiApp.siddhi -u admin:admin -k

Sample output

The response for the sample curl command given above can be one of the following.

  • If API request is valid and there is no existing Siddhi application with the given name, a response similar to the following is generated with response code 201. This response contains a location header with the path of the newly created file from product root home.

  • If the API request is valid, but a Siddhi application with the given name already exists,  a response similar to the following is generated with response code 409.

            {
              "type": "conflict",
              "message": "There is a Siddhi App already exists with same name"
            }
  • If the API request is invalid due to invalid content in the Siddhi queries you have included in the request body,  a response similar to the following is generated is generated with response code 400.

            {
              "code": 800101,
              "type": "validation error",
              "message": "You have an error in your SiddhiQL at line 8:8, missing INTO at 'BarStream'"
            }
  • If the API request is valid, but an exception occured during file processing or saving, the following response is generated with response code 500.

            {
              "code": 800102,
              "type": "file processing error",
              "message": <error-message>
            }

Response

HTTP Status Code

Possible codes are 201, 409, 400, and 500.

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

Updating a Siddhi Application

Overview

Description Updates a Siddhi Application.
API Context /siddhi-apps
HTTP Method PUT
Request/Response format Request : text/plain
Response : application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager

curl command syntax

    curl -X PUT "http://localhost:9090/siddhi-apps" -H "accept: application/json" -H "Content-Type: text/plain" -d @<SIDDHI_APPLICATION_NAME>.siddhi -u admin:admin -k

Sample curl command

    curl -X PUT "https://localhost:9443/siddhi-apps" -H "accept: application/json" -H "Content-Type: text/plain" -d @TestSiddhiApp.siddhi -u admin:admin -k

Sample output

  • If the API request is invalid due to invalid content in the Siddhi query, a response similar to the following is returned with response code 400.

            {
              "code": 800101,
              "type": "validation error",
              "message": "You have an error in your SiddhiQL at line 8:8, missing INTO at 'BarStream'"
            }
  • If the API request is valid, but an exception occured when saving or processing files, a response similar to the following is returned with response code 500.

            {
              "code": 800102,
              "type": "file processing error",
              "message": <error-message>
            }

Response

HTTP Status Code

Possible codes are 200, 201, 400, and 500.

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

Deleting a Siddhi application

Overview

Description Sends the name of a Siddhi application as a URL parameter.
API Context /siddhi-apps/{appName}
HTTP Method DELETE
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description
Parameter Description
{appName} The name of the Siddhi application to be deleted.

curl command syntax

    curl -X DELETE "http://localhost:9090/siddhi-apps/{app-name}" -H "accept: application/json" -u admin:admin -k

Sample curl command

    curl -X DELETE "https://localhost:9443/siddhi-apps/TestSiddhiApp" -H "accept: application/json" -u admin:admin -k

Sample output

The respose for the sample curl command given above can be one of the following:

  • If the API request is valid and a Siddhi application with the given name exists, the following response is received with response code 200.

            http://localhost:9090/siddhi-apps/TestExecutionPlan1
  • If the API request is valid, but a Siddhi application with the given name is not deployed, the following response is received with response code 404.

            {
              "type": "not found",
              "message": "There is no Siddhi App exist with provided name : TestExecutionPlan1"
            }
  • If the API request is valid, but an exception occured when deleting the given Siddhi application, the following response is received with response code 500.

            {
              "code": 800102,
              "type": "file processing error",
              "message": <error-message>
            }
  • If the API request is valid, but there are restricted characters in the given Siddhi application name, the following response is received with response code 400.

            {
              "code": 800101,
              "type": "validation error",
              "message": "File name contains restricted path elements . : ../../siddhiApp2'"
            }

Response

HTTP Status Code

200, 404, 500 or 400.

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

Listing all active Siddhi applications

Overview

Description

Lists all the currently active Siddhi applications.

If the isActive=true parameter is set, all the active Siddhi Applications are listed. If not, all the inactive Siddhi applications are listed.

API Context /siddhi-apps
HTTP Method GET
Request/Response format Request content type : any
Response content type : application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager

curl command syntax

    curl -X GET "http://localhost:9090/siddhi-apps" -H "accept: application/json" -u admin:admin -k

Sample curl command

    curl -X GET "https://localhost:9443/siddhi-apps?isActive=true" -H "accept: application/json" -u admin:admin -k

Sample output

Possible responses are as follows:

  • If the API request is valid and there are Siddhi applications deployed in your SP setup, a response similar to the following is returned with response code 200.

            ["TestExecutionPlan3", "TestExecutionPlan4"]
  • If the API request is valid, there are Siddhi applications deployed in your SP setup, and a query parameter is defined in the request, a response similar to the following is returned with response code 200. This response only contains Siddhi applications that are active.

    !!! info
        If these conditions are met, but the `isActive`
        parameter is set to `false` , the response
        contains only inactive Siddhi applications.
        ["TestExecutionPlan3"]
  • If the API request is valid, but there are no Siddhi applications deployed in your SP setup, the following response is returned.

            []

Response

HTTP Status Code

200

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

Retrieving a specific Siddhi application

Overview

Description Retrieves the given Siddhi application.
API Context /siddhi-apps/{appName}
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description
Parameter Description
{appName} The name of the Siddhi application to be retrieved.

curl command syntax

    curl -X GET "http://localhost:9090/siddhi-apps/{app-name}" -H "accept: application/json" -u admin:admin -k

Sample curl command

    curl -X GET "https://localhost:9443/siddhi-apps/SiddhiTestApp" -H "accept: application/json" -u admin:admin -k

Sample output

The possible outputs are as follows:

  • If the API request is valid and a Siddhi application of the given name exists, a response similar to the following is returned with response code 200.

            {
              "content": "\n@Plan:name('TestExecutionPlan')\ndefine stream FooStream (symbol string, price float, volume long);\n\n@source(type='inMemory', topic='symbol', @map(type='passThrough'))Define stream BarStream (symbol string, price float, volume long);\n\nfrom FooStream\nselect symbol, price, volume\ninsert into BarStream;"
            }
  • If the API request is valid, but a Siddhi application of the given name is not deployed, a response similar to the following is returned with response code 404.

            {
              "type": "not found",
              "message": "There is no Siddhi App exist with provided name : TestExecutionPlan1"
            }

Response

HTTP Status Code

200 or 404

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

Fetching the status of a Siddhi Application

Overview

Description This fetches the status of the specified Siddhi application
API Context /siddhi-apps/{appName}/status
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description
Parameter Description
{appName} The name of the Siddhi application of which the status needs to be fetched.

curl command syntax

    curl -X GET "http://localhost:9090/siddhi-apps/{app-file-name}/status" -H "accept: application/json" -u admin:admin -k

Sample curl command

    curl -X GET "https://localhost:9443/siddhi-apps/TestSiddhiApp/status" -H "accept: application/json" -u admin:admin -k

Sample output

  • If the Siddhi application is active, the following is returned with response code 200.

            {"status":"active"}
  • If the Siddhi application is inactive, the following is returned with response code 200.

            {"status":"inactive"}
  • If the Siddhi application does not exist, but the REST API call is valid, the following is returned with the response code 404.

            {
              "type": "not found",
              "message": "There is no Siddhi App exist with provided name : TestExecutionPlan1"
            }

Response

HTTP Status Code

200 or 404

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

Taking a snapshot of a Siddhi Application

Overview

Description This takes a snapshot of the specific Siddhi application.
API Context /siddhi-apps/{appName}/backup
HTTP Method POST
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description
Parameter Description
{appName} The name of the Siddhi application of which a snapshot needs to be taken.

curl command syntax

    curl -X POST "http://localhost:9090/siddhi-apps/{appName}/backup" -H "accept: application/json" -u admin:admin -k

Sample curl command

    curl -X POST "https://localhost:9443/siddhi-apps/TestSiddhiApp/backup" -H "accept: application/json" -u admin:admin -k

Sample output

The output can be one of the following:

  • If the API request is valid and a Siddhi application exists with the given name, an output similar to the following (i.e., with the snapshot revision number) is returned with response code 201.

            {"revision": "89489242494242"}
  • If the API request is valid, but no Siddhi application with the given name is deployed, an output similar to the following is returned with response code 404.

            {
              "type": "not found",
              "message": "There is no Siddhi App exist with provided name : TestExecutionPlan1"
            }
  • If the API request is valid, but an exception has occured when backing up the state at Siddhi level, an output similar to the following is returned with response code 500.

            {
              "code": 800102,
              "type": "file processing error",
              "message": <error-message>
            }

Response

HTTP Status Code

201, 404, or 500.

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

Restoring a Siddhi Application via a snapshot

Info

In order to call this API, you need tohave already taken a snapshot of the Siddhi application to be restored. For more information about the API via which the snapshow is taken, see Taking a snapshot of a Siddhi application.

Overview

Description

This restores a Siddhi application using a snapshot of the same that you have previously taken.

API Context

  • To restore without considering the version : /siddhi-apps/{appName}/restore
  • To restore a specific version : /siddhi-apps/{appName}/restore?version=

HTTP Method

POST

Request/Response format

application/json

Authentication

Basic

Username

admin

Password

admin

Runtime

worker/manager

Parameter Description
Parameter Description
{appName}
The name of the Siddhi application that needs to be restored.

curl command syntax

    curl -X POST "http://localhost:9090/siddhi-apps/{appName}/restore" -H "accept: application/json" -u admin:admin -k

Sample curl command

    curl -X POST "https://localhost:9443/siddhi-apps/TestSiddhiApp/restore?revision=1514981290838_TestSiddhiApp" -H "accept: application/json" -u admin:admin -k

Sample output

The above sample curl command can generate either one of the following responses:

  • If the API request is valid, a Siddhi application with the given name exists, and no revision information is passed as a query parameter, the following response is returned with response code 200.

            {
              "type": "success",
              "message": "State restored to last revision for Siddhi App :TestExecutionPlan"
            }
  • If the API request is valid, a Siddhi application with the given name exists, and revision information is passed as a query parameter, the following response is returned with response code 200. In this scenario, the Siddhi snapshot is created in the file system.

            {
              "type": "success",
              "message": "State restored to revision 1234563 for Siddhi App :TestExecutionPlan"
            }
  • If the API request is valid, but no Siddhi application is deployed with the given name, the following response is returned with response code 404.

            {
              "type": "not found",
              "message": "There is no Siddhi App exist with provided name : TestExecutionPlan1"
            }
  • If the API request is valid, but an exception occured when restoring the state at Siddhi level, the following response is returned with response code 500.

            {
              "code": 800102,
              "type": "file processing error",
              "message": <error-message>
            }

Response

HTTP Status Code

200, 404 or 500.

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

Returning real-time statistics of a worker

Overview

Description Returns the real-time statistics of a worker.
API Context /statistics
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9443/statistics" -H "accept: application/json" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Enabling/disabling worker statistics

Overview

Description Enables/diables generating statistics for worker nodes.
API Context /statistics
HTTP Method PUT
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description

curl command syntax

Sample curl command

    curl -X PUT "https://localhost:9443/statistics" -H "accept: application/json" -H "Content-Type: application/json" -d "{“statsEnable”:”true”}" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Returning general details of a worker

Overview

Description Returns general details of a worker.
API Context /system-details
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9443/system-details" -H "accept: application/json" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Returning detailed statistics of all Siddhi applications

Overview

Description Returns the detailed statistics of all the Siddhi applications currently deployed in the SP setup.
API Context /siddhi-apps/statistics
HTTP Method GET
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9443/siddhi-apps/statistics" -H "accept: application/json" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Enabling/disabling the statistics of a specific Siddhi application

Overview

Description Enables/disables statistics for a specified Siddhi application.
API Context /siddhi-apps/{appName}/statistics
HTTP Method PUT
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description
Parameter Description
appName The name of the Siddhi application for which the Siddhi applications need to be enabled/disabled.

curl command syntax

Sample curl command

    curl -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

Sample output

Response

HTTP Status Code

200 or 404

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

Enabling/disabling the statistics of all Siddhi applications

Overview

Description Enables/disables statistics for all the Siddhi applications.
API Context /siddhi-apps/statistics
HTTP Method PUT
Request/Response format application/json
Authentication Basic
Username admin
Password admin
Runtime worker/manager
Parameter Description

curl command syntax

Sample curl command

    curl -X PUT "https://localhost:9443/siddhi-apps/statistics" -H "accept: application/json" -H "Content-Type: application/json" -d "{“statsEnable”:”true”}" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Event Simulation APIs

Status Monitoring APIs

Dashboard APIs

Authentication APIs

Log in to a dashboard application

Overview

Overview Logs in to the apps in dashboard runtime such as portal, monitoring or business-rules app.
API Context /login/{appName}
HTTP Method POST
Request/Response Format
application/x-www-form-urlencoded
Runtime Dashboard
Parameter description
Parameter Type Description Possible Values
appName Path param The application to which you need to log in. portal/monitoring/business-rules
username Body param Username for the login
password Body param Password for the login
grantType Body param Grant type used for the login password/
          refresh_token
        


        
          authorization_code
        
rememberMe
Body param Whether remember me function enabled false/true

curl command syntax

    curl -X POST "https://analytics.wso2.com/login/{appName}" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "username={username}&password={password}&grantType={grantTypr}&rememberMe={rememberMe}"

Sample curl command

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

Sample output

    {"authUser":"admin","pID":"71368eff-cc71-44ef","lID":"a60c1098-3de0-42fb","validityPeriod":3600}

Response

HTTP Status Code

200 or 404

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

Log out of the dashboard application

Overview

Overview Logs out of the dashboard application.
API Context /logout/{appName}
HTTP Method POST
Request/Response Format application/json
Runtime Dashboard

curl command syntax

    curl -X POST "https://analytics.wso2.com/logout/{appName}" -H "accept: application/json" -H "Authorzation: Bearer {access token}"

Sample curl command

    curl -X POST "https://analytics.wso2.com/logout/portal" -H "accept: application/json" -H "Authorzation: Bearer 123456"

Sample output

    N/A

Response

HTTP Status Code

200 or 404

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

Redirect URL for login using authorization grant type

Overview

Overview Redirects URL by the IS in authorization grant type - OAuth2.
API Context /login/callback/{appName}
HTTP Method GET
Request/Response Format JSON
Runtime Dashbaord
Parameter description
Parameter Description
{appName} The application of which the URL needs to be redirected.

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9643/login/callback/portal"

Sample output

Response

HTTP Status Code

200 or 404

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

Permission APIs

Business Rules APIs

Lists available business rule instances

Overview

Description Returns the list of business rule instances that are currently available.
API Context /business-rules/instances
HTTP Method GET
Request/Response Format
Authentication Basic
Username admin
Password admin
Runtime Dashboard

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9643/business-rules/instances" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Delete business rule with given UUID

Overview

Description Deletes the business rule with the given UUID.
API Context /business-rules/instances/{businessRuleInstanceID}?force-delete=false
HTTP Method DELETE
Request/Response Format application/json
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{businessRuleInstanceID} The UUID (Uniquely Identifiable ID) of the business rules instance to be deleted.

curl command syntax

Sample curl command

    curl -X DELETE "https://localhost:9643/business-rules/instances/business-rule-1?force-delete=false" -H "accept: application/json" -u admin:adm

Sample output

Response

HTTP Status Code

200 or 404

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

Fetch template group with the given UUID

Overview

Description Returns the template group that has the given UUID.
API Context /business-rules/template-groups/{templateGroupID}
HTTP Method GET
Request/Response Format
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{templateGroupID} The UUID of the template group to be fetched.

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9643/business-rules/template-groups/sweet-factory" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Fetch rule templates of the template group with given UUID

Overview

Description Returns the rule templates of the template group with the given UUID.
API Context /business-rules/template-groups/{templateGroupID}/templates
HTTP Method GET
Request/Response Format
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{templateGroupID} The UUID of the template group of which the rule templates need to be fetched.

curl command syntax

Sample curl command

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

Sample output

Response

HTTP Status Code

200 or 404

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

Fetch rule template of specific UUID available under a template group with specific UUID

Overview

Description Returns the rule template with the specified UUID that is defined under the template group with the specified UUID.
API Context /business-rules /template-groups/{templateGroupID}/templates/{ruleTemplateID}
HTTP Method GET
Request/Response Format
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{templateGroupID} The UUID of the template group from which the specified rule template needs to be retrieved.
{ruleTemplateID} The UUID of the rule template that needs to be retrieved from the specified template group.

curl command syntax

Sample curl command

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

Sample output

Response

HTTP Status Code

200 or 404

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

Fetch available template groups

Overview

Description Returns all the template groups that are currently available in the SP setup.
API Context /business-rules/template-groups
HTTP Method GET
Request/Response Format
Authentication Basic
Username admin
Password admin
Runtime Dashboard

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9643/business-rules/template-groups" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Fetch business rule instance with given UUID

Overview

Description Returns the business rule instance with the given UUID.
API Context /business-rules/instances/{businessRuleInstanceID}
HTTP Method GET
Request/Response Format application/json
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{businessRuleInstanceID} The UUID of the business rules instance to be fetched.

curl command syntax

Sample curl command

    curl -X GET "https://localhost:9643/business-rules/instances/business-rule-1" -H "accept: application/json" -u admin:admin -k

Sample output

Response

HTTP Status Code

200 or 404

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

Create and save a business rule

Overview

Description Creates and saves a business rule.
API Context /business-rules /instances?deploy={deploymentStatus}
HTTP Method POST
Request/Response Format application/json
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{deploymentStatus}

curl command syntax

Sample curl command

    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 -k

Sample output

Response

HTTP Status Code

200 or 404

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

Update business rules instance with given UUID

Overview

Description Updates the business rules instance with the given UUID.
API Context /business-rules /instances/{businessRuleInstanceID}?deploy={deploymentStatus}
HTTP Method PUT
Request/Response Format application/json
Authentication Basic
Username admin
Password admin
Runtime Dashboard
Parameter description
Parameter Description
{businessRuleInstanceID} The UUID of the business rules instance to be updated.
{deploymentStatus}

curl command syntax

Sample curl command

    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 -k

Sample output

Response

HTTP Status Code

200 or 404

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

Store APIs

Query records in Siddhi store

Overview

Description Queries records in the Siddhi store. For more information, see Managing Stored Data via REST API .
API Context /stores/query
HTTP Method POST
Request/Response Format application/json
Authentication Basic
Username admin
Password admin
Runtime Worker

curl command syntax

    curl -X POST https://localhost:9443/stores/query -H "content-type: application/json" -u "admin:admin"
    -d '{"appName" : "AggregationTest", "query" : "from stockAggregation select *" }' -k

Sample curl command

    curl -X POST https://localhost:9443/stores/query -H "content-type: application/json" -u "admin:admin" -d '{"appName" : "RoomService", "query" : "select 10 as roomNumber, 1 as arrival update RoomTypeTable  set RoomTypeTable.people = RoomTypeTable.people + arrival on RoomTypeTable.roomNo == roomNumber;" }' -k

Sample output

Response

HTTP Status Code

200 or 404

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

Healthcheck APIs

Overview

Description
API Context
HTTP Method GET
Request/Response Format
Authentication Basic
Username admin
Password admin
Runtime

curl command syntax

Sample curl command

    curl -k -X GET http://localhost:9090/health

Sample output

Response

HTTP Status Code

200 or 404

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

HTTP Status Codes

When REST API requests are sent to carryout various actions, various HTTP status codes will be returned based on the state of the action (success or failure) and the HTTP method (POST, GET, PUT, DELETE) executed. The following are the definitions of the various HTTP status codes that are returned.

HTTP status codes indicating successful delivery

Code Code Summary Description
200 Ok HTTP request was successful. The output corresponding to the HTTP request will be returned. Generally used as a response to a successful GET and PUT REST API HTTP methods.
201 Created HTTP request was successfully processed and a new resource was created. Generally used as a response to a successful POST REST API HTTP method.
204 No content HTTP request was successfully processed. No content will be returned. Generally used as a response to a successful DELETE REST API HTTP method.
202 Accepted HTTP request was accepted for processing, but the processing has not been completed. This generally occurs when your successful in trying to undeploy an application.

Error HTTP status codes

Code Code Summary Description
404 Not found Requested resource not found. Generally used as a response for unsuccessful GET and PUT REST API HTTP methods.
409 Conflict Request could not be processed because of conflict in the request. This generally occurs when you are trying to add a resource that already exists. For example, when trying to add an auto-scaling policy that has an already existing ID.
500 Internal server error Server error occurred.
Top