首页 云数据库 RDS 开发参考 API参考 API目录 实例 ModifyDBInstanceSpec - 变更RDS实例

ModifyDBInstanceSpec - 变更RDS实例

更新时间: 2023-09-20 10:54:09

该接口用于变更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

    生效时间,取值:

    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.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~8
    • SQL Server:2~8
    • PostgreSQL:1~12
    说明 该参数的值必须大于等于MinCapacity,且仅支持传入整数
    8
    MinCapacitydouble

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

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

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

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

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

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

    实例系列,取值:

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

      • serverless_standard:MySQL Serverless高可用版

      • 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

    返回参数

    名称类型描述示例值
    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.账号可用金额不足。
    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.-
    404InvalidClusterKmsThe current instance does not authorized to access the Key Management Service.当前实例未授权访问密钥管理服务。

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

    变更历史

    变更时间变更内容概要操作
    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
    阿里云首页 云数据库 RDS 相关技术圈