Queries information about all or specified scheduled tasks that you can access.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. 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 Yes DescribeScheduleTasks

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

Status String No finish

The state of the tasks that you want to query. Valid values:

  • pending: The tasks are pending execution.
  • executing: The tasks are being executed.
  • failure: The tasks failed and need to be run again.
  • finish: The tasks are complete.
  • cancel: The tasks are canceled.
  • expired: The tasks are expired. The tasks are not started within the time periods that are specified to start the tasks.
  • rollback: The tasks are being rolled back.
Note If you do not specify this parameter, all scheduled tasks in all states are queried.
DBClusterId String No pc-**************

The ID of the cluster on which the scheduled task you want to query runs.

Note
  • You can call the DescribeDBClusters operation to query information about all your PolarDB clusters that are deployed in a specified region. The returned information includes the ID of each cluster.
  • If you do not specify this parameter, all scheduled tasks that you can access are queried.
RegionId String No cn-hangzhou

The ID of the region.

Note
  • You can call the DescribeRegions operation to query information about regions that PolarDB supports.
  • If you do not specify this parameter, scheduled tasks on your clusters that are deployed in all regions are queried.
PageNumber Integer No 1

The number of the page to return. The value must be a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1.

PageSize Integer No 30

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

TaskAction String No CreateDBNodes

The type of the scheduled tasks that you want to query. Valid values:

  • CreateDBNodes
  • ModifyDBNodeClass
  • UpgradeDBClusterVersion
  • ModifyDBClusterPrimaryZone
Note
  • If you specify the PlannedStartTime parameter when you create the tasks, the details of each task are returned. Otherwise, an empty string is returned for the TimerInfos parameter.
  • If you do not specify this parameter, all types of scheduled tasks that you can access are queried.
DBClusterDescription String No testdb

The description of the cluster on which the scheduled task you want to query runs.

OrderId String No 20951253014****

The ID of the order that is generated when you create the scheduled task.

Note The order ID can contain only digits.

Response parameters

Parameter Type Example Description
Message String Successful

The returned message that indicates the result of the request.

Note If the request is successful, Successful is returned. If the request fails, an error message that includes an error code is returned.
Data Object

The result data that is returned.

TimerInfos Array of timerInfos

The details of the scheduled task.

Status String finish

The state of the scheduled task.

Action String CreateDBNodes

The type of the scheduled task.

PlannedEndTime String 2021-01-28T12:30Z

The latest start time of the task that you specified when you created the scheduled task. The time is in UTC format.

PlannedTime String 2021-01-28T12:16Z

The expected start time of the task. The time is in UTC format.

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

The ID of the cluster on which the scheduled task runs.

Region String cn-hangzhou

The ID of the region where the scheduled task runs.

PlannedStartTime String 2021-01-28T12:00Z

The earliest start time of the task that you specified when you created the scheduled task. The time is in UTC format.

TaskId String 53879cdb-9a00-428e-acaf-ff4cff******

The ID of the task.

OrderId String 208161753******

The ID of the order that is generated when you create the scheduled task.

Note This parameter is returned only if you set the Action parameter to CreateDBNodes or ModifyDBNodeClass.
DbClusterStatus String Running

The state of the cluster.

DbClusterDescription String test_cluster

The description of the cluster.

TotalRecordCount Integer 1

The total number of returned entries.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 30

The number of entries returned per page.

Success Boolean true

The result of the request.

RequestId String 936C7025-27A5-4CB1-BB31-540E1F0CCA12

The ID of the request.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/?Action=DescribeScheduleTasks
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeScheduleTasksResponse>
    <Message>Successful</Message>
    <Data>
        <TimerInfos>
            <Status>finish</Status>
            <Action>CreateDBNodes</Action>
            <PlannedEndTime>2021-01-28T12:30Z</PlannedEndTime>
            <PlannedTime>2021-01-28T12:16Z</PlannedTime>
            <DBClusterId>pc-**************</DBClusterId>
            <Region>cn-hangzhou</Region>
            <PlannedStartTime>2021-01-28T12:00Z</PlannedStartTime>
            <TaskId>53879cdb-9a00-428e-acaf-ff4cff******</TaskId>
            <OrderId>208161753******</OrderId>
            <DbClusterStatus>Running</DbClusterStatus>
            <DbClusterDescription>test_cluster</DbClusterDescription>
        </TimerInfos>
        <TotalRecordCount>1</TotalRecordCount>
        <PageNumber>1</PageNumber>
        <PageSize>30</PageSize>
    </Data>
    <Success>true</Success>
    <RequestId>936C7025-27A5-4CB1-BB31-540E1F0CCA12</RequestId>
</DescribeScheduleTasksResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "Successful",
  "Data" : {
    "TimerInfos" : [ {
      "Status" : "finish",
      "Action" : "CreateDBNodes",
      "PlannedEndTime" : "2021-01-28T12:30Z",
      "PlannedTime" : "2021-01-28T12:16Z",
      "DBClusterId" : "pc-**************",
      "Region" : "cn-hangzhou",
      "PlannedStartTime" : "2021-01-28T12:00Z",
      "TaskId" : "53879cdb-9a00-428e-acaf-ff4cff******",
      "OrderId" : "208161753******",
      "DbClusterStatus" : "Running",
      "DbClusterDescription" : "test_cluster"
    } ],
    "TotalRecordCount" : 1,
    "PageNumber" : 1,
    "PageSize" : 30
  },
  "Success" : true,
  "RequestId" : "936C7025-27A5-4CB1-BB31-540E1F0CCA12"
}

Error codes

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