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 state change 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

Parameter Type Required Example Description
Action String Yes CreateJobMonitorRule

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

DtsJobId String Yes i03e3zty16i****

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

Type String No delay

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.

State String No Y

Specifies whether to enable the alert rule. Valid values:

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

Default value: Y.

Phone String No 1361234****,1371234****

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

Note
  • This parameter is available only for China site (aliyun.com) users. Only mobile numbers in the Chinese mainland are supported. Up to 10 mobile numbers can be specified.
  • International site (alibabacloud.com) users cannot receive alerts by using mobile phones, but can set alert rules for DTS tasks in the CloudMonitor console.
DelayRuleTime Long No 11

The threshold for triggering latency alerts.

  • If Type is set to delay, this parameter value 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 Type is set to full_timeout, this parameter value must be an integer. Unit: hours.
Note This parameter is required if Type is set to delay or full_timeout and State is set to Y.
RegionId String No cn-hangzhou

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

Response parameters

Parameter Type Example Description
Code String 200

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

DtsJobId String i03e3zty16i****

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

DynamicMessage String DtsJobId

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

Note 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.
ErrCode String 403

The error code returned if the call failed.

ErrMessage String The Value of Input Parameter %s is not valid.

The error message returned if the call failed.

HttpStatusCode Integer 200

The HTTP status code.

RequestId String 8C498360-7892-433C-847A-BA71A850****

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.

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

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

JSON format

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

Error codes

For a list of error codes, visit the API Error Center.