You can call the ModifyDBInstanceSpec operation to change the instance type or storage capacity of an ApsaraDB RDS instance.
Before you call this operation, make sure that the following requirements are met:
- The instance must be in the Running state.
- The instance cannot have ongoing backup tasks.
- At least one of the DBInstanceClass and DBInstanceStorage parameters must be specified in the request.
- If you want to decrease the storage capacity, the specified storage capacity must be greater than or equal to 1.1 times the used storage capacity.
- The instance must be a primary or read-only instance. This operation is not supported for disaster recovery or temporary instances.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyDBInstanceSpec |
The operation that you want to perform. Set the value to ModifyDBInstanceSpec. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxx |
The ID of the instance. |
PayType | String | Yes | Postpaid |
The billing method of the instance. Valid values:
|
ZoneId | String | No | cn-hangzhou-b |
The ID of the zone to which the instance belongs. |
DBInstanceClass | String | No | rds.mys2.small |
The instance type of the instance. For more information, see Primary instance types. Note You must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.
|
DBInstanceStorage | Integer | No | 20 |
The storage capacity that you want to specify for the instance. Unit: GB. The storage capacity increases at increments of 5 GB. For more information, see Primary instance types. Note You must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.
|
EffectiveTime | String | No | MaintainTime |
The time when you want to apply the specification changes. Valid values:
Default value: Immediate. |
EngineVersion | String | No | 5.6 |
The database engine version that the instance runs. Valid values:
|
DBInstanceStorageType | String | No | local_ssd |
The storage type of the instance. Valid values:
|
Direction | String | No | Up |
The type of change that you want to perform on the instance. Valid values:
Default value: Up. |
SourceBiz | String | No | N/A |
A deprecated parameter. |
DedicatedHostGroupId | String | No | dhg-7a9xxxxxxxx |
The ID of the dedicated cluster to which the instance belongs. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DBInstanceId | String | rm-uf6wjk5xxxxxxx | The ID of the instance. |
OrderId | Long | 207938506080728 | The ID of the order. |
RequestId | String | 3C5CFDEE-F774-4DED-89A2-1D76EC63C575 |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=ModifyDBInstanceSpec
&DBInstanceId=rm-uf6wjk5xxxxxxx
&PayType=Postpaid
&DBInstanceClass=rds.mys2.small
&<Common request parameters>
Sample success responses
XML
format
<ModifyDBInstanceSpecResponse>
<RequestId>3C5CFDEE-F774-4DED-89A2-1D76EC63C575</RequestId>
<DBInstanceId>rm-uf6wjk5xxxxxxx</DBInstanceId>
<OrderId>207938506080728</OrderId>
</ModifyDBInstanceSpecResponse>
JSON
format
{
"RequestId": "3C5CFDEE-F774-4DED-89A2-1D76EC63C575",
"DBInstanceId": "rm-uf6wjk5xxxxxxx",
"OrderId": 207938506080728
}
Error codes
For a list of error codes, visit the API Error Center.