Creates a ticket for deleting historical data.

For more information about the History Data Clean feature, see Historical data cleaning.

This operation can be used only for MySQL databases.


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
Comment String Yes test

The purpose or objective of the data change. This reduces unnecessary communication.

RelatedUserList Array of Long No 243253

The stakeholders of this operation. All stakeholders can view the ticket details and assist in the approval process. Irrelevant users other than Data Management (DMS) administrators and database administrators (DBAs) are not allowed to view the ticket details.

Param Object Yes

The parameters of the ticket.

Classify String No test

The reason for the data change.

DbItemList Array Yes

The databases that you want to change data.

DbId Long Yes 1234

The ID of the database. You can call the SearchDatabases operation to query the ID of the database.

Logic Boolean Yes false

Specifies whether the database is a logical database. Valid values:

  • true: yes
  • false: no
CronFormat String Yes 0 0 2 * * ?

The crontab expression that you can use to run the task at a specified time. For more information, see Crontab expression.

CronClearItemList Array Yes

The tables that you want to delete data.

TableName String Yes t1

The name of the table. You can call the ListTables operation to query the name of the table.

ColumnName String Yes gmt_create

The name of the field.

RemainDays Long Yes 7

The retention period of the field values. Unit: days.


The type of time granularity. If the ColumnName parameter specifies a field of a time type, this parameter is required. Valid values:

  • MILLISECONDS: milliseconds
  • SECONDS: seconds
FilterSQL String No where 1 = 1

The filter conditions.

specifyDuration Boolean Yes true

Specifies whether to specify the duration of the task. Valid values:

  • true: specifies the duration of the task.
  • false: does not specify the duration of the task.
DurationHour Long No 4

The duration of the task. Unit: hours.

Note If the specifyDuration parameter is set to true, this parameter is required.
AttachmentKey String No order_attachement.txt

The key of the attachment for the ticket. The attachment provides more instructions for this operation.

You can call the GetUserUploadFileJob operation to query the key of the attachment.

Tid Long No 123454324

The ID of the tenant.

Note The ID of the tenant is displayed when you move the pointer over the profile picture in the upper-right corner of the DMS console. For more information, see Tenant information.
RegionId String No cn-hangzhou

The ID of the region where the DMS service resides. For more information about the valid values of this parameter, see RegionID parameter.

Note Set this parameter to the ID of the region that is close to your services.

Response parameters

Parameter Type Example Description
RequestId String 0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

ErrorMessage String UnknownError

The error message that is returned.

ErrorCode String UnknownError

The error code that is returned.

CreateOrderResult Array of Long 1341532

The ID of the ticket.


Sample requests

&Param={"Classify":"test","DbItemList":[{"DbId":1234,"Logic":false}],"CronFormat":"0 0 2 * * ?","CronClearItemList":[{"TableName":"t1","ColumnName":"gmt_create","RemainDays":7,"TimeUnit":"MILLISECONDS","FilterSQL":"where 1 = 1"}],"specifyDuration":true,"DurationHour":4}
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK


JSON format

HTTP/1.1 200 OK

  "RequestId" : "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "Success" : true,
  "CreateOrderResult" : [ 1341532 ]

Error codes

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