Creates a ticket for deleting historical data.

For more instructions on this feature, see Historical data cleansing .

This operation can be used only for MySQL databases.

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 test

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

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

Database ID, callable SearchDatabases Interface acquisition.

Logic Boolean Yes false

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

  • true : Yes
  • false : No
CronFormat String Yes 0 0 2 * * ?

Crontab expression to perform tasks regularly. For more information, see Crontab expression .

CronClearItemList Array Yes

The tables that you want to delete data.

TableName String Yes t1

Table name, you can call ListTables The interface obtains the parameter.

ColumnName String Yes gmt_create

The name of the field.

RemainDays Long Yes 7

Retention duration, that is, the rule of historical data cleansing, in days. For example, if you configure it to 7 days, DMS will delete data from 7 days ago during execution.

TimeUnit String No MILLISECONDS

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

  • MILLISECONDS : ms.
  • 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 execution duration and stops the execution after the specified time is reached.
  • false : does not specify the execution duration until the cleanup is completed.
DurationHour Long No 4

The duration of the task. Unit: hours.

Note When specifyDuration Parameters are 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 GetUserUploadFileJob The interface obtains the parameter.

Tid Long No 123454324

The ID of the tenant.

Note Take the tenant ID information displayed in the upper right corner of the system. For details, see View tenant information .
RegionId String No cn-hangzhou

Select the service region of DMS to call the interface. For the value, see RegionID parameter description .

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.

Examples

Sample requests


     http(s)://dms-enterprise.aliyuncs.com/?Comment=test &RelatedUserList=[243253] &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} &AttachmentKey=order_attachement.txt &Tid=123454324&Public request parameters 
   

Sample success responses

XML format


     HTTP/1.1 200 OK Content-Type:application/xml <CreateDataCronClearOrderResponse> <RequestId>0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931</RequestId> <Success>true</Success> <CreateOrderResult>1341532</CreateOrderResult> </CreateDataCronClearOrderResponse> 
   

JSON format


     HTTP/1.1 200 OK Content-Type:application/json { "RequestId" : "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931", "Success" : true, "CreateOrderResult" : [ 1341532 ] } 
   

Error codes

Visit the Error Center View more error codes.