You can call the DescribeUpgradeMajorVersionTasks operation to query the tasks that are created to upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.

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 Yes DescribeUpgradeMajorVersionTasks

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

DBInstanceId String Yes pgm-bp1gm3yh0ht1****

The ID of the original instance.

PageSize Integer No 30

The number of entries to return per page.

Valid values: 30 to 100.

Default value: 30.

PageNumber Integer No 1

The number of the page to return.

Valid values: any non-zero positive integer.

Default value: 1.

TargetMajorVersion String No 12.0

The major engine version of the new instance. Valid values:

  • 10.0
  • 11.0
  • 12.0
  • 13.0
  • 14.0
  • 15.0
TaskId Integer No 417450000

A reserved parameter. You do not need to specify this parameter.

Response parameters

Parameter Type Example Description
RequestId String 152E0C6D-B9C3-4468-9F2C-FEF9D9E8417B

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 30

The number of entries returned per page.

TotalRecordCount Integer 1

The total number of returned entries.

Items Array of Tasks

An array that consists of the information about the task that is returned.

TargetMajorVersion String 12.0

The major engine version of the new instance. Valid values:

  • 10.0
  • 11.0
  • 12.0
  • 13.0
  • 14.0
  • 15.0
Result String Success

The status of the task.

  • Success: The task is successful.
  • Failed: The task failed.
  • Running: The task is in the phase in which data is being migrated to a new instance.
EndTime String 1614237779000

The time at which the task ended.

The value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC. Unit: milliseconds.

StartTime String 1614236007000

The time at which the task started.

The value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC. Unit: milliseconds.

SourceMajorVersion String 11.0

The major engine version of the original instance.

UpgradeMode String switch

Indicates whether ApsaraDB RDS migrates data to the new instance and switches your workloads over to the new instance.

Valid values:

  • clone: ApsaraDB RDS does not migrate data to the new instance and does not switch your workloads over to the new instance.
  • switch: ApsaraDB RDS migrates data to the new instance and switches your workloads over to the new instance.
CollectStatMode String After

The time at which ApsaraDB RDS collects the statistics of the new RDS instance.

Valid values:

  • After: ApsaraDB RDS collects the statistics of the new instance after a switchover.
  • Before: ApsaraDB RDS collects the statistics of the new instance before a switchover.
SourceInsName String pgm-bp1i3kkq7321****

The ID of the original instance.

TaskId Integer 342900000

The ID of the task.

TargetInsName String pgm-bp1c0v6d8092****

The ID of the new instance.

SwitchTime String 1614237539000

The time at which your workloads are switched over from the original instance to the new instance.

The value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC. Unit: milliseconds.

Detail String 2021-10-27 15:03:05 --- do upgrade precheck on slave succcess.\n2021-10-27 15:03:11 --- begin to upgrade major version, source instance will locked in readonly mode.\n2021-10-27 15:03:21 --- upgrade master success.\n2021-10-27 15:06:10 --- exchange source and target instance dns success.\n

The details of the task.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=DescribeUpgradeMajorVersionTasks
&DBInstanceId=pgm-bp1gm3yh0ht1****
&<Common request parameters>

Sample success responses

XML format

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

<DescribeUpgradeMajorVersionTasks>
    <TotalRecordCount>1</TotalRecordCount>
    <PageRecordCount>30</PageRecordCount>
    <RequestId>152E0C6D-B9C3-4468-9F2C-FEF9D9E8417B</RequestId>
    <PageNumber>1</PageNumber>
    <Items>
        <SourceInsName>pgm-bp1i3kkq7321****</SourceInsName>
        <SourceMajorVersion>11.0</SourceMajorVersion>
        <TaskId>342900000</TaskId>
        <CollectStatMode/>
        <EndTime>1614237779000</EndTime>
        <TargetMajorVersion>12.0</TargetMajorVersion>
        <TargetInsName>pgm-bp1c0v6d8092****</TargetInsName>
        <StartTime>1614236007000</StartTime>
        <UpgradeMode>switch</UpgradeMode>
        <Detail>2021-10-27 15:03:05 --- do upgrade precheck on slave succcess.\n2021-10-27 15:03:11 --- begin to upgrade major version, source instance will locked in readonly mode.\n2021-10-27 15:03:21 --- upgrade master success.\n2021-10-27 15:06:10 --- exchange source and target instance dns success.\n</Detail>
        <SwitchTime>1614237539000</SwitchTime>
        <Result>Success</Result>
    </Items>
</DescribeUpgradeMajorVersionTasks>

JSON format

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

{
  "TotalRecordCount" : 1,
  "PageRecordCount" : 30,
  "RequestId" : "152E0C6D-B9C3-4468-9F2C-FEF9D9E8417B",
  "PageNumber" : 1,
  "Items" : {
    "SourceInsName" : "pgm-bp1i3kkq7321****",
    "SourceMajorVersion" : 11.0,
    "TaskId" : 342900000,
    "CollectStatMode" : "",
    "EndTime" : 1614237779000,
    "TargetMajorVersion" : 12.0,
    "TargetInsName" : "pgm-bp1c0v6d8092****",
    "StartTime" : 1614236007000,
    "UpgradeMode" : "switch",
    "Detail" : "2021-10-27 15:03:05 --- do upgrade precheck on slave succcess.\\n2021-10-27 15:03:11 --- begin to upgrade major version, source instance will locked in readonly mode.\\n2021-10-27 15:03:21 --- upgrade master success.\\n2021-10-27 15:06:10 --- exchange source and target instance dns success.\\n",
    "SwitchTime" : 1614237539000,
    "Result" : "Success"
  }
}

Error codes

HTTP status code Error code Error message Description
404 InvalidDBInstanceName.NotFound The database instance does not exist. The error message returned because the name of the instance cannot be found. Verify the instance name and try again.

For a list of error codes, see Service error codes.