Creates a monitoring rule for a Data Transmission Service (DTS) task or modifies the monitoring rule.

DTS provides the Delay and Status metrics.

  • Delay: DTS monitors the latency of a data migration, data synchronization, or change tracking task. If the latency of the task exceeds the specified threshold, an alert is triggered. Unit: seconds.
  • Status: DTS monitors the status change of a data migration, data synchronization, or change tracking task. If the status of the task changes to Error or Restore, an alert is triggered.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer automatically 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

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

  • delay: monitors the task based on the Delay metric
  • error: monitors the task based on the Status metric

Default value: error.

State String No Y

Specifies whether to enable the monitoring rule. Valid values:

  • Y: enables the monitoring rule
  • N: disables the monitoring 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 mainland China are supported. Up to 10 mobile numbers can be specified.
  • International site (alibabacloud.com) users cannot receive alert notifications 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. Unit: seconds. The value must be an integer. You can set the threshold based on your business needs. To prevent jitters caused by network and database overloads, we recommend that you set the threshold to more than 10 seconds.

Note If the value of the Type parameter is set to delay and the value of the State parameter is set to Y, you must specify the DelayRuleTime parameter.

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 %s in the ErrMessage parameter.

Note If the return value of the ErrMessage parameter is The Value of Input Parameter %s is not valid and the return value of the DynamicMessage parameter is DtsJobId, the specified DtsJobId parameter is invalid.
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.