public static final class CreateOrUpdateNotificationPolicyRequest.Builder extends Object
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.