You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Managing tasks
DescribeTasks
Copy page
Download PDF
DescribeTasks

Call the DescribeTasks API to query tasks.

Request type

Synchronous request.

Request parameters

Name
Type
Required
Example
Description
PageNumber
Integer
Yes
1
The current page number. The minimum value is 1. The default value is 1.
PageSize
Integer
Yes
10
The number of records per page. The minimum value is 1, and the maximum value cannot exceed 1000. The default value is 10.
InstanceId
String
No
mysql-d4942fd7****
Instance ID.
CreationStartTime
String
No
2024-01-29T15:59:59Z

The start time of the task. The time format is yyyy-MM-ddTHH:mm:ssZ (UTC time).

tip

  • Either the task time (CreationStartTime and CreationEndTime) or TaskId must be specified.
  • The maximum time interval between the task start time (CreationStartTime) and task end time (CreationEndTime) cannot exceed 7 days.
CreationEndTime
String
No
2024-01-27T16:00:00Z

The end time of the task. The time format is yyyy-MM-ddTHH:mm:ssZ (UTC time).

tip

  • Either the task time (CreationStartTime and CreationEndTime) or TaskId must be specified.
  • The maximum time interval between the task start time (CreationStartTime) and task end time (CreationEndTime) cannot exceed 7 days.
TaskId
String
No
2024012922384660DE49D5E35F6015****-b248b3

Task ID.

tip

Either TaskId or the task time (CreationStartTime and CreationEndTime) must be specified.

TaskAction
String
No
DeleteDatabase
Task name.
ProjectName
String
No
default
Project name.
TaskType
String
No
Web

Task type. Values:

  • Web: Console request.
  • OpenAPI: OpenAPI request.
  • AssumeRole: Role-playing request.
  • Other: Other requests.
TaskSource
String
No
User

Task source. Values:

  • User: Tenant.
  • System: System.
  • SystemUser: Internal operation and maintenance.
  • UserMaintain: Maintenance operations initiated by the system/operation and maintenance administrator and visible to the tenant.
TaskStatus
String[]
No
["Running"]

Task status. The possible values are as follows (multiple selections allowed):

  • WaitSwitch: Waiting for switchover
  • WaitStart: Waiting to execute
  • Canceled: Canceled
  • Stopped: Stopped
  • Running_BeforeSwitch: Running (before switchover)
  • Timeout: Execution timeout
  • Success: Execution succeeded
  • Failed: Execution failed
  • Running: Running
  • Stopping: Stopping
TaskCategory
String[]
No
["BackupRecoveryManagement"]

Task category. The possible values are as follows (multiple selections allowed):

  • BackupRecoveryManagement: Backup and recovery management.
  • DatabaseAdminManagement: Database administration.
  • DatabaseProxy: Database proxy.
  • HighAvailability: High availability.
  • InstanceAttribute: Instance attributes.
  • InstanceManagement: Instance management.
  • NetworkManagement: Network management.
  • SecurityManagement: Security management.
  • SystemMaintainManagement: System maintenance management.
  • VersionUpgrade: Version upgrade.

Response parameters

Name
Type
Example
Description
Total
Integer
1
Number of tasks.
Datas
Object[]
Refer to the response example.
Task information.
CostTimeMS
Long
3391
Task duration in milliseconds.
CreateTime
String
2024-01-29T13:13:49.955Z
Task creation time.
FinishTime
String
2024-01-29T12:38:29.116Z
Task completion time.
Progress
Integer
45

Task progress in percentage.

tip

Only tasks with a status of Running, i.e., tasks where TaskStatus is Running, will return the task progress.

RelatedInstanceInfos
Object
{ "InstanceID": "mysql-5bde124c****" }
Task-related instances.
InstanceID
String
mysql-d4942fd7****
Instance ID.
ScheduledExecuteEndTime
String
2024-12-20T17:59:00Z

Planned start deadline in the format yyyy-MM-ddTHH:mm:ssZ (UTC time).

tip

Only tasks in the "Waiting to start", "Waiting to execute", or "Waiting for switchover" status will return this field.

ScheduledExecuteStartTime
String
2024-12-20T16:00:00Z

Planned start time in the format yyyy-MM-ddTHH:mm:ssZ (UTC time).

tip

Only tasks in the "Waiting to start", "Waiting to execute", or "Waiting for switchover" status will return this field.

ScheduledSwitchEndTime
String
2024-12-20T17:59:00Z

Planned switchover deadline in the format yyyy-MM-ddTHH:mm:ssZ (UTC time).

tip

Only tasks in the "Waiting to start", "Waiting to execute", or "Waiting for switchover" status will return this field.

ScheduledSwitchStartTime
String
2024-12-20T16:00:00Z

Planned switchover start time in the format yyyy-MM-ddTHH:mm:ssZ (UTC time).

tip

Only tasks in the "Waiting to start", "Waiting to execute", or "Waiting for switchover" status will return this field.

StartTime
String
2024-01-29T12:38:25.725Z
Task start time in the format yyyy-MM-ddTHH:mm:ssZ (UTC time).
TaskAction
String
CreateDBAccount
Task name.
TaskCategory
String
BackupRecoveryManagement

Task category, possible values:

  • BackupRecoveryManagement: Backup and recovery management.
  • DatabaseAdminManagement: Database administration management.
  • DatabaseProxy: Database proxy.
  • HighAvailability: High availability.
  • InstanceAttribute: Instance attributes.
  • InstanceManagement: Instance management.
  • MonitoringPerformance: Monitoring and performance.
  • NetworkManagement: Network management.
  • SecurityManagement: Security management.
  • SystemMaintainManagement: System maintenance management.
  • VersionUpgrade: Version upgrade.
TaskDesc
String
This is a task description.
Task description.
TaskId
String
202401221959431F6913166F6F5A21****-682d5d
Task ID.
TaskParams
String
{"InstanceId":"mysql-4233a4ba****","AccountName":"TestAccount","AccountPassword":"******","AccountType":"Normal","AccountDesc":""}
Task parameters.
TaskSource
String
User

Source of the task. Values:

  • User: Tenant.
  • System: System.
  • SystemUser: Internal operation and maintenance.
  • UserMaintain: Maintenance operations initiated by the system/operation and maintenance administrator and visible to the tenant.
TaskStatus
String
Success

Task status, possible values:

  • WaitSwitch: Waiting for switchover.
  • WaitStart: Waiting to start.
  • Canceled: Canceled.
  • Stopped: Stopped.
  • Running_BeforeSwitch: Running (before switchover).
  • Timeout: Execution timeout.
  • Success: Execution succeeded.
  • Failed: Execution failed.
  • Running: Running.
  • Stopping: Stopping.
TaskProgress
Object[]
[ { "Name": "InstanceInitialization", "StepStatus": "Success" }, { "Name": "InstanceRecoveryPreparation", "StepStatus": "Failed" }, { "Name": "DataBackupImport", "StepStatus": "UnExecuted" }, { "Name": "LogBackupBinlogAdd", "StepStatus": "UnExecuted" }, { "Name": "TaskSuccessful", "StepStatus": "UnExecuted" } ]
Progress details.
Name
String
InstanceInitialization

Step Name. Value:

  • InstanceInitialization: Task initialization.
  • InstanceRecoveryPreparation: Instance recovery preparation.
  • DataBackupImport: Cold backup import.
  • LogBackupBinlogAdd: Binlog replay.
  • TaskSuccessful: Task succeeded.
StepStatus
String
Success

Status of the step. Values:

  • Running: In progress.
  • Success: Succeeded.
  • Failed: Failed.
  • Unexecuted: Not executed.
StepExtraInfo
Object[]
[ { "Type": "CurDataSize", "Unit": "Bytes", "Value": 7579256 }, { "Type": "RemainDataSize", "Unit": "Bytes", "Value": 0 } ]
The specific information of the steps.
Type
String
CurDataSize

Current stage

  • CostTime: The time consumption of the current stage.
  • CurDataSize: The amount of data imported currently.
  • CurBinlog: The number of Binlog files being replayed currently.
  • RemainCostTime: The remaining time consumption.
  • RemainDataSize: The remaining amount of data to be imported.
  • RemainBinlog: The remaining number of Binlog files to be replayed.
Unit
String
Bytes

Unit. Values:

  • MS: milliseconds.
  • Bytes: bytes.
  • Files: number of (files).
Value
Double
7579256
The specific value corresponding to the Type field.

Sample request 1

Query tasks created within a specified time period using CreationStartTime and CreationEndTime.

POST /?Action=DescribeTasks&Version=2022-01-01 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: rds-mysql.cn-beijing.volcengineapi.com
X-Date: 20211202T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "CreationEndTime": "2024-12-19T21:40:00Z",
    "CreationStartTime": "2024-12-19T21:30:00Z",
    "PageNumber": 1,
    "PageSize": 100
}

Sample response 1

{
    "ResponseMetadata": {
        "RequestId": "202412201138271482F328AD8C800E91A0-aceec9",
        "Action": "DescribeTasks",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": {
        "Datas": [
            {
                "CostTimeMS": 5132,
                "CreateTime": "2024-12-19T21:37:51.899Z",
                "FinishTime": "2024-12-19T21:37:57.031Z",
                "RelatedInstanceInfos": {
                    "InstanceID": "mysql-35444107e157"
                },
                "StartTime": "2024-12-19T21:37:51.899Z",
                "TaskAction": "CreateBackup",
                "TaskCategory": "BackupRecoveryManagement",
                "TaskDesc": "",
                "TaskId": "f5ecd0a0056e45e4bf9dde48211f4347",
                "TaskParams": "{\"InstanceId\":\"mysql-35444107e157\",\"BackupStrategy\":\"Instance\",\"BackupType\":\"Physical\",\"BackupMode\":\"Full\",\"BackupDataType\":\"Data\"}",
                "TaskReason": "DeleteDBInstance",
                "TaskSource": "User",
                "TaskStatus": "Success"
            },
            {
                "CostTimeMS": 26,
                "CreateTime": "2024-12-19T21:35:05.967Z",
                "FinishTime": "2024-12-19T21:35:05.993Z",
                "RelatedInstanceInfos": {
                    "InstanceID": "mysql-04af6e86****"
                },
                "StartTime": "2024-12-19T21:35:05.967Z",
                "TaskAction": "CreateDatabase",
                "TaskCategory": "DatabaseAdminManagement",
                "TaskDesc": "",
                "TaskId": "20241220053505D87B1953D97A39D9628A-6f2884",
                "TaskParams": "{\"InstanceId\":\"mysql-04af6e86****\",\"DBName\":\"io_observe995\",\"CharacterSetName\":\"utf8\",\"DBDesc\":\"\"}",
                "TaskReason": "User operation",
                "TaskSource": "User",
                "TaskStatus": "Success"
            },
            {
                "CostTimeMS": 180971,
                "CreateTime": "2024-12-19T21:31:45.167Z",
                "FinishTime": "2024-12-19T21:34:46.138Z",
                "RelatedInstanceInfos": {
                    "InstanceID": "mysql-5cd320d04a98"
                },
                "StartTime": "2024-12-19T21:31:45.167Z",
                "TaskAction": "CreateDBInstance",
                "TaskCategory": "InstanceManagement",
                "TaskDesc": "",
                "TaskId": "20241220053143A7560C55222B0AE868F5-891415",
                "TaskParams": "{\"DBEngineVersion\":\"MySQL_8_0\",\"InstanceType\":\"HA\",\"ZoneId\":\"\",\"NodeSpec\":\"\",\"NodeNumber\":0,\"NodeInfo\":[{\"ZoneId\":\"cn-beijing-a\",\"NodeType\":\"Primary\",\"NodeSpec\":\"rds.mysql.1c2g\",\"NodeOperateType\":\"Create\"},{\"ZoneId\":\"cn-beijing-a\",\"NodeType\":\"Secondary\",\"NodeSpec\":\"rds.mysql.1c2g\",\"NodeOperateType\":\"Create\"}],\"StorageType\":\"LocalSSD\",\"StorageSpace\":100,\"VpcId\":\"vpc-2ze1hcaoxk5c0610wgmc5****\",\"InstanceName\":\"测试实例3\",\"SuperAccountName\":\"rootgg\",\"SuperAccountPassword\":\"******\",\"LowerCaseTableNames\":\"1\",\"DBTimeZone\":\"UTC +08:00\",\"DBParamGroupId\":\"\",\"ChargeInfo\":{\"ChargeType\":\"PostPaid\",\"Number\":1},\"ProjectName\":\"default\",\"ShardNumber\":2,\"SubnetId\":\"subnet-257k5dxe6s5j44a7cffnk****\",\"Port\":3306}",
                "TaskReason": "User operation",
                "TaskSource": "User",
                "TaskStatus": "Success"
            }
        ],
        "Total": 3
    }
}

Sample request 2

Query the details of a specified task by TaskId.

POST /?Action=DescribeTasks&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host: rds-mysql.cn-beijing.volcengineapi.com
X-Date: 20211202T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "TaskId": "20241219213431ABD2ADEE7A33D166****-dac037",
    "PageNumber": 1,
    "PageSize": 100
}

Sample response 2

{
    "ResponseMetadata": {
        "RequestId": "20241224141230E7B854577D989BBDE2A3-9131d9",
        "Action": "DescribeTasks",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": {
        "Datas": [
            {
                "CostTimeMS": 5080,
                "CreateTime": "2024-12-19T21:38:00.911Z",
                "FinishTime": "2024-12-19T21:38:05.991Z",
                "RelatedInstanceInfos": {
                    "InstanceID": "mysql-9d90c967****"
                },
                "StartTime": "2024-12-19T21:38:00.911Z",
                "TaskAction": "CreateBackup",
                "TaskCategory": "BackupRecoveryManagement",
                "TaskDesc": "",
                "TaskId": "61fc851b46724ff09b3236ed24d74fb0",
                "TaskParams": "{\"InstanceId\":\"mysql-9d90c967****\",\"BackupStrategy\":\"Instance\",\"BackupType\":\"Physical\",\"BackupMode\":\"Full\",\"BackupDataType\":\"Data\"}",
                "TaskReason": "DeleteDBInstance",
                "TaskSource": "User",
                "TaskStatus": "Success"
            }
        ],
        "Total": 1
    }
}

Error codes

For more details, refer to Error codes.

Last updated: 2025.07.07 15:52:02