最近更新时间:2023.11.15 22:39:52
首次发布时间:2023.11.15 22:39:52
调用 ModifyDBEndpointReadWeight 接口修改终端读权重分配模式,以及自定义权重配比。
说明
仅默认终端支持开启读写分离,因此该接口仅支持对默认终端进行设置。
同步请求。
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
InstanceId | String | 是 | postgres-0af11cd4**** | 实例 ID。 |
EndpointId | String | 是 | postgres-0af11cd4****-cluster | 实例连接终端 ID。 |
ReadOnlyNodeDistributionType | String | 是 | Default | 读权重分配模式。开启读写分离时,即
|
ReadOnlyNodeWeight | Array of ReadOnlyNodeWeightObject | 否 | [ "NodeType" : "Primary", | 自定义读权重分配,即传入主节点和只读节点的读请求权重。以 100 递增,最大值为 40000。 说明
|
null
POST /?Action=ModifyDBEndpointReadWeight&Version=2022-01-01 HTTP/1.1 Content-Type: application/json Host: rds.volcengineapi.com X-Date: 20231002T101010Z Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_postgresql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458**** { "InstanceId": "postgres-0af11cd4****", "EndpointId": "postgres-0af11cd4****-cluster", "ReadOnlyNodeDistributionType":"Custom", "ReadOnlyNodeWeight":[ { "NodeType" : "Primary", "Weight" : 600 }, { "NodeId" : "postgres-c23003b1****-rof359", "NodeType":"ReadOnly", "Weight" : 300 } ] }
{ "ResponseMetadata": { "RequestId": "2023101118285676A8F34389CC270EE9CA", "Action": "ModifyDBEndpointReadWeight", "Version": "2022-01-01", "Service": "rds_postgresql", "Region": "cn-beijing" }, "Result": null }