Create Event Rule
POST/organizations/:organizationId/event-rules
Create new event rule
Request
Path Parameters
organizationId stringrequired
The ID of organization.
- application/json
Body
required
- Array [
- ]
- Array [
- ]
name stringrequired
The name of event rule.
description string
The description of event rule.
stage stringrequired
The stage of event rule.
expression string
The expression of event rule.
conditions object[]
The conditions of event rule.
devices string[]
The devices of event rule.
period objectrequired
The period of event rule.
actions object[]required
The actions of event rule.
hashtags string[]
The hashtags of event rule.
status stringrequired
The status of event rule.
Responses
- 200
- 401
- 403
- 404
- 422
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [
- ]
- Array [
- ]
data objectrequired
Data of the event rule.
name stringrequired
description stringrequired
stage stringrequired
status stringrequired
targetName stringrequired
expression stringrequired
hashtags string[]required
conditions object[]required
assetId stringrequired
property stringrequired
symbol stringrequired
valueDataType stringrequired
value stringrequired
operator stringrequired
devices string[]required
period objectrequired
startTime objectrequired
endTime objectrequired
dayOfWeek string[]required
dayOfMonth number[]required
actions object[]required
type stringrequired
parameters objectrequired
createdBy stringrequired
createdAtDateString stringrequired
createdAt numberrequired
{
"data": {
"name": "string",
"description": "string",
"stage": "string",
"status": "string",
"targetName": "string",
"expression": "string",
"hashtags": [
"string"
],
"conditions": [
{
"assetId": "string",
"property": "string",
"symbol": "string",
"valueDataType": "string",
"value": "string",
"operator": "string"
}
],
"devices": [
"string"
],
"period": {
"startTime": {},
"endTime": {},
"dayOfWeek": [
"string"
],
"dayOfMonth": [
0
]
},
"actions": [
{
"type": "string",
"parameters": {}
}
],
"createdBy": "string",
"createdAtDateString": "string",
"createdAt": 0
}
}
{
"data": {
"name": "IDT-EventRule",
"description": "IDT-EventRule-Description",
"stage": "IoTCore",
"status": "Enabled",
"targetName": "IoTCore-Target-Name",
"expression": "IoTCore-Expression",
"hashtags": [
"Important"
],
"conditions": [
{
"assetId": "a-assetId",
"property": "Temperature",
"symbol": ">",
"valueDataType": "integer",
"value": "25",
"operator": "AND"
}
],
"devices": [
"a-assetId"
],
"period": {
"startTime": {
"hour": 20,
"minute": 34
},
"endTime": {
"hour": 21,
"minute": 34
},
"dayOfWeek": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"dayOfMonth": [
31
]
},
"actions": [
{
"type": "enqueue",
"parameters": {
"name": "Power Off",
"assetId": "a-assetId",
"confirmed": true,
"fPort": 85,
"payload": "080000ff",
"payloadDataType": "string"
}
}
],
"createdBy": "d6b0e137-xxxx-xxxx-xxxx-c944cc12a5f4",
"createdAtDateString": "2024-01-01T00:00:00.000Z",
"createdAt": 1704067200000
}
}
The request has not permission.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error stringrequired
The request has not permission.
message stringrequired
The request has not permission message.
{
"error": "string",
"message": "string"
}
{
"error": "Unauthenticated",
"message": "Authentication is required and has failed or has not yet been provided."
}
The request has not permission.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error stringrequired
The request has not permission.
message stringrequired
The request has not permission message.
{
"error": "string",
"message": "string"
}
{
"error": "Forbidden",
"message": "Access to the requested resource is forbidden."
}
The resource hasn't found.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error stringrequired
The resource hasn't found.
message stringrequired
The resource hasn't found message.
{
"error": "string",
"message": "string"
}
{
"error": "ResourceNotFound",
"message": "The requested resource could not be found."
}
The input data has invalid.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error stringrequired
The input data has invalid.
message stringrequired
The input data has invalid message.
{
"error": "string",
"message": "string"
}
{
"error": "ValidationError",
"message": "Input data validation failed."
}
Loading...