Creates or modifies an alert rule for a Data Transmission Service (DTS) task.

DTS provides the following metrics for DTS tasks:

  • Latency: DTS monitors the latency of a DTS task. If the latency of the task exceeds the specified threshold, an alert is triggered. Unit: seconds.
  • Status: DTS monitors the status of a DTS task. If the state of the task changes to Error or Restore, an alert is triggered.
  • Full Timeout: DTS monitors the duration of a DTS task. If the duration of the task exceeds the specified threshold, an alert is triggered. Unit: hours.

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

ParameterTypeRequiredExampleDescription
ActionStringYesCreateJobMonitorRule

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

DtsJobIdStringYesi03e3zty16i****

The ID of the data migration, data synchronization, or change tracking task. You can call the DescribeDtsJobs operation to query the task ID.

TypeStringNodelay

The metric that is used to monitor the task. Valid values:

  • delay: the Latency metric.
  • error: the Status metric.
  • full_timeout: the Full Timeout metric.

Default value: error. You must manually set this value.

StateStringNoY

Specifies whether to enable the alert rule. Valid values:

  • Y: enables the alert rule.
  • N: disables the alert rule.

Default value: Y.

PhoneStringNo1361234****,1371234****

The mobile numbers that receive alert notifications. Separate multiple mobile numbers with commas (,).

Note
  • This parameter is available only for users of the China site (aliyun.com). Only mobile numbers in the Chinese mainland are supported. You can specify up to 10 mobile numbers.
  • Users of the international site (alibabacloud.com) cannot receive alerts by using mobile phones, but can configure alert rules for DTS tasks in the CloudMonitor console.
DelayRuleTimeLongNo11

The threshold for triggering latency alerts.

  • If the Type parameter is set to delay, the threshold must be an integer. You can set the threshold based on your requirements. To prevent jitters caused by network and database overloads, we recommend that you set the threshold to more than 10 seconds. Unit: seconds.
  • If the Type parameter is set to full_timeout, the threshold must be an integer. Unit: hours.
Note This parameter is required if the Type parameter is set to delay or full_timeout and the State parameter is set to Y.
RegionIdStringNocn-hangzhou

The region ID of the DTS instance. For more information, see List of supported regions.

PeriodIntegerNo5

The statistical period of the incremental data verification task. Unit: minutes.

Note Valid values: 1, 5, 10, and 30.
TimesIntegerNo2

The number of statistical periods of the incremental data verification task.

NoticeValueIntegerNo2

The alert threshold.

Response parameters

ParameterTypeExampleDescription
HttpStatusCodeInteger200

The HTTP status code.

RequestIdString8C498360-7892-433C-847A-BA71A850****

The ID of the request.

DtsJobIdStringi03e3zty16i****

The ID of the data migration, data synchronization, or change tracking task.

ErrCodeString403

The error code returned if the call failed.

SuccessBooleantrue

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
ErrMessageStringThe Value of Input Parameter %s is not valid.

The error message returned if the request failed.

CodeString200

The error code. This parameter will be removed in the future.

DynamicMessageStringDtsJobId

The dynamic part in the error message. The value of this parameter is used to replace the %s variable in the value of the ErrMessage parameter.

Note For example, if the specified DtsJobId parameter is invalid, The Value of Input Parameter %s is not valid is returned for ErrMessage and DtsJobId is returned for DynamicMessage.

Examples

Sample requests

http(s)://dts.aliyuncs.com/?Action=CreateJobMonitorRule
&DtsJobId=i03e3zty16i****
&Type=delay
&State=Y
&Phone=1361234****,1371234****
&DelayRuleTime=11
&<Common request parameters>

Sample success responses

XML format

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

<CreateJobMonitorRuleResponse>
    <RequestId>8C498360-7892-433C-847A-BA71A850****</RequestId>
    <HttpStatusCode>200</HttpStatusCode>
    <Success>true</Success>
    <DtsJobId>i03e3zty16i****</DtsJobId>
</CreateJobMonitorRuleResponse>

JSON format

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

{
  "RequestId" : "8C498360-7892-433C-847A-BA71A850****",
  "HttpStatusCode" : 200,
  "Success" : true,
  "DtsJobId" : "i03e3zty16i****"
}

Error codes

HTTP status codeError codeError messageDescription
400Throttling.UserRequest was denied due to user flow control.The error message returned because the number of requests reaches the threshold, and the request is rejected. Try again later.
500ServiceUnavailableThe request has failed due to a temporary failure of the server.The error message returned because the response of the server timed out or the server was unavailable. Try again. If the error persists, contact technical support.
403InvalidSecurityToken.ExpiredSpecified SecurityToken is expired.The error message returned because the signature expired. Use a new signature.

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