Modifies the attributes of a specified PolarDB cluster endpoint. For example, you can modify the following attributes for the specified cluster endpoint: read/write mode, consistency level, transaction splitting, primary node accepts read requests, and connection pool. You can also call the operation to specify whether newly added nodes are automatically associated with the specified cluster endpoint.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyDBClusterEndpoint | The operation that you want to perform. Set the value to ModifyDBClusterEndpoint. |
DBClusterId | String | Yes | pc-************* | The ID of the cluster. |
DBEndpointId | String | Yes | pe-************** | The ID of the endpoint. |
Nodes | String | No | pi-**************,pi-************* | The reader nodes to be associated with the endpoint. If you need to specify multiple reader nodes, separate the reader nodes with commas (,). If you do not specify this parameter, the predefined nodes are used by default. Note
|
ReadWriteMode | String | No | ReadWrite | The read/write mode. Valid values:
|
AutoAddNewNodes | String | No | Enable | Specifies whether to automatically associate newly added nodes with the cluster endpoint. Default value: Disable. Valid values:
|
EndpointConfig | String | No | {"ConsistLevel":"1","DistributedTransaction":"on","MasterAcceptReads":"off","ConnectionPersist": "on"} | The advanced configurations of the cluster endpoint, which are in the JSON format. You can specify the configurations of the following attributes: consistency level, transaction splitting, connection pool, and primary node accepts read requests.
Note
|
DBEndpointDescription | String | No | test | The name of the endpoint. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | CD3FA5F3-FAF3-44CA-AFFF-BAF869****** | The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=ModifyDBClusterEndpoint
&DBClusterId=pc-*************
&DBEndpointId=pe-**************
&Nodes=pi-**************,pi-*************
&ReadWriteMode=ReadWrite
&AutoAddNewNodes=Enable
&EndpointConfig={"ConsistLevel":"1","DistributedTransaction":"on","MasterAcceptReads":"off","ConnectionPersist": "on"}
&DBEndpointDescription=test
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDBClusterEndpointResponse>
<RequestId>CD3FA5F3-FAF3-44CA-AFFF-BAF869******</RequestId>
</ModifyDBClusterEndpointResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CD3FA5F3-FAF3-44CA-AFFF-BAF869******"
}
Error codes
Http status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidEndpointConfig.Malformed | The specified parameter EndpointConfig is not valid. | The error message returned because the specified EndpointConfig parameter is invalid. |
400 | InvalidDBEndpointId.Malformed | The specified parameter DBEndpointId is not valid. | The error message returned because the specified DBEndpointId parameter is invalid. |
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The error message returned because the specified DBClusterId does not exist. |
404 | EndpointStatus.NotSupport | Current endpoint status does not support this operation. | The error message returned because this operation is not supported while the node is in the current state. |
For a list of error codes, see Service error codes.