Simulate a Streaming Rule
Execute a rule with test data.
With this service method, you can simulate the rule behavior with test data.
It's in the very nature of any IoT scenario that there are lots of data to be processed. When this data is fed into a rule as data input, any mistake or flaw in the rule setup can easily result in large amounts of trash data or impose high system load on the technical infrastructure. Therefore, it's a good idea to test the rule behavior in advance with a small set of test data before you activate it in the production environment. However, it's up to your choice whether the simulation is done with either the draft or the active version of a rule. To accomplish this, use the active parameter with the desired setting.
Request
URI: /v1/projects/<projectId>/stream-rules/<ID>/simulation
HTTP Method: POST
Permissions: <rule>.a
Request Parameters
| Parameter | Required | Data Type | Description | Parameter Type |
|---|---|---|---|---|
| projectID | Yes | string | Unique ID of the rule project to which the rule is assigned. | Path |
| ID | Yes | string | Unique ID of the rule to simulate. | Path |
| active | No | boolean |
Indicates which version of the rule shall be simulated.
|
Query |
Request Example
{
"timeSeriesDOName": {
"Temperature": "101"
}
}
With this request payload, you simulate the reception of a temperature value of 101 degrees.
Response
Response Status and Error Codes
| Code | Description |
|---|---|
| 200 | Rule simulated successfully. |
| 401 | Unauthorized. Rule couldn't be simulated due to insufficient access rights. |
| 403 | Forbidden. |
| 404 | Not found. For example, an invalid rule ID or project ID has been provided. |
Response Example
{"conditionIsMet":false}