该接口用于为RDS实例创建一个只读实例。
接口说明
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
rds:CreateReadOnlyDBInstance | Write |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ClientToken | string | 否 | 用于保证请求的幂等性,防止重复提交请求。由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过 64 个 ASCII 字符,且该参数值中不能包含非 ASCII 字符。 | ETnLKlblzczshOTUbOC**** |
RegionId | string | 是 | 地域 ID。只读实例的地域必须和主实例相同。可调用 DescribeRegions 获取。 | cn-hangzhou |
ZoneId | string | 是 | 可用区 ID。可调用 DescribeRegions 获取。 | cn-hangzhou-b |
DBInstanceId | string | 是 | 主实例 ID。可调用 DescribeDBInstances 获取。 | rm-uf6wjk5**** |
DBInstanceClass | string | 是 | 实例规格,详见只读实例规格列表。建议只读实例规格不小于主实例规格,否则易导致只读实例延迟高、负载高等现象。 | mysqlro.n2.small.1c |
DBInstanceStorage | integer | 是 | 存储空间,只读实例存储空间需要大于或等于主实例存储空间。取值:请参见只读实例规格列表的存储空间列。每 5 GB 进行递增,单位:GB。 | 20 |
EngineVersion | string | 是 | 数据库版本号。必须与主实例相同。
| 5.6 |
PayType | string | 是 | 付费类型,取值:
| Postpaid |
DBInstanceDescription | string | 否 | 实例描述,长度为 2~256 个字符。以中文、英文字母开头,可以包含数字、中文、英文、下划线(_)、短横线(-)。 说明
不能以 http://和 https://开头。
| testReadOnly |
InstanceNetworkType | string | 否 | 只读实例的网络类型,取值:
默认创建专有网络实例,需要传入 VPCId 和 VSwitchId。 说明
只读实例的网络类型可以和主实例不同。
| Classic |
VPCId | string | 否 | 只读实例的专有网络 VPC ID。当 InstanceNetworkType 配置为空或 VPC 时需要传入。 说明
| vpc-uf6f7l4fg90**** |
VSwitchId | string | 否 | 只读实例的虚拟交换机 ID。当 InstanceNetworkType 配置为空或 VPC 时需要传入。 | vsw-uf6adz52c2p**** |
PrivateIpAddress | string | 否 | 设置只读实例的内网 IP,需要在指定交换机的 IP 地址范围内。系统默认通过 VPCId 和 VSwitchId 自动分配。 | 172.16.XX.XX |
ResourceGroupId | string | 否 | 资源组 ID。 | rg-acfmy**** |
Category | string | 否 | 实例系列,取值:
说明
PostgreSQL 云盘实例的只读实例为基础系列,因此必须传入 Basic。
| HighAvailability |
DBInstanceStorageType | string | 否 | 实例储存类型,取值:
说明
| local_ssd |
DedicatedHostGroupId | string | 否 | 在专属集群内创建只读实例时指定专属集群 ID。 | dhg-4n**** |
TargetDedicatedHostIdForMaster | string | 否 | 在专属集群内创建只读实例时,指定主实例的主机 ID。 | i-bp**** |
GdnInstanceName | string | 否 | 备用参数。 | test |
TddlBizType | string | 否 | 备用参数。 | test |
TddlRegionConfig | string | 否 | 备用参数。 | test |
InstructionSetArch | string | 否 | 备用参数。 | test |
UsedTime | string | 否 | 指定购买时长。取值:
说明
若 PayType 为 Prepaid,需要传入该参数。
| 1 |
Period | string | 否 | 指定预付费实例为包年或者包月类型。取值:
| Month |
AutoRenew | string | 否 | 实例是否自动续费,仅在创建包年包月实例时传入。取值:
说明
| true |
DeletionProtection | boolean | 否 | 是否开启 RDS 释放保护功能。取值:
说明
仅计费方式为按量付费时支持开启。
| true |
Port | string | 否 | 支持在 RDS MySQL 主实例创建只读实例时初始化端口。 取值范围:1000~65534 | 3306 |
BpeEnabled | string | 否 | 弃用参数,无需配置。 | 0 |
BurstingEnabled | boolean | 否 | false | |
AutoPay | boolean | 否 | 是否自动支付。 取值范围:
说明
默认值为 true。如果您的支付方式余额不足,可以将参数 AutoPay 设置为 false,此时会生成未支付订单,您可以登录 RDS 管理控制台自行支付。
| false |
IoAccelerationEnabled | string | 否 | 0 |
返回参数
示例
正常返回示例
JSON
格式
{
"DBInstanceId": "rr-uf6wjk5****",
"RequestId": "1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC",
"Port": "3306",
"ConnectionString": "rr-****.mysql.rds.aliyuncs.com",
"OrderId": "10078937****"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidEngineVersion.Malformed | The specified parameter EngineVersion is not valid. | - |
400 | InvalidNetworkTypeClassicWhenCloudStorage | The Specified InstanceNetworkType value Classic is not valid when choose cloud storage type. | - |
400 | InvalidSecurityIPList.Malformed | The specified parameter SecurityIPList is not valid. | - |
400 | InvalidSecurityIPList.Duplicate | The Security IP address is not in the available range or occupied. | 当前的安全IP地址已被占用或不在有效区间内,请重新设置安全IP地址。 |
400 | InvalidParameter | The specified parameter dbInstanceId is not valid. | - |
400 | OperationDenied | VPC IP is in use, please check. | 操作失败,当前VPC IP已经被使用。 |
400 | InvalidZoneId.NotSupported | The Specified vpc Zone not supported. | 当前可用区不支持创建VPC网络类型实例,请更换可用区。 |
400 | InvalidAvZone.NotSupport | Specified availableArea multiZone does not support in RDS. | 指定的availableArea multiZone在RDS中不支持。 |
400 | CDDC.AvailableHostsNotEnoughInZone | Not enough available hosts are in the target zone. | 目标可用区没有足够的主机资源,请在可用区中创建主机。 |
400 | InvalidReadEngineVersionPattern | The engine versions of the primary instance and the read-only instance do not match. | 主实例和只读实例engineVersion不匹配。 |
400 | InvalidDBInstanceClass.Offline | The specified instance type is no longer provided. Please specify another instance type. | 当前所选的实例规格已下线,请更换其他实例规格。 |
400 | SYSTEM.CONCURRENT_OPERATE | Concurrent operation is detected. | 系统中存在并发操作。 |
400 | Price.PricingPlanResultNotFound | Pricing plan price result not found. | 定价计划价格结果没有找到。 |
400 | Order.ComboInstanceNotAllowOperate | A package instance is not allowed to operate independently. | 套餐实例不允许单独操作。 |
400 | Order.NoRealNameAuthentication | You 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. | 您还未通过实名认证,不符合购买条件,请登录用户中心进行实名认证。 |
400 | InsufficientAvailableQuota | Your account quota limit is less than 0, please recharge before trying to purchase. | 您的账户可用额度小于0,请先充值后再尝试购买。 |
400 | CommodityServiceCalling.Exception | Failed to call commodity service. | 调用商品服务返回失败。 |
400 | RegionDissolvedEOM | Dear customer, Alibaba Cloud plans to optimize and adjust the current region. Cloud services in this region will cease operations. You are currently unable to operate new purchase orders. Thank you for your understanding and support. | 客户您好,阿里云计划对当前地域进行优化调整,该区域云服务将停止运营,为确保您的业务连续性及数据迁移工作的平稳过渡,您目前无法操作新购类型的订单,感谢理解与支持。 |
400 | Commodity.InvalidComponent | The module you purchased is not legal, please buy it again. | 您购买的模块不合法,请重新购买。 |
400 | RegionEndTimeDissolvedIndia | Cloud services in the India (Mumbai) region will be discontinued. Set the validity date to July 15, 2024 or earlier than July 15, 2024. | 客户您好,印度地域裁撤,购买的服务效期不能超过2024.07.15。 |
400 | RegionEndTimeDissolvedAustralia | Cloud services in the Australia (Sydney) region will be discontinued. Set the validity date to September 30, 2024 or earlier than September 30, 2024. | 客户您好,澳洲地域裁撤,购买的服务效期不能超过2024.09.30 |
400 | Price.CommoditySys | Commodity system call exception. | 商品系统调用异常。 |
400 | Pay.InsufficientBalance | Insufficient available balance. | 可用金不足。 |
400 | Order.PeriodInvalid | There is a problem with the period you selected, please choose again. | 您选购的周期有问题,请重新选购。 |
400 | pay.noCreditCard | Account not bound to credit card. | 账户未绑定信用卡。 |
400 | Order.InstHasUnpaidOrder | There is an unpaid order for the service you have purchased. Please pay or void it before placing the order. | 您选购的服务存在未支付订单,请支付或作废后再下单。 |
400 | noAvailablePaymentMethod | No payment method is specified for your account. We recommend that you add a payment method. | 没有为您的帐户指定付款方式。我们建议您添加一种付款方式。 |
400 | BasicInfoUncompleted | Your information is incomplete. Complete your information before the operation. | 您的基本信息未完善,请在操作前先完善您的基本信息。 |
400 | Risk.RiskControlRejection | Your account is abnormal, please contact customer service for details. | 您的账户出现异常,详情请联系客服。 |
400 | BasicInfoUncompleted | Your information is incomplete, Complete your information before the operation. | 您的信息不完整,请在操作前填写您的信息。 |
400 | System.SaleValidateFailed | Sales expression validation system error. | 销售表达式校验系统错误。 |
403 | OperationDenied.PrimaryDBInstanceStatus | The operation is not permitted due to status of primary instance. | 操作失败,无法迁移专属集群内非运行状态的RDS实例。 |
403 | InvalidReadStorageTypePattern | The storage type of the primary instance and the read-only instance do not match. | 主实例和只读实例的存储类型不匹配。 |
403 | IncorrectCharacterType | Current DB instance character type does not support this operation. | 当前实例字符类型不支持此操作。 |
403 | OrderStatus.UnPaid | The specified db instance has unpaid order. | 实例当前存在未支付订单,请支付后重试。 |
404 | IncorrectDBInstanceConnType | Current DB instance conn type does not support this operation. | 当前数据库实例的连接类型不支持此操作。 |
404 | InvalidDBInstance.NotFound | The specified instance does not exist or is not supported. | 没有找到指定的实例,请检查实例的正确性。 |
500 | CannotDecreaseEssdPerfLevel | cannot decrease cloud essd performance level. | 存储类型变更校验失败,SQL Server云盘实例只能转为云盘,SSD只能升级到SSD或ESSD。 |
500 | InvalidEssdStorageSize | invalid cloud essd storage size. | 云盘存储规格有误,请检查存储规格配置。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-04-18 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2024-01-04 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-11-23 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-11-21 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-11-07 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-09-11 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-08-10 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-06-02 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-04-20 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-04-07 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2022-09-01 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2021-09-13 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 看变更集 | ||||||||||||||||
|