All Products
Search
Document Center

PolarDB:DescribeTasks

Last Updated:Jun 17, 2024

Queries the status of the tasks that are generated based on API operations, such as the status of instance creation tasks.

Operation description

  • 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.

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
polardb:DescribeTasksRead
  • dbcluster
    acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringNo

The cluster ID.

Note You must specify DBNodeId or DBClusterId. You can call the DescribeDBClusters operation to query the details of the clusters that belong to your Alibaba Cloud account, such as cluster IDs.
pc-***************
DBNodeIdstringNo

The node ID.

Note You must specify DBNodeId or DBClusterId. You can call the DescribeDBClusters operation to query the details of the clusters that belong to your Alibaba Cloud account, such as node IDs.
pi-***************
StartTimestringYes

The beginning 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.

2020-11-30T00:00Z
EndTimestringYes

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.

2020-12-02T03:00Z
StatusstringNo

The state of the tasks that you want to query. 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 suspended.
  • 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.

  • You can enter multiple task states. Separate multiple task states with commas (,).

Running
PageSizeintegerNo

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

Default value: 30.

30
PageNumberintegerNo

The page number of the page to return. The value is an integer that is greater than 0.

Default value: 1.

1

Response parameters

ParameterTypeDescriptionExample
object
TotalRecordCountinteger

The total number of entries returned.

1
PageRecordCountinteger

The number of entries returned per page.

30
Tasksobject []

The details of the task.

FinishTimestring

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.

2020-12-02T02:40:15Z
StepsInfostring

The details of the subtasks.

[{\"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}]
Progressinteger

The progress of the task in percentage.

100
ExpectedFinishTimestring

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

null
BeginTimestring

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.

2020-12-02T02:39:15Z
TaskErrorCodestring

The error code that is returned when an error occurs.

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

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

null
CurrentStepNamestring

The name of the current step.

create_instance
StepProgressInfostring

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

1/4
TaskErrorMessagestring

The error message that is returned when an error occurs.

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

The API operation that is used by the task. Example: CreateDBInstance.

CreateDBInstance
DBNamestring

The database name.

Note This parameter is returned for only the tasks that involve database operations.
test
Remaininteger

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

1767
TaskIdstring

The ID of the task.

111111111
EndTimestring

The end time of the query.

2020-12-02T03:00Z
RequestIdstring

The request ID.

4352AD99-9FF5-41A6-A319-068089******
PageNumberinteger

The page number of the page returned.

1
StartTimestring

The start time of the query.

2020-11-30T00:00Z
DBClusterIdstring

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

pc-***************

Examples

Sample success responses

JSONformat

{
  "TotalRecordCount": 1,
  "PageRecordCount": 30,
  "Tasks": {
    "Task": [
      {
        "FinishTime": "2020-12-02T02:40:15Z",
        "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}]",
        "Progress": 100,
        "ExpectedFinishTime": "null",
        "BeginTime": "2020-12-02T02:39:15Z",
        "TaskErrorCode": "null",
        "ProgressInfo": "null",
        "CurrentStepName": "create_instance",
        "StepProgressInfo": "1/4",
        "TaskErrorMessage": "null",
        "TaskAction": "CreateDBInstance",
        "DBName": "test",
        "Remain": 1767,
        "TaskId": "111111111"
      }
    ]
  },
  "EndTime": "2020-12-02T03:00Z",
  "RequestId": "4352AD99-9FF5-41A6-A319-068089******",
  "PageNumber": 1,
  "StartTime": "2020-11-30T00:00Z",
  "DBClusterId": "pc-***************"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2023-09-12The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 400