All Products
Search
Document Center

Data Management:CreateDataCronClearOrder

Last Updated:Aug 28, 2026

Creates a ticket for scheduled historical data cleanup.

Operation description

Only MySQL instances in Security Collaboration control mode are supported.

For more information about this feature, see Historical Data Cleanup.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:CreateDataCronClearOrder

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Comment

string

Yes

The purpose of the data change. A clear description helps reduce unnecessary communication.

test

RelatedUserList

array

No

The stakeholders of this operation. Stakeholders can view the ticket details and assist in the approval process. Other users, except DMS administrators and DBAs, cannot view the ticket.

integer

No

The user ID of a stakeholder. Stakeholders can view and collaborate on the ticket. Other users, except administrators and DBAs, cannot view it.

243253

Param

object

Yes

The parameters of the ticket.

Classify

string

No

The reason for the data change.

test

DbItemList

array<object>

Yes

The databases for which you want to clear historical data.

object

No

Database information.

DbId

integer

Yes

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

10****

Logic

boolean

Yes

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

  • true: The database is a logical database.

  • false: The database is not a logical database.

false

CronFormat

string

Yes

The crontab expression for scheduling the task. For more information, see Crontab expression.

0 0 2 * * ?

CronClearItemList

array<object>

Yes

The tables for which you want to clear historical data.

object

No

Information about the data tables to be cleaned.

TableName

string

Yes

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

t1

ColumnName

string

Yes

The name of the column.

gmt_create

RemainDays

integer

Yes

The retention period of the historical data. Unit: days. For example, a value of 7 means DMS deletes data older than seven days.

7

TimeUnit

string

No

The time granularity. Required when ColumnName specifies a time-type column. Valid values:

  • MILLISECONDS: milliseconds

  • SECONDS: seconds

MILLISECONDS

FilterSQL

string

No

The filter conditions.

where 1 = 1

specifyDuration

boolean

Yes

Specifies whether to set an end time for the task. Valid values:

  • true: sets an end time. The task is automatically suspended after this end time.

  • false: does not set an end time. The task stops after the historical data is cleared.

true

DurationHour

integer

No

The maximum duration for running the task. Unit: hours.

Note

If the specifyDuration parameter is set to true, this parameter is required.

4

AttachmentKey

string

No

The attachment key for the ticket. The attachment provides additional instructions for this operation.

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

order_attachement.txt

Tid

integer

No

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 the View information about the current tenant section of the Manage DMS tenants topic.

123454324

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

Success

boolean

Indicates whether the request was successful.

true

ErrorMessage

string

The error message.

UnknownError

ErrorCode

string

The error code.

UnknownError

CreateOrderResult

array

The ID of the ticket.

integer

Ticket ID.

1341532

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.