All Products
Search
Document Center

DataWorks:CreateDIAlarmRule

Last Updated:Dec 05, 2024

Creates an alert rule for a synchronization task.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DescriptionstringNo

The description of the alert rule.

MetricTypestringYes

The metric type in the alert rule. Valid values:

  • Heartbeat
  • FailoverCount
  • Delay
  • DdlReport
  • ResourceUtilization
Heartbeat
EnabledbooleanNo

Specifies whether to enable the alert rule. By default, the alert rule is disabled.

true
DIJobIdlongYes

The ID of the synchronization task with which the alert rule is associated.

1
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

ABFUOEUOTRTRJKE
NamestringYes

The name of the alert rule.

alartRule
TriggerConditionsarray<object>Yes

The conditions that can trigger the alert rule.

objectYes

The condition that can trigger the alert rule.

SeveritystringNo

The severity level. Valid values:

  • Warning
  • Critical
Warning
DurationlongNo

The time interval for alert calculation. Unit: minutes.

10
ThresholdlongNo

The alert threshold.

  • If the alert rule is for task status, you do not need to specify a threshold.
  • If the alert rule is for failovers, you must specify the number of failovers.
  • If the alert rule is for latency, you must specify the latency duration, in seconds.
10
DdlReportTagsarrayNo

The types of DDL operations for which the alert rule takes effect.

stringNo

The type of DDL operation for which the alert rule takes effect. Valid values:

  • AlterAddColumn
  • AlterDropColumn
  • AlterRenameColumn
  • AlterRenameTable
  • AlterTableModify
  • DropTable
  • TruncateTable
ALTERADDCOLUMN
NotificationSettingsobjectYes

The alert notification settings.

NotificationChannelsarray<object>No

The alert notification methods.

objectNo

The alert notification method.

SeveritystringNo

The severity level. Valid values:

  • Warning
  • Critical
Warning
ChannelsarrayNo

The alert notification methods. Valid values:

  • Mail
  • Phone
  • Sms
  • Ding
stringNo

The alert notification method. Valid values:

  • Mail
  • Phone
  • Sms
  • Ding
Ding
NotificationReceiversarray<object>No

The settings of alert notification recipients.

objectNo

The settings of alert notification recipients.

ReceiverTypestringNo

The recipient type. Valid values: AliyunUid, DingToken, FeishuToken, and WebHookUrl.

DingToken
ReceiverValuesarrayNo

The recipient.

  • If the ReceiverType parameter is set to AliyunUid, set this parameter to the Alibaba Cloud account ID of a user.
  • If the ReceiverType parameter is set to DingToken, set this parameter to the token of a DingTalk chatbot.
stringNo

The recipient.

  • If the ReceiverType parameter is set to AliyunUid, set this parameter to the Alibaba Cloud account ID of a user.
  • If the ReceiverType parameter is set to DingToken, set this parameter to the token of a DingTalk chatbot.
token1
InhibitionIntervalintegerNo

The duration of the alert suppression interval. Default value: 5. Unit: minutes.

5

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

DIAlarmRuleIdstring

The ID of the alert rule.

1
RequestIdstring

The request ID. You can use the ID to query logs and troubleshoot issues.

C636A747-7E4E-594D-94CD-2B4F8A9A9A63

Examples

Sample success responses

JSONformat

{
  "DIAlarmRuleId": "1",
  "RequestId": "C636A747-7E4E-594D-94CD-2B4F8A9A9A63"
}

Error codes

For a list of error codes, visit the Service error codes.