Queries the tasks that are created to upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.
Operation Description
During an upgrade, ApsaraDB RDS retains the original instance and creates an instance that runs the new major engine version. You are charged for the new instance based on the pay-as-you-go billing method after the instance is created. The new instance does not inherit the discounts that are offered to the original instance. Before you call this operation, make sure that you fully understand the billing methods and pricing of ApsaraDB RDS. You can decide whether to upgrade the major engine version based on your business requirements. For more information, see Billable items, billing methods, and pricing.
Before you upgrade the major engine version, you must call the UpgradeDBInstanceMajorVersionPrecheck operation to perform an upgrade check and then call the DescribeUpgradeMajorVersionPrecheckTask operation to query the upgrade check report. You can call the UpgradeDBInstanceMajorVersion operation only when the check result is Success.
Before you call this operation, make sure that the following requirements are met:
- The original instance runs PostgreSQL 14, PostgreSQL 13, PostgreSQL 12, PostgreSQL 11, PostgreSQL 10, or PostgreSQL 9.4.
- The instance runs RDS High-availability Edition or RDS Basic Edition.
- The instance resides in a virtual private cloud (VPC). If the instance resides in the classic network, you must migrate the instance to a VPC before you call this operation. For more information about how to view or change the network type of an instance, see Change the network type of an ApsaraDB RDS for PostgreSQL instance.
- The instance is not a read-only instance and is not created in a dedicated cluster.
An upgrade causes impacts such as a transient connection that lasts a few minutes. We recommend that you perform an upgrade during off-peak hours. Before you perform an upgrade, we recommend that you read the description in Upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance.
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
rds:UpgradeDBInstanceMajorVersion | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceClass | string | No | The instance type of the new instance. The CPU and memory specifications of the new instance must be higher than or equal to the CPU and memory specifications of the original instance. For example, if the instance type of the original instance is NoteFor more information about instance types in ApsaraDB RDS for PostgreSQL, see Primary ApsaraDB RDS for PostgreSQL instance types. | pg.n2.medium.2c |
DBInstanceStorage | integer | No | The storage capacity of the new instance. Unit: GB Valid values:
NoteIf the original instance uses local disks, you can reduce the storage capacity of the instance when you upgrade the major engine version of the instance. For more information about the minimum available storage capacity, see Upgrade the major engine version of an ApsaraDB RDS for PostgreSQL instance. | 20 |
PayType | string | Yes | The billing method of the new instance. Set the value to Postpaid. NoteFor more information about how to change the billing method of an instance after the upgrade, see Change the billing method of an instance from pay-as-you-go to subscription. | Postpaid |
InstanceNetworkType | string | No | The network type of the new instance. Set the value to VPC. The major engine version upgrade feature is supported only for instances that reside in VPCs. If the original instance resides in the classic network, you must migrate the instance to a VPC before you call this operation. For more information about how to view or change the network type of an instance, see Change the network type of an ApsaraDB RDS for PostgreSQL instance. | VPC |
SwitchTimeMode | string | No | The time at which the system switches your workloads over to the new instance. This parameter is used together with SwitchOver and takes effect only when you set SwitchOver to true. Valid values:
| Immediate |
SwitchTime | string | No | A reserved parameter. You do not need to specify this parameter. | 2021-07-10T13:15:12Z |
SwitchOver | string | No | Specifies whether the system automatically switches your workloads over to the new instance after data is migrated to the new instance. Valid values:
Note
| false |
CollectStatMode | string | No | The time at which the system collects the statistics of the new instance. Valid values:
NoteIf you set SwitchOver to false, the value Before of this parameter specifies that ApsaraDB RDS collects the statistics of the new instance before the new instance starts to process read and write requests, and the value After of this parameter specifies that ApsaraDB RDS collects the statistics of the new instance after the new instance starts to process read and write requests. | After |
TargetMajorVersion | string | No | The major engine version of the new instance. The value of this parameter must be the major engine version on which an upgrade check is performed. NoteYou can call the UpgradeDBInstanceMajorVersionPrecheck operation to perform an upgrade check. | 13.0 |
DBInstanceId | string | No | The ID of the original instance. | pgm-bp1gm3yh0ht1**** |
VPCId | string | No | The ID of the VPC in which the original instance resides. You can call the DescribeDBInstanceAttribute operation to query the VPC ID of the instance. | vpc-bp1opxu1zkhn00gzv**** |
VSwitchId | string | No |
NoteThe vSwitches that you specify must reside in the same zone as the original instance. You can call the DescribeVSwitches operation to query the ID of the vSwitch. | vsw-bp10aqj6o4lclxdrm****,vsw-bp10aqj6o4lclxdrm**** |
PrivateIpAddress | string | No | The internal IP address of the new instance. You do not need to specify this parameter. The system automatically assigns an internal IP address based on the values of the VPCId and vSwitchId parameters. | 172.16.XX.XX |
UsedTime | string | No | A reserved parameter. You do not need to specify this parameter. | 1 |
Period | string | No | A reserved parameter. You do not need to specify this parameter. | Month |
DBInstanceStorageType | string | No | The storage type of the new instance. Valid values:
The major engine version upgrade feature is based on cloud disk snapshots. You can select a storage type based on the following conditions:
| cloud_essd |
ZoneId | string | No | The zone ID of the new instance. You can call the DescribeRegions operation to query the zone ID. You can select a zone that belongs to the region in which the original instance resides. The zone can be different from the zone of the original instance. | cn-hangzhou-h |
ZoneIdSlave1 | string | No | The zone ID of the secondary instance for the new instance. You can specify this parameter only when the original instance runs RDS High-availability Edition. You can select a zone that belongs to the region in which the original instance resides. The zone can be different from the zone of the original instance. You can call the DescribeRegions operation to query the zone ID. | cn-hangzhou-h |
ZoneIdSlave2 | string | No | A reserved parameter. You do not need to specify this parameter. | cn-hangzhou-h |
Response parameters
Examples
Sample success responses
JSON
format
{
"DBInstanceId": "pgm-bp1gm3yh0ht1****",
"RequestId": "006729E5-2A33-5955-89E3-651D3F44EBE6",
"OrderId": "21128667463****",
"TaskId": 416980000
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidUpgradePrecheckResult | The upgrade precheck failed. No successful precheck task found in the past 7 days | The upgrade precheck failed. No successful precheck task is found within the last 7 days. |
400 | TargetEngineVersion.Parameters.NotFound | targetEngineVersion is missing in the request. | The targetEngineVersion is missing in the request. |
400 | InvalidDBInstanceStorageType | The specified DBInstanceStorageType is invalid. | The specified DBInstanceStorageType parameter is invalid. |
400 | InvalidInstanceNetworkType | The specified InstanceNetworkType is invalid. | The specified InstanceNetworkType is invalid. |
400 | InvalidVPCId | The specified VPCId is invalid. | The specified VPCId parameter is invalid. |
400 | InvalidDedicatedHostGroupId | The specified DedicatedHostGroupId is invalid. | The specified DedicatedHostGroupId parameter is invalid. |
400 | InvalidPayType | The specified PayType is invalid. | The specified PayType is invalid. |
400 | InvalidEngineVersion | The specified EngineVersion is invalid. | The specified EngineVersion parameter is invalid. |
400 | InvalidDBInstanceStorage | The specified DBInstanceStorage is invalid. | The specified DBInstanceStorage parameter is invalid. |
400 | InvalidSwitchOver | The specified SwitchOver is invalid. | The specified SwitchOver parameter is invalid. |
400 | PrimaryInstanceWithReadonlyNotSupport | The specified primary instance with the read-only instance does not support the operation. | This operation is not supported for the specified primary instance that has a read-only instance. |
400 | InvalidSwitchTimeMode | The specified SwitchTimeMode is invalid. | The specified SwitchTimeMode parameter is invalid. |
400 | InvalidSwitchTime | The specified SwitchTime is invalid. | The specified SwitchTime parameter is invalid. |
400 | InvalidCollectStats | The specified CollectStats is invalid. | The specified CollectStats parameter is invalid. |
400 | IncorrectDBInstanceState | The current instance state does not support this operation. | The operation is not supported. The RDS instance is not in a ready state. |
400 | InvalidDBinstanceClass.ValueNotSupported | The specified parameter DBinstanceClass is invalid. | The specified parameter DBinstanceClass is invalid. |
404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | The name of the RDS instance cannot be found. Check the name of the RDS instance. |
404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | The operation failed. The RDS instance is locked. |
For a list of error codes, visit the Service error codes.