Creates a rule with given parameters

Params

Param name Description
rule
required

Map containing the details of the rule to be created


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:DarTKU-eUJ7md2vS-lFroA" -d '{"rule":{"enabled":true,"name":"Voltage High Threshold monitoring","expression":"$event.data.voltage \u003C 270","rule_applicability":3,"rule_applicability_value":["27ce8667143fa217b3eb9ecbedcbacdc28addt97","16dc891e4b255735d7tafete13e6fdc412628t84"],"time_between_triggers":1800}}' https://api.datonis.io/api/v3/rules

Response (containing details of the rule created)
{
  "rule": {
    "enabled": true,
    "expression": "$event.data.voltage < 270",
    "name": "Voltage High Threshold monitoring",
    "rule_applicability": 3,
    "rule_applicability_value": "27ce8667143fa217b3eb9ecbedcbacdc28addt97,16dc891e4b255735d7tafete13e6fdc412628t84",
    "rule_key": "ted3793aa3",
    "rule_type": null,
    "time_between_triggers": 1800,
    "user_visible_expression": null
  }
}