文档

ModifyDBInstanceSpec - 变更RDS实例

更新时间:
重要

本文中含有需要您注意的重要提示信息,忽略该信息可能对您的业务造成影响,请务必仔细阅读。

该接口用于变更RDS实例的规格和存储空间等。

接口说明

适用引擎

  • RDS MySQL
  • RDS PostgreSQL
  • RDS SQL Server
  • RDS MariaDB

相关功能文档

警告 该 API 操作涉及费用,请仔细阅读相关功能文档后再进行操作。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
rds:ModifyDBInstanceSpecWrite
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag

请求参数

名称类型必填描述示例值
DBInstanceIdstring

实例 ID。可调用 DescribeDBInstances 获取。

rm-uf6wjk5****
DBInstanceClassstring

目标实例规格,详情请参见实例规格表。您也可以调用 DescribeAvailableClasses 接口查询实例可变更规格。

说明
  • 本参数和 DBInstanceStorage 参数两者至少传入一项。
  • 调用 DescribeDBInstanceAttribute 可以查看实例当前使用的规格。
  • mysql.n8.large.2c
    DBInstanceStorageinteger

    目标存储空间大小,单位:GB。每 5GB 进行递增,详情请参见实例规格表。您也可以调用 DescribeAvailableClasses 接口查询目标实例规格中可用的存储空间范围。

    说明
  • 本参数和 DBInstanceClass 参数两者至少传入一项。
  • 调用 DescribeDBInstanceAttribute 可以查看实例当前的存储空间大小。
  • 100
    PayTypestring

    实例当前的付费类型,取值:

    Postpaid
    EffectiveTimestring

    生效时间,取值:

    • Immediate(默认值):立即生效。
    • MaintainTime:在可运维时间段内生效,请参见 ModifyDBInstanceMaintainTime。
    MaintainTime
    EngineVersionstring

    数据库版本号,取值:

    • 常规实例
      • MySQL:5.55.65.78.0
      • SQL Server:2008r208r2_ent_ha20122012_ent_ha2012_std_ha2012_web2014_std_ha2016_ent_ha2016_std_ha2016_web2017_std_ha2017_ent2019_std_ha2019_ent
      • PostgreSQL:10.011.012.013.014.015.0
      • MariaDB:10.3
    • Serverless 实例
      • MySQL:5.78.0

      • SQL Server:2016_std_sl2017_std_sl2019_std_sl

      • PostgreSQL:14.015.016.0

      说明 MariaDB 不支持 Serverless 实例。
    5.6
    DBInstanceStorageTypestring

    实例储存类型,取值:

    • local_ssd:本地 SSD 盘
    • cloud_ssd:SSD 云盘(不推荐,部分地域已经停止售卖)
    • cloud_essd:ESSD PL1 云盘
    • cloud_essd2:ESSD PL2 云盘
    • cloud_essd3:ESSD PL3 云盘
    • general_essd:通用云盘

    如需变更存储类型,请注意:

    • 如果将实例存储类型由 ESSD 变更为通用云盘,则其他参数(实例规格、存储空间大小等)需与实例原参数值保持一致,不允许修改。

    • 如果实例类型为 MySQL 或 MariaDB,并且实例的存储类型为 SSD 云盘,您可以传入cloud_essd将实例的存储类型升级为 ESSD 云盘。如需升级,则 DBInstanceClassDBInstanceStorage 都需要传入,且需要与实例现有的值相同。更多信息,请参见升级 SSD 云盘至 ESSD 云盘

    • 如果实例类型为 PostgreSQL,您可以将 SSD 云盘升级为 ESSD 云盘(ESSD PL1、ESSD PL2、ESSD PL3),但不支持将 ESSD 云盘降级为 SSD 云盘。ESSD PL1、ESSD PL2 和 ESSD PL3 间支持存储类型的升级或降级。更多信息,请参见变更项说明

    local_ssd
    Directionstring

    实例变配类型,取值:

    • Up(默认值):包年包月实例的升级和按量付费实例的升级/降级。
    • Down:包年包月实例的降级。
    • TempUpgrade:包年包月 SQL Server 实例的弹性变配,弹性变配必填。
    • Serverless:Serverless 实例调整弹性设置时配置。
    说明 如果仅变更 DBInstanceStorageType 参数,例如将 SSD 云盘变更为 ESSD 云盘,则此参数留空。
    Up
    SourceBizstring

    弃用参数,无需配置。

    test
    DedicatedHostGroupIdstring

    专属集群 ID。

    dhg-7a9****
    ZoneIdstring

    可用区 ID。

    cn-hangzhou-b
    SwitchTimestring

    指定执行变配的时间。建议在业务低峰期执行变配。格式:yyyy-MM-ddTHH:mm:ssZ(UTC 时间)。

    说明
  • 该时间必须大于当前时间(执行调用的时间),否则变配任务失败。失败后,您需要等待订单自动作废才可以重新调用。
  • 仅增加存储空间或 ESSD 存储类型变更时,对业务无影响,变配后立即执行,无需配置此参数。
  • 2019-07-10T13:15:12Z
    ResourceGroupIdstring

    资源组 ID。

    rg-acfmy****
    UsedTimelong

    SQL Server 实例的弹性升级时间。单位:天。

    3
    ServerlessConfigurationobject

    变配 Serverless 实例。

    MaxCapacitydouble

    实例 RCU(Rds Capacity Unit)的自动扩缩范围最大值。取值:

    • MySQL:1~32
    • SQL Server:2~8
    • PostgreSQL:1~14
    说明 该参数的值必须大于等于 MinCapacity,且仅支持传入整数
    8
    MinCapacitydouble

    实例 RCU(Rds Capacity Unit)的自动扩缩范围最小值。取值:

    • MySQL:0.5~32
    • SQL Server:2~8(仅支持整数)
    • PostgreSQL:0.5~14
    说明 该参数的值必须小于等于 MaxCapacity
    0.5
    AutoPauseboolean

    否开启 Serverless 实例的智能暂停和启动。取值:

    • true:启用
    • false(默认):不启用
    说明 仅 MySQL 和 PostgreSQL 的 Serverless 实例需设置该参数。如果 10 分钟无任何连接将进入暂停状态,当连接进入时会自动唤醒。
    true
    SwitchForceboolean

    是否开启 Serverless 实例的强制弹性扩缩容,取值:

    • true:启用
    • false:不启用(默认值)
    说明
  • 仅 MySQL 和 PostgreSQL 的 Serverless 实例需设置该参数。开启该参数后,实例进行强制扩缩容时会出现 30~120 秒的服务不可用,请根据实际情况谨慎使用。
  • 实例 RCU 的弹性扩缩容通常会立刻生效,但在某些特殊情况下(例如大事务执行中)无法即刻完成扩缩容,此时可开启本参数进行强制扩缩容。
  • false
    Categorystring

    实例系列,取值:

    • 常规实例
      • Basic:基础系列
      • HighAvailability:高可用系列
      • AlwaysOn:SQL Server 集群系列
      • Cluster:MySQL 集群系列。
      • Finance:金融版
    • Serverless 实例
      • serverless_basic:Serverless 基础系列(仅适用 MySQL 和 PostgreSQL)

      • serverless_standard:Serverless 高可用系列(仅适用 MySQL 和 PostgreSQL)

      • serverless_ha:SQL Server Serverless 高可用系列

      说明 EngineVersion 为 SQL Server 版本号时,此项必填。
    HighAvailability
    BurstingEnabledboolean

    通用云盘 IO 突发功能开关。

    • true:开启 IO 突发功能。
    • false:关闭 IO 突发功能。
    说明 了解通用云盘的 IO 突发功能的更多信息,请参见什么是通用云盘
    false
    AutoUseCouponboolean

    是否使用代金券抵扣费用,取值:

    • true:使用
    • false:不使用(默认值)
    false
    TargetMinorVersionstring

    内核小版本号。

    仅 PostgreSQL 实例需设置该参数。当变更实例规格并且报错内核小版本不支持时,需要传入内核小版本号,用于在变更实例规格时升级内核小版本。

    格式:rds_postgres_<大版本号>00_<小版本号>。例如 12 版本的 20200830:rds_postgres_1200_20200830

    说明 内核小版本号请参见PostgreSQL 小版本 Release Notes
    rds_postgres_1200_20200830
    IoAccelerationEnabledstring

    是否开启通用云盘 IO 加速功能,参数取值含义如下:

    • 1:开启
    • 0:不开启
    说明 通用云盘的 IO 加速功能的更多信息,请参见通用云盘 IO 加速功能技术介绍
    0
    ColdDataEnabledboolean

    预留参数。

    true

    返回参数

    名称类型描述示例值
    object

    返回参数详情。

    DBInstanceIdstring

    实例 ID。

    rm-uf6wjk5****
    RequestIdstring

    请求 ID。

    3C5CFDEE-F774-4DED-89A2-1D76EC63C575
    OrderIdlong

    订单 ID。

    20793850608****

    示例

    正常返回示例

    JSON格式

    {
      "DBInstanceId": "rm-uf6wjk5****",
      "RequestId": "3C5CFDEE-F774-4DED-89A2-1D76EC63C575",
      "OrderId": 0
    }

    错误码

    HTTP status code错误码错误信息描述
    400CannotDecreaseEssdPerfLevelcannot decrease cloud essd performance level.存储类型变更校验失败,SQL Server云盘实例只能转为云盘,SSD只能升级到SSD或ESSD。
    400InvalidEssdStorageSizeinvalid cloud essd storage size.云盘存储规格有误,请检查存储规格配置。
    400Postpaid.NotSupportPostpaid not supported.-
    400InvalidConcurrentOperateSystem concurrent operate.-
    400NotSupportReduceDiskSizeNot support reduce disk size.操作失败,不支持减少磁盘大小。
    400IncorrectStorageTypeIncorrect storage type.-
    400TargetStorageLessThanBottomLineTarget storage less than bottom line-
    400InstanceHasUnpaidOrderThe specified Instance has unpaid order.-
    400InsufficientBalanceOpen volume paid cloud database. Your account balance is less than 100 RMB. Top-up and try again.-
    400InvalidDBInstanceClass.NotFoundSpecified DB instance class is not found.当前选择的配置或规格不存在或已停售,请重新选择。
    400InvalidParameterThe specified parameter "%s" is not valid.-
    400InvalidAvZone.FormatSpecified AvZone is not valid.指定的AvZone不合法,请检查该参数的正确性。
    400OperationDenied.OrderUnPaidThe operation is not permitted due to the wrong Order status (Unpaid).操作失败,存在未支付的订单。请在账户总览中查看。
    400OperationDenied.InvalidStorageSizeThe storage size limit is exceeded.已超过磁盘空间上限,请清理磁盘空间,或扩大磁盘空间。
    400InsufficientResourceCapacityThe instance cluster does not support this operation.该实例集群不支持此操作。
    400InvalidUsedTimeThe parameter usedTime is invalid.参数usedTime无效
    400CannotChangeStorageTypeTemp upgrade does not support changing storage type.弹性升级不可改变存储类型。
    400TempUpgrade.NotSupportThe instance does not support temp upgrade.该实例不支持弹性升级。
    400EngineNotSupportedEngine specified cannot be supported the operation.操作失败,当前引擎不支持此操作,请升级内核小版本。
    400MaxscaleNotSupportMaxscale not supported操作失败,实例不支持独享代理,请检查开通独享代理的配置信息。
    400ADInstanceNotSupportThisOperationThe AD instance is not supported this operation加入AD域的实例不支持此操作
    400BYOKInstanceNotSupportThisOperationThe BYOK instance is not supported this operation开启云盘加密功能的实例不支持此操作
    400BYOLInstanceNotSupportThisOperationThe BYOL instance is not supported this operationBYOL实例不支持此操作
    400SSLInstanceNotSupportThisOperationThe instance opened SSL, upgrade is not this operation开启SSL功能的实例不支持此操作
    400TDEInstanceNotSupportThisOperationThe instance opened TDE, this operation is not supported开启TDE功能的实例不支持此操作
    400InstanceIsSnapshotBackupNotSupportThisOperationThe instance backup method is snapshot backup, this operation is not supported开启快照备份的实例不支持此操作
    400InstanceHasReadOnlyInstanceNotSupportThisOperationThe instance has read-only instance or is read-only instance, this operation is not supported该实例有只读实例或者该实例是只读实例,不支持此操作
    400InvalidTargetStorageTypeCan not change storage type when modify instance class or storage.-
    400InvalidTargetCategorySpecified classcode is not matched with current product type.-
    400IncorrectDBInstanceStateCurrent DB instance state does not support this operation.当前实例状态不支持此操作。
    400BackupReadInstanceModifyNotAllowedModify Backup Read Instance Is Not Allowed.不允许修改备份读取实例。
    400MinorVersionNotSupportThe current database minor version does not support the operation.操作失败,当前小版本不支持该操作。
    400LX.ARGUMENT.ILLEGAL变配,当前实例无有效配置-
    400ORD.S.QUERY.PROD.ERRORAn error occurred while querying the ordering information查询订购错误
    400InvalidParameter.NotSupportDiskTypeModifyServerless not support modify disk type!-
    400InvalidParameter.NotSupportModifyServerlessConfigAndDiskTogetherServerless not support modify serverlessconfig and disk together!-
    400InvalidParameters.MalformedOne or more of the request parameters provided are not valid.请求参数有误,请检查接口文档
    400DBInstancePayTypeNotSupportCurrent instance PayType not support this operation or the param PayType not match current instance PayType.当前实例的付费类型不支持此操作或者参数PayType与当前实例不匹配。
    400InvalidDBInstanceClass.OfflineThe specified instance type is no longer provided. Please specify another instance type.当前所选的实例规格已下线,请更换其他实例规格。
    400IncorrectTargetClasscodeThe current instance type does not support this operation.当前规格不支持此操作。
    400InvalidPayType.NotSupportedcurrent instance pay type not support this operation.-
    400nvalidStorageType.NotSupportcurrent storage type does not support this operation.-
    400OperationDenied.DurationLimitThe duration between two operations should be greater than specified time.-
    400AccountMoneyValidate.errorInsufficient funds available in the account.账号可用金额不足。
    400ChangeEngineVersionNotSupportedThis operation does not support modifying the engine version.此操作不支持修改引擎版本。
    400InvalidDBInstanceStorageTypeThe specified DBInstanceStorageType is invalid.指定的数据库实例存储类型无效
    400EncryptionInstancesNotSupportCloud disk encryption instances that use byok do not support modify to multi tenant.使用自定义密钥的云盘加密实例不支持变配到通用型规格
    400Commodity.InvalidComponentThe module you purchased is not legal, please buy it again.您购买的模块不合法,请重新购买。
    400CommodityServiceCalling.ExceptionFailed to call commodity service.调用商品服务返回失败。
    400Pay.InsufficientBalanceInsufficient available balance.可用金不足。
    400Price.CommoditySysCommodity system call exception.商品系统调用异常。
    400CurrentInsHasColdDBThe current instance has cold storage db.当前实例存在冷存库
    400CurrentInsHasColdStorageCurrent instance has cold storage.当前实例存在冷存储
    400InsufficientResourceCapacityCheckThere is insufficient capacity available for the requested instance with precheck.具有预检查的请求实例的可用容量不足。
    400InvalidStorageSize.DirectionThe specified parameter StorageSize does not meet the updating direction constraint requirements.存储空间不满足当前变更方向的约束要求。
    400InvalidStorageType.DirectionThe specified parameter StorageType does not meet the updating direction constraint requirements.存储类型不满足变更方向的约束。
    400Order.ComboInstanceNotAllowOperateA package instance is not allowed to operate independently.套餐实例不允许单独操作。
    400Price.PricingPlanResultNotFoundPricing plan price result not found.定价计划价格结果没有找到。
    400Order.NoRealNameAuthenticationYou have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.您还未通过实名认证,不符合购买条件,请登录用户中心进行实名认证。
    403IncorrectDBInstanceTypeThe database instance type does not support the operation.操作失败,当前数据库类型不支持该操作。
    403OperationDenied.NotSupportedBackupMethodWhen the storage is larger than 4000 GB, only snapshot backup is supported.当存储空间大于4000GB,仅支持快照备份。
    403IncorrectReadDBInstanceDisksizeRead instance disk size must be equal or higher than primary instance.只读实例磁盘大小必须等于或大于主实例。
    403BetaServerlessNotSupportThisActionBeta Serverless Not Support This Feature-
    403GroupReplicationNotSupport.InvalidEngineVersionGroup Replication requires the instance engine version to be 8.0.实例数据库版本不是MySQL 8.0,不支持组复制。
    403GroupReplicationNotSupport.InvalidNodeClassCodeGroup Replication requires the ClassCode of each node to be consistent.实例各节点间规格不一致,不支持组复制。
    403GroupReplicationNotSupport.InvalidNodeNumGroup Replication is not supported, the number of nodes must be an odd number greater than or equal to 3.实例节点个数不是大于等于3的单数,不支持组复制。
    403GroupReplicationNotSupport.InvalidXengineGroup Replication is not supported because the instance has xengine tables.实例存在xengine引擎表,不支持组复制。
    403GroupReplicationNotSupport.MemoryTooSmallGroup Replication is not supported because the memory is too small.实例规格内存太小,不支持组复制。
    403ARMNotSupportARM arch does not support this operation.ARM架构不支持此操作。
    403HostTypeNotSupportHost type is inconsistent, please check that the original host type is the same as the target host type.变更前后host type不一致,请检查原host type和目标host type保持一致。
    403CloudSSDNotSupportCloud ssd does not support this operation, please upgrade to essd.SSD盘不支持此操作,请升级至ESSD。
    403MaxscaleInstanceNotSupportInstances with maxscale instance do not support this operation.带Maxscale代理的实例不支持此操作。
    403ReadInstanceNotSupportInstances with read-only do not support this operation.带只读的实例不支持此操作。
    403UnSupportReduceDiskSizeCurrent instance type does not support reducing disk space.当前实例类型不支持降低磁盘空间。
    403CloudboxInstanceNotSupportCloud-box instance does not support this operation.云盒实例不支持此操作
    403ReadOnlyInstanceNotSupportRead-only instance does not support this operation.只读实例不支持此操作。
    403MinorVersionNotSupportCustins minor version does not support current action.-
    403ShrinkCountReachedLimitCurrent DB shrink count reached the limit.当前数据库收缩计数已达到限制。
    404InvalidClusterKmsThe current instance does not authorized to access the Key Management Service.当前实例未授权访问密钥管理服务。

    访问错误中心查看更多错误码。

    变更历史

    变更时间变更内容概要操作
    2024-03-11OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2024-02-29OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2024-02-27OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2024-01-04OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      删除错误码:400
      删除错误码:403
      删除错误码:404
    入参OpenAPI 入参发生变更
      新增入参:BurstingEnabled
      新增入参:IoAccelerationEnabled
      新增入参:ColdDataEnabled
    2023-12-25OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 403 变更
      删除错误码:400
      删除错误码:404
    2023-11-21OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2023-10-13OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2023-08-29OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2023-07-26OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      删除错误码:400
      删除错误码:403
      删除错误码:404
    入参OpenAPI 入参发生变更
      新增入参:TargetMinorVersion
    2023-07-04OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      删除错误码:400
      删除错误码:403
      删除错误码:404
    入参OpenAPI 入参发生变更
      新增入参:AutoUseCoupon
    2023-06-05OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      错误码 403 变更
      删除错误码:404
    2023-05-09OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 403 变更
      删除错误码:400
      删除错误码:404
    2023-04-28OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2023-04-19OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 403 变更
      删除错误码:400
      删除错误码:404
    2023-03-16OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
    2022-12-13OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      删除错误码:400
      删除错误码:403
      新增错误码:404
    2022-07-05OpenAPI 描述信息更新、OpenAPI 错误码发生变更看变更集
    变更项变更内容
    API 描述OpenAPI 描述信息更新
    错误码OpenAPI 错误码发生变更
      删除错误码:400
      删除错误码:403
    2022-06-23OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
    2021-10-19OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
    入参OpenAPI 入参发生变更
      新增入参:ResourceGroupId
      新增入参:UsedTime
    • 本页导读 (1)
    文档反馈