Queries all tasks that are performed by an ApsaraDB for Redis instance within a specified period of time.

You can call this operation to query the progress of a task when you perform time-consuming operations. You can also log on to the ApsaraDB for Redis console and click the Tasks icon in the upper-right corner of the Instance Information page to view the progress of the current task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer automatically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeTasks

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

StartTime String Yes 2020-11-20T01:00Z

The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

EndTime String Yes 2020-11-26T01:00Z

The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

Status String Yes 2

The status of the task. Separate multiple values with commas (,). Valid values:

  • 0: The task is pending.
  • 1: The task is running.
  • 2: The task is complete.
  • 4: The task is closed.
  • 7: The task is paused.
  • 8: The task is interrupted.
InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance. You can call the DescribeInstances operation to query instance IDs.

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed. You can call the DescribeRegions operation to query region IDs.

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 number of the page to return. The value must be an integer that is greater than 0 and does not exceed the maximum value of the Integer data type. Default value: 1.

Response parameters

Parameter Type Example Description
Items Array of TaskProgressInfo

The details of the task.

BeginTime String 2020-11-13T06:16:54Z

The beginning time of the task. The time follows the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

CurrentStepName String init_redis

The name of the subtask.

FinishTime String 2020-11-13T06:17:18Z

The end time of the task. The time follows the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Progress Float 100

The progress of the task. Unit: %.

Remain Integer 60

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

Note If the task is not running, this parameter is not returned or the returned value is 0.
Status String 2

The status of the task. Valid values:

  • 0: The task is pending.
  • 1: The task is running.
  • 2: The task is complete.
  • 4: The task is closed.
  • 7: The task is paused.
  • 8: The task is interrupted.
StepProgressInfo String 3/3

The progress of the subtask.

Note If the subtask does not exist, this parameter is not returned.
StepsInfo String [{\"remain\":0,\"name\":\"init_instance\",\"progress\":100},{\"remain\":107,\"name\":\"init_redis\",\"progress\":12.3},{\"remain\":1881,\"name\":\"init_config\",\"progress\":0}]

The information about the subtask in the JSON format. This includes the expected remaining duration (remain), the name of the subtask (name), and the task progress (progress).

Note If the subtask does not exist, this parameter is not returned.
TaskAction String ModifyDBInstanceParameter

The identifier of the task.

TaskId String 32302****

The ID of the task.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 30

The number of entries returned on each page.

RequestId String 608FAEC9-485E-4C65-82DE-2E5B955E****

The ID of the request.

TotalRecordCount Integer 2

The total number of entries.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=DescribeTasks
&StartTime=2020-11-20T01:00Z
&EndTime=2020-11-26T01:00Z
&Status=2
&InstanceId=r-bp1zxszhcgatnx****
&<Common request parameters>

Sample success responses

XML format

<DescribeTasksResponse>
      <TotalRecordCount>1</TotalRecordCount>
      <RequestId>5E064E50-5577-4059-BA11-8DCA20DB****</RequestId>
      <PageSize>30</PageSize>
      <PageNumber>1</PageNumber>
      <Items>
            <Status>2</Status>
            <StepProgressInfo>3/3</StepProgressInfo>
            <Progress>100</Progress>
            <TaskId>326497463</TaskId>
            <Remain>0</Remain>
            <FinishTime>2020-11-25T08:48:00Z</FinishTime>
            <TaskAction>CreateDBInstance</TaskAction>
            <StepsInfo>[{"remain":0,"name":"init_instance","progress":100},{"remain":0,"name":"init_redis","progress":100},{"remain":0,"name":"init_config","progress":100}]</StepsInfo>
            <BeginTime>2020-11-25T08:40:07Z</BeginTime>
      </Items>
</DescribeTasksResponse>

JSON format

{
	"TotalRecordCount": 1,
	"RequestId": "5E064E50-5577-4059-BA11-8DCA20DB****",
	"PageSize": 30,
	"PageNumber": 1,
	"Items": [
		{
			"Status": "2",
			"StepProgressInfo": "3/3",
			"Progress": 100,
			"TaskId": "326497463",
			"Remain": 0,
			"FinishTime": "2020-11-25T08:48:00Z",
			"TaskAction": "CreateDBInstance",
			"StepsInfo": "[{\"remain\":0,\"name\":\"init_instance\",\"progress\":100},{\"remain\":0,\"name\":\"init_redis\",\"progress\":100},{\"remain\":0,\"name\":\"init_config\",\"progress\":100}]",
			"BeginTime": "2020-11-25T08:40:07Z"
		}
	]
}

Error codes

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