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

ModifyDBInstanceSpec - 变更RDS实例

包括常规实例和只读实例,不包括灾备实例和临时实例)的规格或存储空间。

接口说明

升级调用该接口时,实例必须满足以下条件,否则将操作失败:

  • 实例状态为运行中。
  • 实例没有正在执行的备份任务。
  • 请求参数中必须至少指定实例规格(DBInstanceClass)和存储空间(DBInstanceStorage)其中一个参数。
  • 若降低磁盘空间配置,输入的磁盘空间不能小于实际使用空间大小的1.1倍。
  • 当前只支持对常规实例和只读实例变更配置,不支持灾备实例和临时实例。
说明升级数据库版本(例如从基础版升级高可用版),选择相应的实例规格即可。

调试

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

调试

授权信息

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

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

请求参数

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

待变更配置的实例ID。

rm-uf6wjk5*******
DBInstanceClassstring

目标实例规格,详情请参见实例规格表。您也可以调用DescribeAvailableClasses接口查询目标地域中可用的实例规格列表。

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

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

    说明
  • 本参数和DBInstanceClass参数两者至少传入一项。
  • RDS MySQL高可用版本地盘实例支持存储空间缩容,每5GB递减。
  • 调用DescribeDBInstanceAttribute可以查看实例当前的存储空间大小。
  • 20
    PayTypestring

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

    • Postpaid:按量付费
    • Prepaid:预付费
    Postpaid
    EffectiveTimestring

    生效时间,取值:

    说明默认值:Immediate
    MaintainTime
    EngineVersionstring

    数据库版本号,取值:

    • MySQL:5.5/5.6/5.7/8.0
    • SQLServer:2008r2/08r2_ent_ha/2012/2012_ent_ha/2012_std_ha/2012_web/2014_std_ha/2016_ent_ha/2016_std_ha/2016_web/2017_std_ha/2017_ent/2019_std_ha/2019_ent
    • PostgreSQL:10.0/11.0/12.0/13.0/14.0/15.0
    • MariaDB:10.3
    5.6
    DBInstanceStorageTypestring

    实例储存类型,取值:

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

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

    • 如果实例类型为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:包年包月实例的弹性变配,弹性变配必填。
    说明
  • 默认值:Up
  • 如果仅变更DBInstanceStorageType参数,例如将SSD云盘变更为ESSD云盘,则此参数留空。
  • Up
    SourceBizstring

    弃用参数。

    不涉及
    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

    变配RDS MySQL Serverless实例。

    MaxCapacitydouble

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

    8
    MinCapacitydouble

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

    0.5
    AutoPauseboolean

    是否自动暂停。

    true
    SwitchForceboolean

    是否开启Serverless实例的强制弹性扩缩容,返回值如下:

    • true:启用。
    • false:不启用(默认值)
    false
    Categorystring

    实例系列,取值:

    • Basic:基础版

    • HighAvailability:高可用版

    • AlwaysOn:SQL Server集群版

    • Cluster:MySQL集群版。

    • Finance:金融版(仅中国站支持)

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

    返回参数

    名称类型描述示例值
    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.当前所选的实例规格已下线,请更换其他实例规格。
    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.带只读的实例不支持此操作。
    404InvalidClusterKmsThe current instance does not authorized to access the Key Management Service.当前实例未授权访问密钥管理服务。

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

    变更历史

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