-
Notifications
You must be signed in to change notification settings - Fork 47
/
model_rule.go
34 lines (31 loc) · 4.61 KB
/
model_rule.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Detectors API
*
* **Detectors** define rules for identifying conditions of interest to the customer, and the notifications to send when the conditions occur or stop occurring.
*
* API version: 2.0.1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package detector
import (
"github.com/signalfx/signalfx-go/notification"
)
// A single alert rule.
type Rule struct {
// A description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor.
Description string `json:"description,omitempty"`
// The label of the publish statement associated with the detect function associated with this rule.
DetectLabel string `json:"detectLabel,omitempty"`
// Indicates whether the associated rule is turned on and being evaluated (false) or is currently turned off and will not fire even if the specified conditions are met (true).
Disabled bool `json:"disabled,omitempty"`
// Array of notification objects to send when the rule is triggered. You can specify more than one object, and each object can be of a different type.<br> To send email notifications:<br> * For one or more individual users, use \"type\": \"Email\" * For one or more entire SignalFx teams, use \"type\": \"TeamEmail\" * For one or more members of a single team, use \"type\": \"Team\" * For one or more members of multiple teams, use \"type\": \"TeamEmail\" <br> * To send emails to a team, the team must already exist. * To send email to specific members of a team, the team must already exist, and you must specify the team members who will receive emails.
Notifications []*notification.Notification `json:"notifications,omitempty"`
// Custom notification message *body* for this rule. The message is displayed when the alert is triggered. The content is plain text. Escape quote characters with a backslash, and indicate a newline with the \"\\n\" string. To insert a SignalFx variable value, specify its name in curly brackets. Double curly brackets (\"{{ }}\") specify a variable that's inserted in place, but some characters in the result may trigger unintended results in SignalFx or the notification server. Triple curly brackets specify a variable that SignalFx escapes as needed so that characters such as quotation marks and angle brackets render properly in notification messages. If you\\'re unsure which style of variable to use, use triple braces, so that all content renders properly. SignalFx does provide recommendations for the notation style to use with each supported variable. For more information see the custom notification messages section of the [Detectors Overview](https://developers.signalfx.com/v2/reference.html#detectors-overview). A full list of available variables with their default notation recommendation is available in the [Message variables](https://docs.signalfx.com/en/latest/detect-alert/set-up-detectors.html#message-variables) section of the \"Set Up Detectors\" topic in the SignalFx User Guide.
ParameterizedBody string `json:"parameterizedBody,omitempty"`
// Custom notification message *subject* for this rule. The message is displayed when the alert is triggered. The content is plain text. Escape quote characters with a backslash, and indicate a newline with the \"\\n\" string. To insert a SignalFx variable value, specify its name in curly brackets. Double curly brackets (\"{{ }}\") specify a variable that's inserted in place, but some characters in the result may trigger unintended results in SignalFx or the notification server. Triple curly brackets specify a variable that SignalFx escapes as needed so that characters such as quotation marks and angle brackets render properly in notification messages. If you\\'re unsure which style of variable to use, use triple braces, so that all content renders properly. SignalFx does provide recommendations for the notation style to use with each supported variable. For more information see the custom notification messages section of the [Detectors Overview](https://developers.signalfx.com/v2/reference.html#detectors-overview). A full list of available variables with their default notation recommendation is available in the [Message variables](https://docs.signalfx.com/en/latest/detect-alert/set-up-detectors.html#message-variables) section of the \"Set Up Detectors\" topic in the SignalFx User Guide.
ParameterizedSubject string `json:"parameterizedSubject,omitempty"`
// URL that you can refer to with the SignalFx `{{runbookURL}}` variable in the `parameterizedBody` or `parameterizedSubject` field.
RunbookUrl string `json:"runbookUrl,omitempty"`
Severity Severity `json:"severity,omitempty"`
Tip string `json:"tip,omitempty"`
}