Patch existing rule
PATCH {{baseUrl}}/rules/:ruleId
Update the existing rule. The url contains the ruleId
to identify the rule for patching. Properties in the request body are utilized to update the rule. The response contains the updated rule after patching.
In order to change values, the patch body has to include the keys with the new values. In order to remove values, the patch body has to include the keys with null
values.
Patch can be used to set a new name, description, activate / deactivate the rule or adapt the evaluations and actions.
Attention: Any modification may cause a restart of the rule evaluation.
Request Body
{"name"=>"<string>", "description"=>"<string>", "active"=>"<boolean>", "evaluations"=>[{"property"=>"<string>", "condition"=>"<string>", "hysteresisAbsolute"=>{"active"=>"<boolean>", "value"=>"<number>", "lowerValue"=>"<number>", "upperValue"=>"<number>"}, "debouncingTime"=>{"active"=>"<boolean>", "value"=>"<number>"}, "threshold"=>"<integer>", "lowerLimitThreshold"=>"<number>", "upperLimitThreshold"=>"<number>"}, {"property"=>"<string>", "condition"=>"<string>", "hysteresisAbsolute"=>{"active"=>"<boolean>", "value"=>"<number>", "lowerValue"=>"<number>", "upperValue"=>"<number>"}, "debouncingTime"=>{"active"=>"<boolean>", "value"=>"<number>"}, "threshold"=>"<integer>", "lowerLimitThreshold"=>"<number>", "upperLimitThreshold"=>"<number>"}], "actions"=>{"email"=>{"active"=>"<boolean>", "address"=>"<string>"}, "notifier"=>{"active"=>"<boolean>"}, "status"=>{"active"=>"<boolean>", "severity"=>"<number>"}, "event"=>{"severity"=>"<number>", "limitInterval"=>{"active"=>"<boolean>", "value"=>"<number>"}}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
If-Match | string | (Required) etag of the latest version for optimistic locking | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"_embedded":{"rule":{"ruleId":"580a52f638394c8ab35f22f03556a7ed","assetType":"myiottenant.GearBox","assetIds":["9f81490428644ff995b0e3590f21ef57","76a1388fee23496bacac9bc378aa65fe"],"name":"New awesome rule name","description":"New desription","active":false,"creator":"\u003cName of user that has initially created the rule\u003e","created":"\u003cDate and time of rule creation\u003e","editor":"\u003cName of user that has last updated the rule configuration\u003e","edited":"\u003cDate and time of last rule update\u003e","evaluations":[{"property":"/data/GearBoxTemp","condition":"\u003e=","hysteresisAbsolute":{"active":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"lowerValue":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"upperValue":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"debouncingTime":{"active":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"threshold":50,"lowerLimitThreshold":25,"upperLimitThreshold":75},{"property":"/data/GearBoxTemp","condition":"\u003e=","hysteresisAbsolute":{"active":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"lowerValue":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"upperValue":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"debouncingTime":{"active":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"threshold":50,"lowerLimitThreshold":25,"upperLimitThreshold":75}],"actions":{"email":{"active":"\u003cboolean\u003e","address":"user1@example.com;user2@example.com"},"notifier":{"active":"\u003cboolean\u003e"},"status":{"active":"\u003cboolean\u003e","severity":"\u003cnumber\u003e"},"event":{"severity":"\u003cnumber\u003e","limitInterval":{"active":"\u003cboolean\u003e","value":10}}}}},"quota":{"active":31,"total":50,"limitActive":70},"message":"Rule updated"}