调用ModifyDBInstanceEndpoint接口修改实例Endpoint信息。
背景信息
- 仅支持MySQL集群版。
- 修改Endpoint信息是修改Endpoint的公有参数配置,如权重、描述等,针对Endpoint这个维度来进行操作。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | ModifyDBInstanceEndpoint |
系统规定参数。 取值:ModifyDBInstanceEndpoint。 |
| ClientToken | String | 否 | 6000170000591aed949d0f**** |
该参数用于保证请求的幂等性,防止重复提交请求。参数值由客户端生成,保证在不同请求间唯一。 该参数值由ASCII字符组成,最长不超过64个字符,不能包含非ASCII字符。 |
| DBInstanceId | String | 是 | rm-**** |
实例ID。可调用DescribeDBInstances查询。 |
| DBInstanceEndpointId | String | 是 | ep-**** |
实例的Endpoint ID。可调用DescribeDBInstanceEndpoints查询。 |
| DBInstanceEndpointDescription | String | 否 | for readonly business |
用户自定义的Endpoint描述。 |
| NodeItems | Array | 否 |
Endpoint节点相关信息。 |
|
| DBInstanceId | String | 否 | rm-**** |
实例ID。可调用DescribeDBInstances查询。 |
| NodeId | String | 否 | rn-xxxx-**** |
节点ID。 可以通过以下方式查询节点ID:
|
| Weight | Long | 否 | 50 |
节点当前权重取值,按照该取值分配读流量。 取值范围:0~100 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| Data | Object |
返回字段列表。 |
|
| DBInstanceName | String | rm-**** |
实例ID。 |
| DBInstanceEndpointId | String | ep-**** |
实例的Endpoint ID。 |
| RequestId | String | F2911788-25E8-42E5-A3A3-1B38D263F01E |
请求ID。 |
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=ModifyDBInstanceEndpoint
&ClientToken=6000170000591aed949d0f****
&DBInstanceId=rm-****
&DBInstanceEndpointId=ep-****
&DBInstanceEndpointDescription=for readonly business
&NodeItems=[{"DBInstanceId":"rm-****","NodeId":"rn-xxxx-****","Weight":50}]
&公共请求参数
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDBInstanceEndpointResponse>
<Data>
<DBInstanceName>rm-****</DBInstanceName>
<DBInstanceEndpointId>ep-****</DBInstanceEndpointId>
</Data>
<RequestId>F2911788-25E8-42E5-A3A3-1B38D263F01E</RequestId>
</ModifyDBInstanceEndpointResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"Data" : {
"DBInstanceName" : "rm-****",
"DBInstanceEndpointId" : "ep-****"
},
"RequestId" : "F2911788-25E8-42E5-A3A3-1B38D263F01E"
}
错误码
| HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 400 | InvalidSourceCategory | specified source category is invalid. | 指定的源类别无效。 |
| 400 | InvalidDBInstanceConnType.Format | Specified DB instance conn type is not valid. | 操作失败,当前数据库实例的连接类型不支持此操作。 |
| 400 | APICallingFailed | Meta db calling failed. | API调用异常。 |
| 400 | InvalidNodeItems.JsonFormat | NodeItems is not a json string. | NodeItems要求是一个JSON字符串。 |
| 400 | EmptyEndpointNodeConfig | Specified endpoint has no nodes, add node to endpoint first. | endpoint下没有挂任何节点,请先给endpoint添加节点。 |
| 403 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
| 404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | 操作失败,实例处于锁定状态。 |
| 404 | InvalidDBInstanceName.NotFound | Invalid DBInstanceId NotFound. | 数据库实例ID不存在,请检查。 |
| 404 | Endpoint.NotFound | Specified endpoint is not existed. | 目标的endpoint不存在。 |
| 404 | InvalidConnectionString.NotFound | Specified connection string or net type is not found. | 连接串不存在。请检查连接串是否正确。 |
| 404 | InvalidWeight.Format | The Specified Weight format is not valid. | 无效的权重范围。 |
| 404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | 指定的实例不存在指定的实例被删除或者实例不支持当前操作。 |
访问错误中心查看更多错误码。