该接口用于为RDS MySQL集群版实例创建Endpoint。
接口说明
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
rds:CreateDBInstanceEndpoint | Write |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ClientToken | string | 否 | 该参数用于保证请求的幂等性,防止重复提交请求。参数值由客户端生成,保证在不同请求间唯一。 该参数值由ASCII字符组成,最长不超过64个字符,不能包含非ASCII字符。 | 6000170000591aed949d0f**** |
DBInstanceId | string | 是 | 实例ID。可调用DescribeDBInstances查询。 | rm-**** |
VpcId | string | 否 | 内网连接的VPC ID。 | vpc-xxxmmxjqqi**** |
VSwitchId | string | 否 | 内网连接的交换机ID。 | vsw-bp1kqp**** |
PrivateIpAddress | string | 否 | 内网连接的IP地址。 | 172.16.XX.XX |
ConnectionStringPrefix | string | 是 | 内网连接地址前缀。 创建Endpoint的同时会自动创建一个内网连接地址,该参数表示内网连接地址的前缀。 | rm-****-ro |
Port | string | 是 | 内网连接端口号。创建内网连接支持自定义端口号。 取值范围:3000~5999 | 3306 |
DBInstanceEndpointType | string | 是 | Endpoint类型,取值含义如下:
| Readonly |
DBInstanceEndpointDescription | string | 否 | 用户自定义的Endpoint描述。 | for readonly business |
NodeItems | object [] | 否 | Endpoint节点相关信息列表。 | |
DBInstanceId | string | 否 | 实例ID。可调用DescribeDBInstances查询。 | rm-**** |
NodeId | string | 否 | 节点ID。 | rn-xxxx-**** |
Weight | long | 否 | 节点当前权重取值,按照该取值分配读流量。 取值范围:0~100 | 50 |
返回参数
示例
正常返回示例
JSON
格式
{
"Data": {
"DBInstanceName": "rm-****",
"DBInstanceEndpointId": "ep-****",
"ConnectionString": "rm-****.mysql.rds.aliyuncs.com"
},
"RequestId": "C8E88DED-533F-4B3C-9207-731FBF394CCA"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidSourceCategory | specified source category is invalid. | 指定的源类别无效。 |
400 | InvalidDBInstanceConnType.Format | Specified DB instance conn type is not valid. | 操作失败,当前数据库实例的连接类型不支持此操作。 |
400 | EndpointNum.Error | The number of endpoint is too many. | Endpoint的数量过多,无法继续创建。 |
400 | InvalidNodeItems.DuplicateNodeId | Duplicate nodeId, please ensure all nodeIds are different. | NodeItems参数中有重复的NodeId。 |
400 | InvalidNodeItems.RONode | ReadOnly endpoint can not contain readonly instance node. | 只读endpoint不能包含只读实例的节点。 |
400 | InvalidNodeItems.RONodeIdPrimary | ReadOnly endpoint can not contain primary node. | 只读endpoint不能包含primary节点。 |
400 | InvalidNodeItems.JsonFormat | NodeItems is not a json string. | NodeItems要求是一个JSON字符串。 |
400 | InvalidNodeItems.DBInstanceId | Specified dbInstanceId is invalid | NodeItems中dbInstanceId是无效的。 |
400 | InvalidNodeItems.NodeId | Specified Node id is invalid | NodeItems中存在NodeId不在集群节点中。 |
400 | EndpointType.NotSupport | Current db type is not support specified endpoint type. | 不支持传入的Endpoint的类型。 |
400 | OtherEndpoint.Exist | Other endpoint already exist. | endpoint已存在。 |
400 | InvalidPort.Malformed | Specified port is not valid. | 指定的端口无效。 |
400 | APICallingFailed | Api called failed, please check vpc vsw vip | 接口调用失败,请检查VPC、VSW、VIP等参数。 |
400 | InvalidDBInstanceName.NotFound | The specified DB instance name does not exist. | 数据库实例名称不存在,请检查。 |
403 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | 当前实例状态不支持此操作。 |
403 | InvalidConnVPCId | Specified conn vpc id is not valid. | 指定的连接专有网络ID无效。 |
403 | InvalidVswitchId | Specified conn vswitch id is not valid. | 指定的VSwitchId格式不正确或为空 |
404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | 操作失败,实例处于锁定状态。 |
404 | InvalidConnectionString.NotFound | Specified connection string or net type is not found. | 连接串不存在。请检查连接串是否正确。 |
404 | InvalidConnectionString.Duplicate | Specified connection string already exists in the Aliyun RDS. | 链接地址名重复,请重新设置连接字符串。 |
404 | InvalidWeight.Format | The Specified Weight format is not valid. | 无效的权重范围。 |
404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | 指定的实例不存在指定的实例被删除或者实例不支持当前操作。 |
访问错误中心查看更多错误码。