调用ModifyDBInstanceSpec接口,变更RDS实例(包括常规实例和只读实例,不包括灾备实例和临时实例)的规格或存储空间。
升级调用该接口时,实例必须满足以下条件,否则将操作失败:
- 实例状态为运行中。
- 实例没有正在执行的备份任务。
- 请求参数中必须至少指定实例规格(DBInstanceClass)和存储空间(DBInstanceStorage)其中一个参数。
- 若降低磁盘空间配置,输入的磁盘空间不能小于实际使用空间大小的1.1倍。
- 当前只支持对常规实例和只读实例变更配置,不支持灾备实例和临时实例。
说明 升级数据库版本(例如从基础版升级高可用版),选择相应的实例规格即可。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | ModifyDBInstanceSpec | 系统规定参数。取值:ModifyDBInstanceSpec。 |
| DBInstanceId | String | 是 | rm-uf6wjk5******* | 待变更配置的实例ID。 |
| DBInstanceClass | String | 否 | rds.mys2.small | 目标实例规格,详情请参见实例规格表。您也可以调用DescribeAvailableClasses接口查询目标地域中可用的实例规格列表。 说明
|
| DBInstanceStorage | Integer | 否 | 20 | 目标存储空间大小,单位:GB。每5GB进行递增,详情请参见实例规格表。您也可以调用DescribeAvailableClasses接口查询目标实例规格中可用的存储空间范围。 说明
|
| PayType | String | 是 | Postpaid | 实例当前的付费类型,取值:
|
| EffectiveTime | String | 否 | MaintainTime | 生效时间,取值:
说明 默认值:Immediate。 |
| EngineVersion | String | 否 | 5.6 | 数据库版本号,取值:
|
| DBInstanceStorageType | String | 否 | local_ssd | 实例储存类型,取值:
如需变更存储类型,请注意:
|
| Direction | String | 否 | Up | 实例变配类型,取值:
说明
|
| SourceBiz | String | 否 | 不涉及 | 弃用参数。 |
| DedicatedHostGroupId | String | 否 | dhg-7a9******** | 专属集群ID。 |
| ZoneId | String | 否 | cn-hangzhou-b | 可用区ID。 |
| SwitchTime | String | 否 | 2019-07-10T13:15:12Z | 指定执行变配的时间。建议在业务低峰期执行变配。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 说明
|
| ResourceGroupId | String | 否 | rg-acfmy********** | 资源组ID。 |
| UsedTime | Long | 否 | 3 | SQL Server实例的弹性升级时间。单位:天。 |
| ServerlessConfiguration | Object | 否 | 变配RDS MySQL Serverless实例。 |
|
| MaxCapacity | double | 否 | 8 | 实例RCU(Rds Capacity Unit)的自动扩缩范围最大值。 |
| MinCapacity | double | 否 | 0.5 | 实例RCU(Rds Capacity Unit)的自动扩缩范围最小值。 |
| AutoPause | Boolean | 否 | true | 是否自动暂停。 |
| SwitchForce | Boolean | 否 | false | 是否开启Serverless实例的强制弹性扩缩容,返回值如下:
|
| Category | String | 否 | HighAvailability | 实例系列,取值:
说明 EngineVersion为SQL Server版本号时,此项必填。 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| DBInstanceId | String | rm-uf6wjk5******* | 实例ID。 |
| RequestId | String | 3C5CFDEE-F774-4DED-89A2-1D76EC63C575 | 请求ID。 |
| OrderId | Long | 20793850608**** | 订单ID。 |
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=ModifyDBInstanceSpec
&DBInstanceId=rm-uf6wjk5*******
&PayType=Postpaid
&DBInstanceClass=rds.mys2.small
&<公共请求参数>
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDBInstanceSpecResponse>
<RequestId>3C5CFDEE-F774-4DED-89A2-1D76EC63C575</RequestId>
<DBInstanceId>rm-uf6wjk5*******</DBInstanceId>
<OrderId>20793850608****</OrderId>
</ModifyDBInstanceSpecResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "3C5CFDEE-F774-4DED-89A2-1D76EC63C575",
"DBInstanceId" : "rm-uf6wjk5*******",
"OrderId" : "20793850608****"
}
错误码
| HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 400 | CannotDecreaseEssdPerfLevel | cannot decrease cloud essd performance level. | 存储类型变更校验失败,SQL Server云盘实例只能转为云盘,SSD只能升级到SSD或ESSD。 |
| 400 | InvalidEssdStorageSize | invalid cloud essd storage size. | 云盘存储规格有误,请检查存储规格配置。 |
| 400 | NotSupportReduceDiskSize | Not support reduce disk size. | 操作失败,不支持减少磁盘大小。 |
| 400 | InvalidDBInstanceClass.NotFound | Specified DB instance class is not found. | 当前选择的配置或规格不存在或已停售,请重新选择。 |
| 400 | InvalidAvZone.Format | Specified AvZone is not valid. | 指定的AvZone不合法,请检查该参数的正确性。 |
| 400 | OperationDenied.OrderUnPaid | The operation is not permitted due to the wrong Order status (Unpaid). | 操作失败,存在未支付的订单。请在账户总览中查看。 |
| 400 | OperationDenied.InvalidStorageSize | The storage size limit is exceeded. | 已超过磁盘空间上限,请清理磁盘空间,或扩大磁盘空间。 |
| 400 | InsufficientResourceCapacity | The instance cluster does not support this operation. | 该实例集群不支持此操作。 |
| 400 | InvalidUsedTime | The parameter usedTime is invalid. | 参数usedTime无效 |
| 400 | CannotChangeStorageType | Temp upgrade does not support changing storage type. | 弹性升级不可改变存储类型。 |
| 400 | TempUpgrade.NotSupport | The instance does not support temp upgrade. | 该实例不支持弹性升级。 |
| 400 | EngineNotSupported | Engine specified cannot be supported the operation. | 操作失败,当前引擎不支持此操作,请升级内核小版本。 |
| 400 | MaxscaleNotSupport | Maxscale not supported | 操作失败,实例不支持独享代理,请检查开通独享代理的配置信息。 |
| 400 | ADInstanceNotSupportThisOperation | The AD instance is not supported this operation | 加入AD域的实例不支持此操作 |
| 400 | BYOKInstanceNotSupportThisOperation | The BYOK instance is not supported this operation | 开启云盘加密功能的实例不支持此操作 |
| 400 | BYOLInstanceNotSupportThisOperation | The BYOL instance is not supported this operation | BYOL实例不支持此操作 |
| 400 | SSLInstanceNotSupportThisOperation | The instance opened SSL, upgrade is not this operation | 开启SSL功能的实例不支持此操作 |
| 400 | TDEInstanceNotSupportThisOperation | The instance opened TDE, this operation is not supported | 开启TDE功能的实例不支持此操作 |
| 400 | InstanceIsSnapshotBackupNotSupportThisOperation | The instance backup method is snapshot backup, this operation is not supported | 开启快照备份的实例不支持此操作 |
| 400 | InstanceHasReadOnlyInstanceNotSupportThisOperation | The instance has read-only instance or is read-only instance, this operation is not supported | 该实例有只读实例或者该实例是只读实例,不支持此操作 |
| 400 | BackupReadInstanceModifyNotAllowed | Modify Backup Read Instance Is Not Allowed. | 不允许修改备份读取实例。 |
| 400 | MinorVersionNotSupport | The current database minor version does not support the operation. | 操作失败,当前小版本不支持该操作。 |
| 400 | LX.ARGUMENT.ILLEGAL | 变配,当前实例无有效配置 | 变配,当前实例无有效配置 |
| 400 | ORD.S.QUERY.PROD.ERROR | An error occurred while querying the ordering information | 查询订购错误 |
| 403 | IncorrectDBInstanceType | The database instance type does not support the operation. | 操作失败,当前数据库类型不支持该操作。 |
| 403 | OperationDenied.NotSupportedBackupMethod | When the storage is larger than 4000 GB, only snapshot backup is supported. | 当存储空间大于4000GB,仅支持快照备份。 |
| 403 | IncorrectReadDBInstanceDisksize | Read instance disk size must be equal or higher than primary instance. | 只读实例磁盘大小必须等于或大于主实例。 |
| 403 | GroupReplicationNotSupport.InvalidEngineVersion | Group Replication requires the instance engine version to be 8.0. | 实例数据库版本不是MySQL 8.0,不支持组复制。 |
| 403 | GroupReplicationNotSupport.InvalidNodeClassCode | Group Replication requires the ClassCode of each node to be consistent. | 实例各节点间规格不一致,不支持组复制。 |
| 403 | GroupReplicationNotSupport.InvalidNodeNum | Group Replication is not supported, the number of nodes must be an odd number greater than or equal to 3. | 实例节点个数不是大于等于3的单数,不支持组复制。 |
| 403 | GroupReplicationNotSupport.InvalidXengine | Group Replication is not supported because the instance has xengine tables. | 实例存在xengine引擎表,不支持组复制。 |
| 403 | GroupReplicationNotSupport.MemoryTooSmall | Group Replication is not supported because the memory is too small. | 实例规格内存太小,不支持组复制。 |
| 403 | ARMNotSupport | ARM arch does not support this operation. | ARM架构不支持此操作。 |
| 403 | HostTypeNotSupport | Host type is inconsistent, please check that the original host type is the same as the target host type. | 变更前后host type不一致,请检查原host type和目标host type保持一致。 |
| 403 | CloudSSDNotSupport | Cloud ssd does not support this operation, please upgrade to essd. | SSD盘不支持此操作,请升级至ESSD。 |
| 403 | MaxscaleInstanceNotSupport | Instances with maxscale instance do not support this operation. | 带Maxscale代理的实例不支持此操作。 |
| 403 | ReadInstanceNotSupport | Instances with read-only do not support this operation. | 带只读的实例不支持此操作。 |
| 404 | InvalidClusterKms | The current instance does not authorized to access the Key Management Service. | 当前实例未授权访问密钥管理服务。 |
访问错误中心查看更多错误码。