All Products
Search
Document Center

PolarDB:DescribeScheduleTasks

最終更新日:Oct 23, 2024

Queries the details of all scheduled tasks.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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

Request parameters

ParameterTypeRequiredDescriptionExample
StatusstringNo

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.
finish
DBClusterIdstringNo

The cluster ID.

Note
  • You can call the DescribeDBClusters operation to query the information of all PolarDB clusters that are deployed in a specific region, such as the cluster IDs.

  • If you do not specify this parameter, all scheduled tasks on your clusters are queried.

pc-**************
RegionIdstringNo

The ID of the region.

Note
  • You can call the DescribeRegions operation to query the region information of all clusters in a specific account.

  • If you do not specify this parameter, scheduled tasks on your clusters that are deployed in all regions are queried.

cn-hangzhou
PageNumberintegerNo

The page number of the page to return. Set this parameter to an integer that is greater than 0. Default value: 1.

1
PageSizeintegerNo

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

30
TaskActionstringNo

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

  • CreateDBNodes
  • ModifyDBNodeClass
  • UpgradeDBClusterVersion
  • ModifyDBClusterPrimaryZone
Note
  • If you specify the PlannedStartTime parameter when you call the four preceding operations, 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 on you clusters are queried.

CreateDBNodes
DBClusterDescriptionstringNo

The description of the cluster.

testdb
OrderIdstringNo

The ID of the order.

Note The order ID can contain only digits.
20951253014****
PlannedStartTimestringNo

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

2021-01-28T12:00Z
PlannedEndTimestringNo

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

2021-01-28T12:30Z
ResourceGroupIdstringNo

The ID of the resource group.

rg-************

Response parameters

ParameterTypeDescriptionExample
object
Dataobject

The result data.

PageNumberinteger

The page number of the page returned.

1
PageSizeinteger

The number of entries returned per page.

30
TimerInfosarray<object>

The details of the scheduled tasks.

timerInfosobject
Actionstring

The type of the scheduled tasks.

CreateDBNodes
CrontabJobIdstring

The ID of the scheduled task.

86293c29-a03d-4872-b625-***********
DBClusterIdstring

The cluster ID.

pc-**************
DbClusterDescriptionstring

The description of the cluster.

test_cluster
DbClusterStatusstring

The state of the cluster.

Running
OrderIdstring

The ID of the order.

Note This parameter is returned only when you set the Action parameter to CreateDBNodes or ModifyDBNodeClass.
208161753******
PlannedEndTimestring

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

2021-01-28T12:30Z
PlannedStartTimestring

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

2021-01-28T12:00Z
PlannedTimestring

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

2021-01-28T12:16Z
Regionstring

The ID of the region in which the scheduled task runs.

cn-hangzhou
Statusstring

The state of the scheduled task.

finish
TaskCancelboolean

Indicates whether the scheduled task can be canceled. Valid values:

  • true
  • false
true
TaskIdstring

The ID of the task.

53879cdb-9a00-428e-acaf-ff4cff******
TotalRecordCountinteger

The total number of entries returned.

1
Messagestring

The message that is returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.
Successful
RequestIdstring

The request ID.

936C7025-27A5-4CB1-BB31-540E1F0CCA12
Successboolean

Indicates whether the request is successful.

true

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidOrderId.MalformedThe specified parameter OrderId is not valid.The specified order ID is invalid.

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

Change history

Change timeSummary of changesOperation
2024-08-29The Error code has changed. The response structure of the API has changedView Change Details
2023-09-12The Error code has changedView Change Details