All Products
Search
Document Center

Data Management:CreateDataCronClearOrder

Last Updated:Oct 21, 2024

Creates a ticket for clearing historical data.

Operation description

For more information about the historical data cleaning, see Clear historical data.

This operation can be used only for MySQL databases.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
CommentstringYes

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

test
RelatedUserListarrayNo

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.

longNo
243253
ParamobjectYes

The parameters of the ticket.

ClassifystringNo

The reason for the data change.

test
DbItemListarray<object>Yes

The databases for which you want to clear historical data.

objectNo
DbIdlongYes

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

1234
LogicbooleanYes

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
CronFormatstringYes

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

0 0 2 * * ?
CronClearItemListarray<object>Yes

The tables for which you want to clear historical data.

objectNo
TableNamestringYes

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

t1
ColumnNamestringYes

The name of the field.

gmt_create
RemainDayslongYes

The retention period of the historical data. Unit: days. For example, if you set the parameter to 7, DMS deletes the data that is retained for more than seven days.

7
TimeUnitstringNo

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
MILLISECONDS
FilterSQLstringNo

The filter conditions.

where 1 = 1
specifyDurationbooleanYes

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

  • true: specifies an end time for the task. The task is automatically suspended after this end time.
  • false: does not specify an end time for the task. The task is stopped after the historical data is cleared.
true
DurationHourlongNo

The amount of time taken to run the task. Unit: hours.

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

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.

order_attachement.txt
TidlongNo

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 parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

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

Indicates whether the request is successful.

true
ErrorMessagestring

The error message.

UnknownError
ErrorCodestring

The error code.

UnknownError
CreateOrderResultarray

The ID of the ticket.

OrderIdslong
1341532

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history