Queries further details of the tasks that are generated based on API operations. For example, you can call this operation to view the details of the task when you create a cluster.

  • You can call this operation to view the details of a task that is generated by a specific API operation or in the console. The system calls the specific API operation when you perform an operation in the console. For example, you can view the details of the task when you call the CreateDBCluster operation or create a cluster in the console.
  • You can view the details of tasks that are generated only when you call the CreateDBCluster operation to create a cluster and CreationOption is not set to CreateGdnStandby.

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 No DescribeTasks

The operation that you want to perform. Set the value to DescribeTasks.

EndTime String Yes 2020-12-02T03:00Z

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.

StartTime String Yes 2020-11-30T00:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

DBClusterId String No pc-***************

The ID of the cluster.

Note You must specify DBNodeId or DBClusterId.
DBNodeId String No pi-***************

The ID of the node.

Note You must specify DBNodeId or DBClusterId.
Status String No Running

The status of the task. Valid values:

  • Waiting: The task is pending.
  • Running: The task is running.
  • Finished: The task is completed.
  • Closed: The task is closed.
  • Pause: The task is paused.
  • Stop: The task is interrupted.
Note If you do not specify this parameter, the operation returns the details of only the tasks that are in the Waiting or Running state for the cluster or node.
PageSize Integer No 30

The number of entries to return on each page. Valid values: 30, 50, and 100.

Default value: 30.

PageNumber Integer No 1

The page number. The value must be an integer that is greater that 0.

Default value: 1.

Response parameters

Parameter Type Example Description
DBClusterId String pc-***************

The ID of the cluster for which the task was created.

EndTime String 2020-12-02T03:00Z

The end of the time range for the query.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 30

The number of entries returned per page.

RequestId String 4352AD99-9FF5-41A6-A319-068089******

The ID of the request.

StartTime String 2020-11-30T00:00Z

The beginning of the time range for the query.

Tasks Array of Task

The task details.

Task
BeginTime String 2020-12-02T02:39:15Z

The time when the task was started. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

CurrentStepName String create_instance

The name of the current step.

DBName String test

The name of the database.

Note This parameter is returned for only the tasks that involve database operations.
ExpectedFinishTime String null

The estimated end time. In most cases, this parameter is empty.

FinishTime String 2020-12-02T02:40:15Z

The time when the task was completed. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

Progress Integer 100

The progress of the task in percentage.

ProgressInfo String null

The description about the task progress. If no progress description is provided for the task, this parameter is empty.

Remain Integer 1767

The estimated remaining time of the task. Unit: seconds.

StepProgressInfo String 1/4

The progress of the subtasks. For example, a value of 1/4 indicates that the task consists of four subtasks and the first subtask is in progress.

StepsInfo String [{\"remain\":0,\"name\":\"init_task\",\"progress\":100},{\"remain\":1764,\"name\":\"create_instance\",\"progress\":0},{\"remain\":1,\"name\":\"init_cluster\",\"progress\":0},{\"remain\":2,\"name\":\"create_backup\",\"progress\":0}]

The details of the subtasks.

TaskAction String CreateDBInstance

The API operation that is used by the task, such as CreateDBInstance.

TaskErrorCode String null

The error code that is returned when an error occurs.

Note This parameter is returned only when the task is in the Stop state.
TaskErrorMessage String null

The error message that is returned when an error occurs.

Note This parameter is returned only when the task is in the Stop state.
TaskId String 111111111

The ID of the task.

TotalRecordCount Integer 1

The total number of entries.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/? Action=DescribeTasks
&EndTime=2020-11-30T00:00Z
&StartTime=2020-12-01T10:00Z
&<Common request parameters>

Sample success responses

XML format

<DescribeTasksResponse>
  <TotalRecordCount>1</TotalRecordCount>
  <PageRecordCount>30</PageRecordCount>
  <Tasks>
        <Task>
              <StepProgressInfo>1/4</StepProgressInfo>
              <Progress>25</Progress>
              <TaskId>111111111</TaskId>
              <Remain>1767</Remain>
              <FinishTime>2020-12-02T02:40:15Z</FinishTime>
              <TaskAction>CreateDBInstance</TaskAction>
              <StepsInfo>[{"remain":0,"name":"init_task","progress":100},{"remain":1764,"name":"create_instance","progress":0},{"remain":1,"name":"init_cluster","progress":0},{"remain":2,"name":"create_backup","progress":0}]</StepsInfo>
              <CurrentStepName>create_instance</CurrentStepName>
              <BeginTime>2020-12-02T02:39:15Z</BeginTime>
        </Task>
  </Tasks>
  <RequestId>45CE02A1-1766-42E3-9E5F-24B576******</RequestId>
  <EndTime>2020-12-02T03:00Z</EndTime>
  <PageNumber>1</PageNumber>
  <StartTime>2020-11-30T00:00Z</StartTime>
  <DBClusterId>pc-*****************</DBClusterId>
</DescribeTasksResponse>

JSON format

{
	"TotalRecordCount": 1,
	"PageRecordCount": 30,
	"Tasks": {
		"Task": [
			{
				"StepProgressInfo": "1/4",
				"Progress": 25,
				"TaskId": "111111111",
				"Remain": 1767,
				"FinishTime": "2020-12-02T02:40:15Z",
				"TaskAction": "CreateDBInstance",
				"StepsInfo": "[{\"remain\":0,\"name\":\"init_task\",\"progress\":100},{\"remain\":1764,\"name\":\"create_instance\",\"progress\":0},{\"remain\":1,\"name\":\"init_cluster\",\"progress\":0},{\"remain\":2,\"name\":\"create_backup\",\"progress\":0}]",
				"CurrentStepName": "create_instance",
				"BeginTime": "2020-12-02T02:39:15Z"
			}
		]
	},
	"RequestId": "45CE02A1-1766-42E3-9E5F-24B576******",
	"EndTime": "2020-12-02T03:00Z",
	"PageNumber": 1,
	"StartTime": "2020-11-30T00:00Z",
	"DBClusterId": "pc-*****************"
}

Error codes

For a list of error codes, visit the API Error Center.