Creates an alert rule for a synchronization task.
Debugging
Authorization information
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Description | string | No | The description of the alert rule. | The description of the alert rule. |
| MetricType | string | Yes | The metric type in the alert rule. Valid values:
| Heartbeat |
| Enabled | boolean | No | Specifies whether to enable the alert rule. By default, the alert rule is disabled. | true |
| DIJobId | long | Yes | The ID of the synchronization task with which the alert rule is associated. | 1 |
| ClientToken | string | No | The client token that is used to ensure the idempotence of the request. | ABFUOEUOTRTRJKE |
| Name | string | Yes | The name of the alert rule. | alartRule |
| TriggerConditions | array<object> | Yes | The conditions that can trigger the alert rule. | |
| object | Yes | The condition that can trigger the alert rule. | ||
| Severity | string | No | The severity level. Valid values:
| Warning |
| Duration | long | No | The time interval for alert calculation. Unit: minutes. | 10 |
| Threshold | long | No | The alert threshold.
| 10 |
| DdlTypes | array | No | The types of DDL operations for which the alert rule takes effect. | |
| string | No | The type of the DDL operation for which the alert rule takes effect. This parameter is required only if the MetricType parameter is set to DdlReport. Valid values:
| AlterAddColumn | |
DdlReportTagsdeprecated | array | No | This parameter is deprecated and replaced by the DdlTypes parameter. | |
deprecated | string | No | This parameter is deprecated and replaced by the DdlTypes parameter. | ALTERADDCOLUMN |
| NotificationSettings | object | Yes | The alert notification settings. | |
| NotificationChannels | array<object> | No | The alert notification methods. | |
| object | No | The alert notification method. | ||
| Severity | string | No | The severity level. Valid values:
| Warning |
| Channels | array | No | The alert notification method. Valid values:
| |
| string | No | The alert notification method. Valid values:
| Ding | |
| NotificationReceivers | array<object> | No | The settings of alert notification recipients. | |
| object | No | The settings of alert notification recipients. | ||
| ReceiverType | string | No | The recipient type. Valid values: AliyunUid, DingToken, FeishuToken, and WebHookUrl. | DingToken |
| ReceiverValues | array | No | The recipient.
| |
| string | No | The recipient.
| token1 | |
| MuteInterval | integer | No | The duration of the alert suppression interval. Default value: 5. Unit: minutes. | 5 |
InhibitionIntervaldeprecated | integer | No | This parameter is deprecated and replaced by the MuteInterval parameter. | 5 |
Response parameters
Examples
Sample success responses
JSONformat
{
"Id": 1,
"RequestId": "C636A747-7E4E-594D-94CD-2B4F8A9A9A63",
"DIAlarmRuleId": 1
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-01-09 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2025-01-06 | The response structure of the API has changed | View Change Details |
