All Products
Search
Document Center

:CreateDIAlarmRule

最終更新日:Oct 08, 2023

Creates an alert rule for a Data Integration task of a new version. Only the following type of task is supported: real-time data synchronization from a MySQL database to Hologres.

You can configure alert rules only for tasks whose MigrationType is set to RealtimeIncremental.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes CreateDIAlarmRule

The operation that you want to perform. Set the value to CreateDIAlarmRule.

DIJobId Long Yes 11265

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

Description String No Alert rule for heartbeat of data synchronization from MySQL to Hologres

The description of the alert rule.

MetricType String Yes Heartbeat

The metric type in the alert rule.

TriggerConditions Array Yes

The conditions that can trigger the alert rule.

Severity String No Warning

The severity level.

Duration Long No 15

The time interval for alert calculation. Unit: minutes.

Threshold Long No 5

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, specify the number of failovers.
  • If the alert rule is for latency, specify the latency duration, in seconds.
NotificationSettings Object Yes

The alert notification settings.

NotificationChannels Array Yes

The alert notification methods.

Severity String No Warning

The severity level.

Channels Array of String No Ding

The method.

NotificationReceivers Array Yes

The alert notification recipients.

ReceiverType String No DingToken

The recipient type.

  • If the alert notification method is Mail, Phone, or Sms, the recipient type is Alibaba Cloud account ID.
  • If the alert notification method is Ding, the recipient type is DingTalk chatbot token.
ReceiverValues Array of String No token1

The recipient.

  • If the recipient type is Alibaba Cloud account ID, set this parameter to the Alibaba Cloud account ID of a user.
  • If the recipient type is DingTalk chatbot token, set this parameter to the token of a DingTalk chatbot.
InhibitionInterval Integer No 5

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

Enabled Boolean No true

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

Response parameters

Parameter

Type

Example

Description

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

The request ID.

DIAlarmRuleId Long 34988

The alert rule ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateDIAlarmRule
&DIJobId=11265
&Description=Alert rule for heartbeat of data synchronization from MySQL to Hologres
&MetricType=Heartbeat
&TriggerConditions=[{"Severity":"Warning","Duration":15,"Threshold":5}]
&NotificationSettings={"NotificationChannels":[{"Severity":"Warning","Channels":["Ding"]}],"NotificationReceivers":[{"ReceiverType":"DingToken","ReceiverValues":["token1"]}],"InhibitionInterval":5}
&Enabled=true
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDIAlarmRuleResponse>
    <RequestId>C636A747-7E4E-594D-94CD-2B4F8A9A9A63</RequestId>
    <DIAlarmRuleId>34988</DIAlarmRuleId>
</CreateDIAlarmRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status code

Error code

Error message

Description

429 Throttling.Api The request for this resource has exceeded your available limit. The number of requests for the resource has exceeded the upper limit.
429 Throttling.System The DataWorks system is busy. Try again later. The DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later. Excessive requests have been submitted within a short period of time. Try again later.
500 InternalError.System An internal system error occurred. Try again later. An internal error has occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later. An internal error has occurred. Try again later.

For a list of error codes, see Service error codes.