调用ModifyDBProxyEndpoint接口修改RDS实例独享代理终端设置。
RDS提供数据库独享代理服务,包括读写分离、连接池等能力。详情请参见数据库独享代理。
调用该接口时,实例必须满足以下条件:
- 实例已开通数据库独享代理功能。
- 实例版本如下:
- MySQL 8.0三节点企业版(内核小版本20191204或以上)
- MySQL 8.0高可用版(内核小版本20190915或以上)
- MySQL 5.7三节点企业版(内核小版本20191128或以上)
- MySQL 5.7高可用版(内核小版本20190925或以上)
- MySQL 5.6高可用版(内核小版本20200229或以上)
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyDBProxyEndpoint |
系统规定参数,取值:ModifyDBProxyEndpoint。 |
DBInstanceId | String | 是 | rm-bp145737x5bi6**** |
实例ID。 |
DBProxyEndpointId | String | 是 | gos787jog2wk0y**** |
代理连接地址ID。可以通过接口DescribeDBProxyEndpoint查看。 说明 当DbEndpointOperator取值为Delete或Modify时,本参数必须传入。
|
ConfigDBProxyFeatures | String | 否 | ReadWriteSpliting:1;ConnectionPersist:0; |
设置代理连接地址想要开通的独享代理功能,各功能之间以英文分号(;)隔开。格式: 功能取值:
开通情况取值:
|
RegionId | String | 否 | cn-hangzhou |
地域ID,可以通过接口DescribeRegions查看地域ID。 |
ReadOnlyInstanceMaxDelayTime | String | 否 | 30 |
读写分离的延迟阈值,当只读实例延迟时间超过该阈值时,读取流量不发往该实例,单位:秒。不传该参数则保持原值。取值:30~3600。默认值:30。 说明 开通读写分离时才需要传入该参数。
|
ReadOnlyInstanceDistributionType | String | 否 | Standard |
读权重分配模式,详情请参见读权重分配。取值:
说明 开通读写分离时才需要传入该参数。
|
ReadOnlyInstanceWeight | String | 否 | {“rm-uf6wjk5xxxx“:”500”,”rr-tfhfgk5xxx”:”200”...} |
自定义读权重分配,即传入主实例和只读实例的读请求权重。以100递增,最大值为10000,格式: 说明 当ReadOnlyInstanceDistributionType取值为Custom时,您需要传入本参数。
|
DbEndpointOperator | String | 否 | Modify |
操作类型,取值:
|
DbEndpointAliases | String | 否 | test-proxy |
代理终端的备注信息。 |
DbEndpointType | String | 否 | RWSplit |
代理终端的类型,保留参数,无需设置。 |
DbEndpointReadWriteMode | String | 否 | ReadWrite |
读写类型,取值:
说明
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 6B50D92C-1960-4D4F-A290-AFADD6B1A5C8 |
请求ID。 |
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=ModifyDBProxyEndpoint
&DBInstanceId=rm-bp145737x5bi6****
&DBProxyEndpointId=gos787jog2wk0y****
&ConfigDBProxyFeatures=ReadWriteSpliting:1;ConnectionPersist:1;
&ReadOnlyInstanceMaxDelayTime=30
&ReadOnlyInstanceDistributionType=Standard
&<公共请求参数>
正常返回示例
XML
格式
<ModifyDBProxyEndpointResponse>
<RequestId>6B50D92C-1960-4D4F-A290-AFADD6B1A5C8</RequestId>
</ModifyDBProxyEndpointResponse>
JSON
格式
{
"RequestId": "6B50D92C-1960-4D4F-A290-AFADD6B1A5C8"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | EndpointConfig.Invalid | Please check the endpoint config parameter. | 请检查endpoint配置参数,部分参数不符合要求。 |
403 | MaxScaleLevel.NotSupport | The current maxscale ins_num does not support this operation. | 当前数据库代理规格 不支持此操作 |
404 | Readins.NotFound | The current instance does not contain any read only instance. The operation is not supported. | 当前实例不存在只读实例,不支持此操作! |
403 | ReadDBInstance.NotFound | The current database instance does not contain any read only instance. | 当前数据库实例没有只读实例 |
403 | IncorrectKindCode | The current KindCode of the custins does not support the operation. | 当前实例所属环境类型 不支持此操作,请检查接口支持的实例类型! |
400 | InvalidVpcInstanceId | The specified VPC instance ID is invalid. | 指定的专有网络实例id无效 |
404 | Endpoint.NotFound | Specified endpoint is not found. | 找不到指定的终结点 |
400 | InvalidEndPoint.Format | The specified EndPoint is not valid. | 当前参数endpoint 是无效的或者不存在, 请检查endpoint参数 |
400 | InvalidEndpointType.Format | The specified EndpointType is invalid. | 指定的EndpointType无效 |
400 | IncorrectDBInstanceNetType | The current database instance network type does not support the operation. | 当前数据库实例网络类型不支持此操作 |
403 | IncorrectDBInstanceState | The current database instance state does not support the operation. | 当前数据库实例状态不支持此操作 |
400 | EndpointNum.Error | The number of endpoint is invalid. | 当前终端数量不符合要求,请检查支持的终端数量。 |
404 | EndpointType.NotFound | The specified endpoint type is not found. | 未知的代理终端类型,不支持此操作,请检查终端类型。 |
400 | EndpointTypeOperation.NotSupport | The endpoint type does not support the operation. | 当前终端类型不支持此操作,请检查代理终端类型。 |
访问错误中心查看更多错误码。