create #
Creates a new notification rule inside a tenant index.
Return an error if the rule already exists.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/notification-rules/:index
Method: POST
Body:
{
"name": "<rule name>",
"description": "<rule description>",
"disabled": false, // boolean, optional, default: false
"filters": {
// filters
},
"sendgridAction": {
"enabled": false, // boolean
"recipients": "<mail@kuzzle.io>",
"subject": "<subject>",
"message": "<message>",
},
"smtpAction": {
"enabled": false, // boolean
"recipients": "<mail@kuzzle.io>",
"subject": "<subject>",
"message": "<message>",
},
"twilioAction": {
"enabled": false, // boolean
"recipients": "<mail@kuzzle.io>",
"subject": "<subject>",
"message": "<message>",
},
}
Javascript #
kuzzle.query({
controller: 'notification-rules',
action: 'create',
index: '<index>',
body: {
name: '<rule name>',
description: '<rule description>',
disabled: false, // boolean, optional, default: false
filters: {
// filters
},
sendgridAction: {
enabled: false, // boolean
recipients: '<mail@kuzzle.io, othermail@kuzzle.io>',
subject: '<subject>',
message: '<message>',
},
smtpAction: {
enabled: false, // boolean
recipients: '<mail@kuzzle.io, othermail@kuzzle.io>',
subject: '<subject>',
message: '<message>',
},
twilioAction: {
enabled: false, // boolean
recipients: '<mail@kuzzle.io, othermail@kuzzle.io>',
subject: '<subject>',
message: '<message>',
},
},
});
Arguments #
name
: rule namedescription
: rule descriptiondisabled
: rule status, while true, the rule is disabled and will not be executedfilters
: filters to apply on the alerts that will trigger the rulesendgridAction
: sendgrid action configurationsmtpAction
: smtp action configurationtwilioAction
: twilio action configuration
Actions properties #
enabled
: action status, while false, the action is disabled and will not be executedrecipients
: recipients of the notificationsubject
: subject of the notificationmessage
: message of the notification
Edit this page on Github(opens new window)