public class CreateOrUpdateNotificationPolicyRequest
extends com.aliyun.tea.TeaModel
| 限定符和类型 | 字段和说明 |
|---|---|
Boolean |
directedMode
Specifies whether to enable simple mode.
|
Long |
escalationPolicyId
The ID of the escalation policy.
|
String |
groupRule
An array of alert event group objects.
|
Long |
id
The ID of the notification policy.
|
Long |
integrationId
The integration ID of the ticket system to which alerts are pushed.
|
String |
matchingRules
The matching rules.
|
String |
name
The name of the notification policy.
|
String |
notifyRule
An array of notification rule objects.
|
String |
notifyTemplate
The notification template.
|
String |
regionId
The ID of the region.
|
Boolean |
repeat
Specifies whether to resend a notification for a long-lasting unresolved alert.
|
Long |
repeatInterval
The time interval at which a notification is resent for a long-lasting unresolved alert.
|
Boolean |
sendRecoverMessage
Indicates whether the system sends a notification to the contacts when the status of an alert changes to Resolved.
|
String |
state
example:
enable
|
| 构造器和说明 |
|---|
CreateOrUpdateNotificationPolicyRequest() |
@NameInMap(value="DirectedMode") public Boolean directedMode
Specifies whether to enable simple mode.
@NameInMap(value="EscalationPolicyId") public Long escalationPolicyId
The ID of the escalation policy.
example:123
@NameInMap(value="GroupRule") public String groupRule
An array of alert event group objects.
If you do not specify the groupingFields field, all alerts will be sent to contacts based on alertname.
If you specify the groupingFields field, alerts with the same field will be sent to contacts in one notification.
Sample statement:
{
"groupWait":5, // The waiting time for grouping.
"groupInterval":30, // The time interval of grouping.
"groupingFields":["alertname"] // The field that is used to group alert events.
}
example:
{ "groupWait":5, "groupInterval":30, "groupingFields":["alertname"] }
@NameInMap(value="Id") public Long id
The ID of the notification policy.
1234
@NameInMap(value="IntegrationId") public Long integrationId
The integration ID of the ticket system to which alerts are pushed.
example:34
@NameInMap(value="MatchingRules") public String matchingRules
The matching rules. Sample statement:
[
{
"matchingConditions": [
{
"value": "test", // The value of the matching condition.
"key": "alertname", // The key of the matching condition.
"operator": "eq" // The logical operator of the matching condition, including eq (equal to), neq (not equal to), in (contains), nin (does not contain), re (regular expression match), and nre (regular expression mismatch).
}
]
}
]
example:
[ { "matchingConditions": [ { "value": "test", "key": "alertname", "operator": "eq" } ] } ]
@NameInMap(value="Name") public String name
The name of the notification policy.
This parameter is required.
example:notificationpolicy_test
@NameInMap(value="NotifyRule") public String notifyRule
An array of notification rule objects. Format:
{
"notifyStartTime":"00:00", // The start time of the notification window.
"notifyEndTime":"23:59", // The end time of the notification window.
"notifyChannels":["dingTalk", "email", "sms", "tts", "webhook"], // The notification methods. Valid values: dingTalk, email, sms, tts, and webhook.
"notifyObjects":[{ // An array of notification objects.
"notifyObjectType":"CONTACT", // The type of the notification object. Valid values: CONTACT (contact), CONTACT_GROUP (contact group), ARMS_CONTACT (ARMS contact), ARMS_CONTACT_GROUP (ARMS contact group), DING_ROBOT_GROUP (DingTalk, Lark, WeCom, or IM chatbot), and CONTACT_SCHEDULE (user on duty defined by a schedule).
"notifyObjectId":123, // The ID of the notification object.
"notifyObjectName":"test" // The name of the notification object.
"notifyChannels": [ // The notification methods specified for a contact. Valid values: email, sms, and tts.
"email",
"sms",
"tts"
],
}]
This parameter is required.
example:{ "notifyStartTime":"00:00", "notifyEndTime":"23:59", "notifyChannels":[ "dingTalk", "email", "sms", "tts", "webhook" ], "notifyObjects":[ { "notifyObjectType":"CONTACT", "notifyObjectId":123, "notifyObjectName":"test" } ] }
@NameInMap(value="NotifyTemplate") public String notifyTemplate
The notification template. The default notification template is provided below the table.
example:{{if .commonLabels.clustername }}
> Cluster Name: {{ .commonLabels.clustername }}
{{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}
> App Name: {{ .commonLabels._aliyun_arms_involvedObject_name }}
{{ end }}{{ for .alerts }} > {{ .annotations.message }} {{if .generatorURL }} Details {{end}} {{if .annotations._aliyun_arms_insights_analyze_link }}[<font color=\"#ff0000\">diagnostic analysis</font>]({{ .annotations._aliyun_arms_insights_analyze_link}}){{ end }}{{if eq "1" .labels._aliyun_arms_denoise_code }} (Important:{{.labels._aliyun_arms_important_reason }}) {{end}}
{{end}}
@NameInMap(value="RegionId") public String regionId
The ID of the region.
example:cn-hangzhou
@NameInMap(value="Repeat") public Boolean repeat
Specifies whether to resend a notification for a long-lasting unresolved alert. Default value: true. Valid values:
true: If you set this parameter to true, you must set RepeatInterval.false: If you set this parameter to false, you must set EscalationPolicyId.true
@NameInMap(value="RepeatInterval") public Long repeatInterval
The time interval at which a notification is resent for a long-lasting unresolved alert. Unit: seconds.
example:600
@NameInMap(value="SendRecoverMessage") public Boolean sendRecoverMessage
Indicates whether the system sends a notification to the contacts when the status of an alert changes to Resolved. Default value: true. Valid values:
true: The system sends a notification.false: The system does not send a notification.true
@NameInMap(value="State") public String state
enable
public static CreateOrUpdateNotificationPolicyRequest build(Map<String,?> map) throws Exception
Exceptionpublic CreateOrUpdateNotificationPolicyRequest setDirectedMode(Boolean directedMode)
public Boolean getDirectedMode()
public CreateOrUpdateNotificationPolicyRequest setEscalationPolicyId(Long escalationPolicyId)
public Long getEscalationPolicyId()
public CreateOrUpdateNotificationPolicyRequest setGroupRule(String groupRule)
public String getGroupRule()
public CreateOrUpdateNotificationPolicyRequest setId(Long id)
public Long getId()
public CreateOrUpdateNotificationPolicyRequest setIntegrationId(Long integrationId)
public Long getIntegrationId()
public CreateOrUpdateNotificationPolicyRequest setMatchingRules(String matchingRules)
public String getMatchingRules()
public CreateOrUpdateNotificationPolicyRequest setName(String name)
public String getName()
public CreateOrUpdateNotificationPolicyRequest setNotifyRule(String notifyRule)
public String getNotifyRule()
public CreateOrUpdateNotificationPolicyRequest setNotifyTemplate(String notifyTemplate)
public String getNotifyTemplate()
public CreateOrUpdateNotificationPolicyRequest setRegionId(String regionId)
public String getRegionId()
public CreateOrUpdateNotificationPolicyRequest setRepeat(Boolean repeat)
public Boolean getRepeat()
public CreateOrUpdateNotificationPolicyRequest setRepeatInterval(Long repeatInterval)
public Long getRepeatInterval()
public CreateOrUpdateNotificationPolicyRequest setSendRecoverMessage(Boolean sendRecoverMessage)
public Boolean getSendRecoverMessage()
public CreateOrUpdateNotificationPolicyRequest setState(String state)
public String getState()
Copyright © 2024. All rights reserved.