调用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实例的弹性升级时间。单位:天。 |
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 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
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. | 只读实例磁盘大小必须等于或大于主实例。 |
404 | InvalidClusterKms | The current instance does not authorized to access the Key Management Service. | 当前实例未授权访问密钥管理服务。 |
访问错误中心查看更多错误码。