All Products
Search
Document Center

Data Management:CreateDataCronClearOrder

Last Updated:Apr 18, 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:CreateDataCronClearOrderRead
  • All Resources
    *
    none
none

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
DbItemListobject []Yes

The databases for which you want to clear historical data.

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 * * ?
CronClearItemListobject []Yes

The tables for which you want to clear historical data.

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.

long
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