public static final class CreateOrUpdateNotificationPolicyRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
CreateOrUpdateNotificationPolicyRequest |
build() |
CreateOrUpdateNotificationPolicyRequest.Builder |
directedMode(Boolean directedMode)
Specifies whether to enable simple mode.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
escalationPolicyId(Long escalationPolicyId)
The ID of the escalation policy.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
groupRule(String groupRule)
An array of alert event group objects.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
id(Long id)
The ID of the notification policy.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
integrationId(Long integrationId)
The integration ID of the ticket system to which alerts are pushed.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
matchingRules(String matchingRules)
The matching rules.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
name(String name)
The name of the notification policy.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
notifyRule(String notifyRule)
An array of notification rule objects.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
notifyTemplate(String notifyTemplate)
The notification template.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
regionId(String regionId)
The ID of the region.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
repeat(Boolean repeat)
Specifies whether to resend a notification for a long-lasting unresolved alert.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
repeatInterval(Long repeatInterval)
The time interval at which a notification is resent for a long-lasting unresolved alert.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
sendRecoverMessage(Boolean sendRecoverMessage)
Indicates whether the system sends a notification to the contacts when the status of an alert changes to Resolved.
|
CreateOrUpdateNotificationPolicyRequest.Builder |
state(String state)
Specifies whether to enable the notification policy.
|
public CreateOrUpdateNotificationPolicyRequest.Builder directedMode(Boolean directedMode)
public CreateOrUpdateNotificationPolicyRequest.Builder escalationPolicyId(Long escalationPolicyId)
public CreateOrUpdateNotificationPolicyRequest.Builder groupRule(String groupRule)
* 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. } ```
public CreateOrUpdateNotificationPolicyRequest.Builder id(Long id)
* If you do not specify this parameter, a new notification policy is created. * If you specify this parameter, the specified notification policy is modified.
public CreateOrUpdateNotificationPolicyRequest.Builder integrationId(Long integrationId)
public CreateOrUpdateNotificationPolicyRequest.Builder matchingRules(String matchingRules)
``` [ { "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). } ] } ] ```
public CreateOrUpdateNotificationPolicyRequest.Builder name(String name)
public CreateOrUpdateNotificationPolicyRequest.Builder notifyRule(String notifyRule)
{ "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" ], }]
public CreateOrUpdateNotificationPolicyRequest.Builder notifyTemplate(String notifyTemplate)
public CreateOrUpdateNotificationPolicyRequest.Builder regionId(String regionId)
public CreateOrUpdateNotificationPolicyRequest.Builder repeat(Boolean repeat)
* `true`: If you set this parameter to `true`, you must set **RepeatInterval**. * `false`: If you set this parameter to `false`, you must set **EscalationPolicyId**.
public CreateOrUpdateNotificationPolicyRequest.Builder repeatInterval(Long repeatInterval)
public CreateOrUpdateNotificationPolicyRequest.Builder sendRecoverMessage(Boolean sendRecoverMessage)
* `true`: The system sends a notification. * `false`: The system does not send a notification.
public CreateOrUpdateNotificationPolicyRequest.Builder state(String state)
public CreateOrUpdateNotificationPolicyRequest build()
Copyright © 2024. All rights reserved.