
com.aliyun.sdk.service.polardb20170801.models.CreateDBClusterEndpointRequest 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 CreateDBClusterEndpointRequest} extends {@link RequestModel}
*
* CreateDBClusterEndpointRequest
*/
public class CreateDBClusterEndpointRequest 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("ClientToken")
private String clientToken;
@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("EndpointConfig")
private String endpointConfig;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("EndpointType")
@com.aliyun.core.annotation.Validation(required = true)
private String endpointType;
@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 CreateDBClusterEndpointRequest(Builder builder) {
super(builder);
this.autoAddNewNodes = builder.autoAddNewNodes;
this.clientToken = builder.clientToken;
this.DBClusterId = builder.DBClusterId;
this.DBEndpointDescription = builder.DBEndpointDescription;
this.endpointConfig = builder.endpointConfig;
this.endpointType = builder.endpointType;
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 CreateDBClusterEndpointRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return autoAddNewNodes
*/
public String getAutoAddNewNodes() {
return this.autoAddNewNodes;
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return DBClusterId
*/
public String getDBClusterId() {
return this.DBClusterId;
}
/**
* @return DBEndpointDescription
*/
public String getDBEndpointDescription() {
return this.DBEndpointDescription;
}
/**
* @return endpointConfig
*/
public String getEndpointConfig() {
return this.endpointConfig;
}
/**
* @return endpointType
*/
public String getEndpointType() {
return this.endpointType;
}
/**
* @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 clientToken;
private String DBClusterId;
private String DBEndpointDescription;
private String endpointConfig;
private String endpointType;
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(CreateDBClusterEndpointRequest request) {
super(request);
this.autoAddNewNodes = request.autoAddNewNodes;
this.clientToken = request.clientToken;
this.DBClusterId = request.DBClusterId;
this.DBEndpointDescription = request.DBEndpointDescription;
this.endpointConfig = request.endpointConfig;
this.endpointType = request.endpointType;
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:
* Disable
*/
public Builder autoAddNewNodes(String autoAddNewNodes) {
this.putQueryParameter("AutoAddNewNodes", autoAddNewNodes);
this.autoAddNewNodes = autoAddNewNodes;
return this;
}
/**
* The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. The token is case-sensitive.
*
* example:
* 6000170000591aed949d0f******************
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* The ID of 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 advanced configurations of the cluster endpoint. You must specify the configurations in the JSON format. You can specify the configurations of the following attributes: consistency level, transaction splitting, connection pool, and offload reads from the primary node.
*
* Specify the consistency level in the format of {"ConsistLevel":"Consistency level"}
. Default value: 1. Valid values:
*
* - 0: eventual consistency.
* - 1: session consistency.
* - 2: global consistency.
*
*
* Specify the transaction splitting feature in the format of {"DistributedTransaction":"Transaction splitting"}
. Valid values:
*
* - on: enables the transaction splitting feature. By default, the feature is enabled.
* - off: disables the transaction splitting feature.
*
*
* Specify the offload reads from the primary node feature in the format of {"MasterAcceptReads":"Offload reads from the primary node"}
. Default value: off. Valid values:
*
* - on: The primary node accepts read requests.
* - off: The primary node does not accept read requests.
*
*
* Specify the connection pool in the format of {"ConnectionPersist":"Connection pool"}
. Default value: off. Valid values:
*
* - off: disables the connection pool.
* - Session: enables the session-level connection pool.
* - Transaction: enables the transaction-level connection pool.
*
*
*
*
*
* - You can specify the transaction splitting, connection pool, and offload reads from the primary node features for a PolarDB for MySQL cluster only if ReadWriteMode is set to ReadWrite for the cluster endpoint.
* - Only PolarDB for MySQL supports global consistency.
* - If the ReadWriteMode parameter is set to ReadOnly, the consistency level must be 0.
* - You can use one record to specify the consistency level, transaction splitting, connection pool, and offload reads from the primary node features, such as
{"ConsistLevel":"1","DistributedTransaction":"on","ConnectionPersist":"Session","MasterAcceptReads":"on"}
.
* - The transaction splitting settings are restricted by the consistency level settings. For example, if you set the consistency level to 0, transaction splitting cannot be enabled. If you set the consistency level to 1 or 2, transaction splitting can be enabled.
*
*
*
* example:
* {"ConsistLevel": "1","DistributedTransaction": "on"}
*/
public Builder endpointConfig(String endpointConfig) {
this.putQueryParameter("EndpointConfig", endpointConfig);
this.endpointConfig = endpointConfig;
return this;
}
/**
* The type of the cluster endpoint. Set the value to Custom.
* This parameter is required.
*
* example:
* Custom
*/
public Builder endpointType(String endpointType) {
this.putQueryParameter("EndpointType", endpointType);
this.endpointType = endpointType;
return this;
}
/**
* The reader nodes that you want to associate with the endpoint. If you want to specify multiple reader nodes, separate the reader nodes with commas (,). If you do not specify this parameter, all nodes are used.
*
*
* - You need to specify the node IDs for a PolarDB for MySQL cluster.
* - You need to specify the role name of each node for a PolarDB for PostgreSQL cluster or a PolarDB for PostgreSQL (Compatible with Oracle) cluster. Example:
Writer, Reader1, Reader2
.
* - If you set ReadWriteMode to ReadOnly, you can associate only one node with the endpoint. If the only node becomes faulty, the cluster endpoint may be unavailable for up to 1 hour. We recommend that you associate more than 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 need to associate at least two nodes with the cluster endpoint.
* - PolarDB for MySQL does not impose a limit on the types of the two nodes. If the nodes are read-only nodes, write requests are forwarded to the primary node.
* - PolarDB for PostgreSQL and PolarDB for PostgreSQL (compatible with Oracle) require a 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 strategy. The value range is as follows:
*
* - 0: Send the request to the primary node
* - 2: Timeout degradation, when a global consistency read times out, the query operation will automatically degrade to an inconsistent read, and the client will not receive an error message
*
*
* 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: receives and forwards read and write requests. Automatic read/write splitting is enabled.
* - ReadOnly: The account has the read-only permissions on the database.
*
* Default value: ReadOnly.
*
* example:
* ReadOnly
*/
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;
}
/**
* Whether the node has enabled the global consistency (high-performance mode) feature. The value range is as follows:
*
* - ON: Enabled - OFF: Disabled
*
*
* example:
* on
*/
public Builder sccMode(String sccMode) {
this.putQueryParameter("SccMode", sccMode);
this.sccMode = sccMode;
return this;
}
@Override
public CreateDBClusterEndpointRequest build() {
return new CreateDBClusterEndpointRequest(this);
}
}
}