
com.aliyun.sdk.service.polardb20170801.models.ModifyDBClusterEndpointRequest Maven / Gradle / Ivy
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.polardb20170801.models;
import com.aliyun.sdk.gateway.pop.*;
import darabonba.core.*;
import darabonba.core.async.*;
import darabonba.core.sync.*;
import darabonba.core.client.*;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
*
* {@link ModifyDBClusterEndpointRequest} extends {@link RequestModel}
*
* ModifyDBClusterEndpointRequest
*/
public class ModifyDBClusterEndpointRequest extends Request {
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("AutoAddNewNodes")
private String autoAddNewNodes;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DBClusterId")
@com.aliyun.core.annotation.Validation(required = true)
private String DBClusterId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DBEndpointDescription")
private String DBEndpointDescription;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DBEndpointId")
@com.aliyun.core.annotation.Validation(required = true)
private String DBEndpointId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("EndpointConfig")
private String endpointConfig;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Nodes")
private String nodes;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerAccount")
private String ownerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerId")
private Long ownerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("PolarSccTimeoutAction")
private String polarSccTimeoutAction;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("PolarSccWaitTimeout")
private String polarSccWaitTimeout;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ReadWriteMode")
private String readWriteMode;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceOwnerAccount")
private String resourceOwnerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceOwnerId")
private Long resourceOwnerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("SccMode")
private String sccMode;
private ModifyDBClusterEndpointRequest(Builder builder) {
super(builder);
this.autoAddNewNodes = builder.autoAddNewNodes;
this.DBClusterId = builder.DBClusterId;
this.DBEndpointDescription = builder.DBEndpointDescription;
this.DBEndpointId = builder.DBEndpointId;
this.endpointConfig = builder.endpointConfig;
this.nodes = builder.nodes;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.polarSccTimeoutAction = builder.polarSccTimeoutAction;
this.polarSccWaitTimeout = builder.polarSccWaitTimeout;
this.readWriteMode = builder.readWriteMode;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.sccMode = builder.sccMode;
}
public static Builder builder() {
return new Builder();
}
public static ModifyDBClusterEndpointRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return autoAddNewNodes
*/
public String getAutoAddNewNodes() {
return this.autoAddNewNodes;
}
/**
* @return DBClusterId
*/
public String getDBClusterId() {
return this.DBClusterId;
}
/**
* @return DBEndpointDescription
*/
public String getDBEndpointDescription() {
return this.DBEndpointDescription;
}
/**
* @return DBEndpointId
*/
public String getDBEndpointId() {
return this.DBEndpointId;
}
/**
* @return endpointConfig
*/
public String getEndpointConfig() {
return this.endpointConfig;
}
/**
* @return nodes
*/
public String getNodes() {
return this.nodes;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return polarSccTimeoutAction
*/
public String getPolarSccTimeoutAction() {
return this.polarSccTimeoutAction;
}
/**
* @return polarSccWaitTimeout
*/
public String getPolarSccWaitTimeout() {
return this.polarSccWaitTimeout;
}
/**
* @return readWriteMode
*/
public String getReadWriteMode() {
return this.readWriteMode;
}
/**
* @return resourceOwnerAccount
*/
public String getResourceOwnerAccount() {
return this.resourceOwnerAccount;
}
/**
* @return resourceOwnerId
*/
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
/**
* @return sccMode
*/
public String getSccMode() {
return this.sccMode;
}
public static final class Builder extends Request.Builder {
private String autoAddNewNodes;
private String DBClusterId;
private String DBEndpointDescription;
private String DBEndpointId;
private String endpointConfig;
private String nodes;
private String ownerAccount;
private Long ownerId;
private String polarSccTimeoutAction;
private String polarSccWaitTimeout;
private String readWriteMode;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private String sccMode;
private Builder() {
super();
}
private Builder(ModifyDBClusterEndpointRequest request) {
super(request);
this.autoAddNewNodes = request.autoAddNewNodes;
this.DBClusterId = request.DBClusterId;
this.DBEndpointDescription = request.DBEndpointDescription;
this.DBEndpointId = request.DBEndpointId;
this.endpointConfig = request.endpointConfig;
this.nodes = request.nodes;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.polarSccTimeoutAction = request.polarSccTimeoutAction;
this.polarSccWaitTimeout = request.polarSccWaitTimeout;
this.readWriteMode = request.readWriteMode;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.sccMode = request.sccMode;
}
/**
* Specifies whether to enable automatic association of newly added nodes with the cluster endpoint. Valid values:
*
* - Enable: enables automatic association of newly added nodes with the cluster endpoint.
* - Disable (default): disables automatic association of newly added nodes with the cluster endpoint.
*
*
* example:
* Enable
*/
public Builder autoAddNewNodes(String autoAddNewNodes) {
this.putQueryParameter("AutoAddNewNodes", autoAddNewNodes);
this.autoAddNewNodes = autoAddNewNodes;
return this;
}
/**
* The ID of the cluster.
* This parameter is required.
*
* example:
* pc-*************
*/
public Builder DBClusterId(String DBClusterId) {
this.putQueryParameter("DBClusterId", DBClusterId);
this.DBClusterId = DBClusterId;
return this;
}
/**
* The name of the custom cluster endpoint.
*
* example:
* test
*/
public Builder DBEndpointDescription(String DBEndpointDescription) {
this.putQueryParameter("DBEndpointDescription", DBEndpointDescription);
this.DBEndpointDescription = DBEndpointDescription;
return this;
}
/**
* The ID of the endpoint.
* This parameter is required.
*
* example:
* pe-**************
*/
public Builder DBEndpointId(String DBEndpointId) {
this.putQueryParameter("DBEndpointId", DBEndpointId);
this.DBEndpointId = DBEndpointId;
return this;
}
/**
* The advanced configurations of the cluster endpoint, which are in the JSON format. You can configure the consistency level, transaction splitting, and connection pool settings, and specify whether the primary node accepts read requests.
*
* The load balancing policy. Format: {\"LoadBalancePolicy\":\"Load balancing policy\"}
. Valid values:
*
* - 0 (default): connections-based load balancing
* - 1: active requests-based load balancing
*
*
* Specifies whether to allow the primary node to accept read requests. Format: {\"MasterAcceptReads\":\"Specification about whether to allow the primary node to accept read requests\"}
. Valid values:
*
* - on (default): allows the primary node to accept read requests.
* - off: does not allow the primary node to accept read requests.
*
*
* Specifies whether to enable the transaction splitting feature. Format: {\"DistributedTransaction\":\"Specification about whether to enable the transaction splitting feature\"}
. Valid values:
*
* - on (default): enables the transaction splitting feature.
* - off: disables the transaction splitting feature.
*
*
* The consistency level. Format: {\"ConsistLevel\":\"Consistency level\"}
. Valid values:
*
* - 0: eventual consistency (weak)
* - 1 (default): session consistency (medium)
* - 2: global consistency (strong)
*
*
* The global consistency timeout. Format: {\"ConsistTimeout\":\"Global consistency timeout\"}
. Valid values: 0 to 60,000. Default value: 20. Unit: ms.
*
* The session consistency timeout. Format: {\"ConsistSessionTimeout\":\"Session consistency timeout\"}
. Valid values: 0 to 60,000. Default value: 0. Unit: ms.
*
* The global (or session) consistency timeout policy. Format: {\"ConsistTimeoutAction\":\"Consistency timeout policy\"}
. Valid values:
*
* - 0 (default): PolarProxy sends read requests to the primary node.
* - 1: PolarProxy returns the "wait replication complete timeout, please retry" error message to the application.
*
*
* Specifies whether to enable the connection pool feature. Format: {\"ConnectionPersist\":\"Specification about whether to enable the connection pool feature\"}
. Valid values:
*
* - off (default): disables the connection pool feature.
* - Session: enables the session-level connection pool.
* - Transaction: enables the transaction-level connection pool.
*
*
* Specifies whether to enable the parallel query feature. Format: {\"MaxParallelDegree\":\"Specification about whether to enable the parallel query feature\"}
. Valid values:
*
* - on: enables the parallel query feature.
* - off (default): disables the parallel query feature.
*
*
* Specifies whether to enable the automatic request distribution among row store and column store nodes feature. Format: {\"EnableHtapImci\":\"Specification about whether to enable automatic request distribution among row store and column store nodes feature\"}
. Valid values:
*
* - on: enables the automatic request distribution among row store and column store nodes feature.
* - off (default): disables the automatic request distribution among row store and column store nodes feature.
*
*
* Specifies whether to enable the overload protection feature. Format: {\"EnableOverloadThrottle\":\"Specification about whether to enable the overload protection feature\"}
. Valid values:
*
* - on: enables the overload protection feature.
* - off (default): disables the overload protection feature.
*
*
*
*
*
*
* You can configure the transaction splitting, connection pool, and overload protection settings, and specify whether the primary node accepts read requests settings for the cluster endpoint of a PolarDB for MySQL cluster only if ReadWriteMode of the cluster endpoint is set to Read and Write (Automatic Read/Write Splitting).
*
* If ReadWriteMode of the cluster endpoint of a PolarDB for MySQL cluster is set to Read-only, you can specify the Connections-based Load Balancing or Active Request-based Load Balancing policy for the cluster endpoint. If ReadWriteMode of the cluster endpoint of a PolarDB for MySQL cluster is set to Read/Write (Automatic Read/Write Splitting), you can specify only the Active Request-based Load Balancing policy for the cluster endpoint.
*
* You can enable automatic request distribution among column store and row store nodes for the cluster endpoint of a PolarDB for MySQL cluster if ReadWriteMode of the cluster endpoint is set to Read and Write (Automatic Read/Write Splitting), or if the ReadWriteMode of the cluster endpoint is set to Read-only and the load balancing policy is set to Active requests-based load balancing.
*
* Only PolarDB for MySQL supports global consistency.
*
* You can set the consistency level of the cluster endpoint of a PolarDB for MySQL cluster only to 0 if ReadWriteMode of the cluster endpoint is set to ReadOnly.
*
* You can configure the settings for the consistency level, transaction splitting, and connection pool features, and specify whether the primary node accepts read requests settings at a time. Example: {\"ConsistLevel\":\"1\",\"DistributedTransaction\":\"on\",\"ConnectionPersist\":\"Session\",\"MasterAcceptReads\":\"on\"}
.
*
* The configuration for transaction splitting is limited by the configuration for the consistency level. For example, if you set the consistency level to 0, you cannot enable transaction splitting. If you set the consistency level to 1 or 2, you can enable transaction splitting.
*
*
*
* example:
* {"ConsistLevel":"1","DistributedTransaction":"on","MasterAcceptReads":"off","ConnectionPersist": "on"}
*/
public Builder endpointConfig(String endpointConfig) {
this.putQueryParameter("EndpointConfig", endpointConfig);
this.endpointConfig = endpointConfig;
return this;
}
/**
* 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.
*
*
*
* You must specify the node ID for each PolarDB for MySQL cluster.
*
* You must specify the role name of each node for each PolarDB for PostgreSQL or PolarDB for Oracle cluster. Example: Writer,Reader1,Reader2
.
*
* If you set ReadWriteMode to ReadOnly, only one node can be associated with the cluster endpoint. If the only node becomes faulty, the cluster endpoint may be unavailable for up to an hour. We recommend that you do not associate only one node with the cluster endpoint in production environments. We recommend that you associate at least two nodes with the cluster endpoint to improve service availability.
*
* If you set ReadWriteMode to ReadWrite, you must associate at least two nodes with the cluster endpoint.
*
* - No limits are imposed on the two nodes that you select for each PolarDB for MySQL cluster. If the two nodes are read-only nodes, write requests are forwarded to the primary node.
* - The following limit applies to PolarDB for PostgreSQL and PolarDB for Oracle clusters: One of the selected nodes must be the primary node.
*
*
*
*
* example:
* pi-**************,pi-*************
*/
public Builder nodes(String nodes) {
this.putQueryParameter("Nodes", nodes);
this.nodes = nodes;
return this;
}
/**
* OwnerAccount.
*/
public Builder ownerAccount(String ownerAccount) {
this.putQueryParameter("OwnerAccount", ownerAccount);
this.ownerAccount = ownerAccount;
return this;
}
/**
* OwnerId.
*/
public Builder ownerId(Long ownerId) {
this.putQueryParameter("OwnerId", ownerId);
this.ownerId = ownerId;
return this;
}
/**
* Global consistency timeout policy. Valid values:
*
* - 0: sends the request to the primary node.
* - 2: downgrades the consistency level of a query to inconsistent read when a global consistent read in the query times out. No error message is returned to the client.
*
*
* example:
* 0
*/
public Builder polarSccTimeoutAction(String polarSccTimeoutAction) {
this.putQueryParameter("PolarSccTimeoutAction", polarSccTimeoutAction);
this.polarSccTimeoutAction = polarSccTimeoutAction;
return this;
}
/**
* Global consistency timeout.
*
* example:
* 100
*/
public Builder polarSccWaitTimeout(String polarSccWaitTimeout) {
this.putQueryParameter("PolarSccWaitTimeout", polarSccWaitTimeout);
this.polarSccWaitTimeout = polarSccWaitTimeout;
return this;
}
/**
* The read/write mode. Valid values:
*
* - ReadWrite: The cluster endpoint handles read and write requests. Automatic read/write splitting is enabled.
* - ReadOnly: The cluster endpoint handles read-only requests.
*
*
* example:
* ReadWrite
*/
public Builder readWriteMode(String readWriteMode) {
this.putQueryParameter("ReadWriteMode", readWriteMode);
this.readWriteMode = readWriteMode;
return this;
}
/**
* ResourceOwnerAccount.
*/
public Builder resourceOwnerAccount(String resourceOwnerAccount) {
this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount);
this.resourceOwnerAccount = resourceOwnerAccount;
return this;
}
/**
* ResourceOwnerId.
*/
public Builder resourceOwnerId(Long resourceOwnerId) {
this.putQueryParameter("ResourceOwnerId", resourceOwnerId);
this.resourceOwnerId = resourceOwnerId;
return this;
}
/**
* Specifies whether to enable the global consistency (high-performance mode) feature for the nodes. Valid values:
*
* - ON
* - OFF
*
* Valid values:
*
* - on
* - off
*
*
* example:
* on
*/
public Builder sccMode(String sccMode) {
this.putQueryParameter("SccMode", sccMode);
this.sccMode = sccMode;
return this;
}
@Override
public ModifyDBClusterEndpointRequest build() {
return new ModifyDBClusterEndpointRequest(this);
}
}
}