/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.opensearch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Container for the cluster configuration of an OpenSearch Service domain. For more information, see Creating and * managing Amazon OpenSearch Service domains. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ClusterConfig implements Serializable, Cloneable, StructuredPojo { /** ** Instance type of data nodes in the cluster. *
*/ private String instanceType; /** ** Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you receive a * validation exception. *
*/ private Integer instanceCount; /** *
* Indicates whether dedicated master nodes are enabled for the cluster.True
if the cluster will use a
* dedicated master node.False
if the cluster will not.
*
* Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. *
*/ private Boolean zoneAwarenessEnabled; /** *
* Container for zone awareness configuration options. Only required if ZoneAwarenessEnabled
is
* true
.
*
* OpenSearch Service instance type of the dedicated master nodes in the cluster. *
*/ private String dedicatedMasterType; /** ** Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise you * receive a validation exception. *
*/ private Integer dedicatedMasterCount; /** ** Whether to enable warm storage for the cluster. *
*/ private Boolean warmEnabled; /** ** The instance type for the cluster's warm nodes. *
*/ private String warmType; /** ** The number of warm nodes in the cluster. *
*/ private Integer warmCount; /** ** Container for cold storage configuration options. *
*/ private ColdStorageOptions coldStorageOptions; /** ** A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, see Configuring a * multi-AZ domain in Amazon OpenSearch Service. *
*/ private Boolean multiAZWithStandbyEnabled; /** ** Instance type of data nodes in the cluster. *
* * @param instanceType * Instance type of data nodes in the cluster. * @see OpenSearchPartitionInstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** ** Instance type of data nodes in the cluster. *
* * @return Instance type of data nodes in the cluster. * @see OpenSearchPartitionInstanceType */ public String getInstanceType() { return this.instanceType; } /** ** Instance type of data nodes in the cluster. *
* * @param instanceType * Instance type of data nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. * @see OpenSearchPartitionInstanceType */ public ClusterConfig withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** ** Instance type of data nodes in the cluster. *
* * @param instanceType * Instance type of data nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. * @see OpenSearchPartitionInstanceType */ public ClusterConfig withInstanceType(OpenSearchPartitionInstanceType instanceType) { this.instanceType = instanceType.toString(); return this; } /** ** Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you receive a * validation exception. *
* * @param instanceCount * Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you receive * a validation exception. */ public void setInstanceCount(Integer instanceCount) { this.instanceCount = instanceCount; } /** ** Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you receive a * validation exception. *
* * @return Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you * receive a validation exception. */ public Integer getInstanceCount() { return this.instanceCount; } /** ** Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you receive a * validation exception. *
* * @param instanceCount * Number of dedicated master nodes in the cluster. This number must be greater than 1, otherwise you receive * a validation exception. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withInstanceCount(Integer instanceCount) { setInstanceCount(instanceCount); return this; } /** *
* Indicates whether dedicated master nodes are enabled for the cluster.True
if the cluster will use a
* dedicated master node.False
if the cluster will not.
*
True
if the cluster will
* use a dedicated master node.False
if the cluster will not.
*/
public void setDedicatedMasterEnabled(Boolean dedicatedMasterEnabled) {
this.dedicatedMasterEnabled = dedicatedMasterEnabled;
}
/**
*
* Indicates whether dedicated master nodes are enabled for the cluster.True
if the cluster will use a
* dedicated master node.False
if the cluster will not.
*
True
if the cluster
* will use a dedicated master node.False
if the cluster will not.
*/
public Boolean getDedicatedMasterEnabled() {
return this.dedicatedMasterEnabled;
}
/**
*
* Indicates whether dedicated master nodes are enabled for the cluster.True
if the cluster will use a
* dedicated master node.False
if the cluster will not.
*
True
if the cluster will
* use a dedicated master node.False
if the cluster will not.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfig withDedicatedMasterEnabled(Boolean dedicatedMasterEnabled) {
setDedicatedMasterEnabled(dedicatedMasterEnabled);
return this;
}
/**
*
* Indicates whether dedicated master nodes are enabled for the cluster.True
if the cluster will use a
* dedicated master node.False
if the cluster will not.
*
True
if the cluster
* will use a dedicated master node.False
if the cluster will not.
*/
public Boolean isDedicatedMasterEnabled() {
return this.dedicatedMasterEnabled;
}
/**
* * Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. *
* * @param zoneAwarenessEnabled * Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. */ public void setZoneAwarenessEnabled(Boolean zoneAwarenessEnabled) { this.zoneAwarenessEnabled = zoneAwarenessEnabled; } /** ** Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. *
* * @return Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. */ public Boolean getZoneAwarenessEnabled() { return this.zoneAwarenessEnabled; } /** ** Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. *
* * @param zoneAwarenessEnabled * Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withZoneAwarenessEnabled(Boolean zoneAwarenessEnabled) { setZoneAwarenessEnabled(zoneAwarenessEnabled); return this; } /** ** Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. *
* * @return Indicates whether multiple Availability Zones are enabled. For more information, see Configuring a multi-AZ domain in Amazon OpenSearch Service. */ public Boolean isZoneAwarenessEnabled() { return this.zoneAwarenessEnabled; } /** *
* Container for zone awareness configuration options. Only required if ZoneAwarenessEnabled
is
* true
.
*
ZoneAwarenessEnabled
is
* true
.
*/
public void setZoneAwarenessConfig(ZoneAwarenessConfig zoneAwarenessConfig) {
this.zoneAwarenessConfig = zoneAwarenessConfig;
}
/**
*
* Container for zone awareness configuration options. Only required if ZoneAwarenessEnabled
is
* true
.
*
ZoneAwarenessEnabled
is
* true
.
*/
public ZoneAwarenessConfig getZoneAwarenessConfig() {
return this.zoneAwarenessConfig;
}
/**
*
* Container for zone awareness configuration options. Only required if ZoneAwarenessEnabled
is
* true
.
*
ZoneAwarenessEnabled
is
* true
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfig withZoneAwarenessConfig(ZoneAwarenessConfig zoneAwarenessConfig) {
setZoneAwarenessConfig(zoneAwarenessConfig);
return this;
}
/**
* * OpenSearch Service instance type of the dedicated master nodes in the cluster. *
* * @param dedicatedMasterType * OpenSearch Service instance type of the dedicated master nodes in the cluster. * @see OpenSearchPartitionInstanceType */ public void setDedicatedMasterType(String dedicatedMasterType) { this.dedicatedMasterType = dedicatedMasterType; } /** ** OpenSearch Service instance type of the dedicated master nodes in the cluster. *
* * @return OpenSearch Service instance type of the dedicated master nodes in the cluster. * @see OpenSearchPartitionInstanceType */ public String getDedicatedMasterType() { return this.dedicatedMasterType; } /** ** OpenSearch Service instance type of the dedicated master nodes in the cluster. *
* * @param dedicatedMasterType * OpenSearch Service instance type of the dedicated master nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. * @see OpenSearchPartitionInstanceType */ public ClusterConfig withDedicatedMasterType(String dedicatedMasterType) { setDedicatedMasterType(dedicatedMasterType); return this; } /** ** OpenSearch Service instance type of the dedicated master nodes in the cluster. *
* * @param dedicatedMasterType * OpenSearch Service instance type of the dedicated master nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. * @see OpenSearchPartitionInstanceType */ public ClusterConfig withDedicatedMasterType(OpenSearchPartitionInstanceType dedicatedMasterType) { this.dedicatedMasterType = dedicatedMasterType.toString(); return this; } /** ** Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise you * receive a validation exception. *
* * @param dedicatedMasterCount * Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise * you receive a validation exception. */ public void setDedicatedMasterCount(Integer dedicatedMasterCount) { this.dedicatedMasterCount = dedicatedMasterCount; } /** ** Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise you * receive a validation exception. *
* * @return Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise * you receive a validation exception. */ public Integer getDedicatedMasterCount() { return this.dedicatedMasterCount; } /** ** Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise you * receive a validation exception. *
* * @param dedicatedMasterCount * Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise * you receive a validation exception. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withDedicatedMasterCount(Integer dedicatedMasterCount) { setDedicatedMasterCount(dedicatedMasterCount); return this; } /** ** Whether to enable warm storage for the cluster. *
* * @param warmEnabled * Whether to enable warm storage for the cluster. */ public void setWarmEnabled(Boolean warmEnabled) { this.warmEnabled = warmEnabled; } /** ** Whether to enable warm storage for the cluster. *
* * @return Whether to enable warm storage for the cluster. */ public Boolean getWarmEnabled() { return this.warmEnabled; } /** ** Whether to enable warm storage for the cluster. *
* * @param warmEnabled * Whether to enable warm storage for the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withWarmEnabled(Boolean warmEnabled) { setWarmEnabled(warmEnabled); return this; } /** ** Whether to enable warm storage for the cluster. *
* * @return Whether to enable warm storage for the cluster. */ public Boolean isWarmEnabled() { return this.warmEnabled; } /** ** The instance type for the cluster's warm nodes. *
* * @param warmType * The instance type for the cluster's warm nodes. * @see OpenSearchWarmPartitionInstanceType */ public void setWarmType(String warmType) { this.warmType = warmType; } /** ** The instance type for the cluster's warm nodes. *
* * @return The instance type for the cluster's warm nodes. * @see OpenSearchWarmPartitionInstanceType */ public String getWarmType() { return this.warmType; } /** ** The instance type for the cluster's warm nodes. *
* * @param warmType * The instance type for the cluster's warm nodes. * @return Returns a reference to this object so that method calls can be chained together. * @see OpenSearchWarmPartitionInstanceType */ public ClusterConfig withWarmType(String warmType) { setWarmType(warmType); return this; } /** ** The instance type for the cluster's warm nodes. *
* * @param warmType * The instance type for the cluster's warm nodes. * @return Returns a reference to this object so that method calls can be chained together. * @see OpenSearchWarmPartitionInstanceType */ public ClusterConfig withWarmType(OpenSearchWarmPartitionInstanceType warmType) { this.warmType = warmType.toString(); return this; } /** ** The number of warm nodes in the cluster. *
* * @param warmCount * The number of warm nodes in the cluster. */ public void setWarmCount(Integer warmCount) { this.warmCount = warmCount; } /** ** The number of warm nodes in the cluster. *
* * @return The number of warm nodes in the cluster. */ public Integer getWarmCount() { return this.warmCount; } /** ** The number of warm nodes in the cluster. *
* * @param warmCount * The number of warm nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withWarmCount(Integer warmCount) { setWarmCount(warmCount); return this; } /** ** Container for cold storage configuration options. *
* * @param coldStorageOptions * Container for cold storage configuration options. */ public void setColdStorageOptions(ColdStorageOptions coldStorageOptions) { this.coldStorageOptions = coldStorageOptions; } /** ** Container for cold storage configuration options. *
* * @return Container for cold storage configuration options. */ public ColdStorageOptions getColdStorageOptions() { return this.coldStorageOptions; } /** ** Container for cold storage configuration options. *
* * @param coldStorageOptions * Container for cold storage configuration options. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withColdStorageOptions(ColdStorageOptions coldStorageOptions) { setColdStorageOptions(coldStorageOptions); return this; } /** ** A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, see Configuring a * multi-AZ domain in Amazon OpenSearch Service. *
* * @param multiAZWithStandbyEnabled * A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, * see Configuring a multi-AZ domain in Amazon OpenSearch Service. */ public void setMultiAZWithStandbyEnabled(Boolean multiAZWithStandbyEnabled) { this.multiAZWithStandbyEnabled = multiAZWithStandbyEnabled; } /** ** A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, see Configuring a * multi-AZ domain in Amazon OpenSearch Service. *
* * @return A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, * see Configuring a multi-AZ domain in Amazon OpenSearch Service. */ public Boolean getMultiAZWithStandbyEnabled() { return this.multiAZWithStandbyEnabled; } /** ** A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, see Configuring a * multi-AZ domain in Amazon OpenSearch Service. *
* * @param multiAZWithStandbyEnabled * A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, * see Configuring a multi-AZ domain in Amazon OpenSearch Service. * @return Returns a reference to this object so that method calls can be chained together. */ public ClusterConfig withMultiAZWithStandbyEnabled(Boolean multiAZWithStandbyEnabled) { setMultiAZWithStandbyEnabled(multiAZWithStandbyEnabled); return this; } /** ** A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, see Configuring a * multi-AZ domain in Amazon OpenSearch Service. *
* * @return A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, * see Configuring a multi-AZ domain in Amazon OpenSearch Service. */ public Boolean isMultiAZWithStandbyEnabled() { return this.multiAZWithStandbyEnabled; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getInstanceType() != null) sb.append("InstanceType: ").append(getInstanceType()).append(","); if (getInstanceCount() != null) sb.append("InstanceCount: ").append(getInstanceCount()).append(","); if (getDedicatedMasterEnabled() != null) sb.append("DedicatedMasterEnabled: ").append(getDedicatedMasterEnabled()).append(","); if (getZoneAwarenessEnabled() != null) sb.append("ZoneAwarenessEnabled: ").append(getZoneAwarenessEnabled()).append(","); if (getZoneAwarenessConfig() != null) sb.append("ZoneAwarenessConfig: ").append(getZoneAwarenessConfig()).append(","); if (getDedicatedMasterType() != null) sb.append("DedicatedMasterType: ").append(getDedicatedMasterType()).append(","); if (getDedicatedMasterCount() != null) sb.append("DedicatedMasterCount: ").append(getDedicatedMasterCount()).append(","); if (getWarmEnabled() != null) sb.append("WarmEnabled: ").append(getWarmEnabled()).append(","); if (getWarmType() != null) sb.append("WarmType: ").append(getWarmType()).append(","); if (getWarmCount() != null) sb.append("WarmCount: ").append(getWarmCount()).append(","); if (getColdStorageOptions() != null) sb.append("ColdStorageOptions: ").append(getColdStorageOptions()).append(","); if (getMultiAZWithStandbyEnabled() != null) sb.append("MultiAZWithStandbyEnabled: ").append(getMultiAZWithStandbyEnabled()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ClusterConfig == false) return false; ClusterConfig other = (ClusterConfig) obj; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false; if (other.getInstanceCount() == null ^ this.getInstanceCount() == null) return false; if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == false) return false; if (other.getDedicatedMasterEnabled() == null ^ this.getDedicatedMasterEnabled() == null) return false; if (other.getDedicatedMasterEnabled() != null && other.getDedicatedMasterEnabled().equals(this.getDedicatedMasterEnabled()) == false) return false; if (other.getZoneAwarenessEnabled() == null ^ this.getZoneAwarenessEnabled() == null) return false; if (other.getZoneAwarenessEnabled() != null && other.getZoneAwarenessEnabled().equals(this.getZoneAwarenessEnabled()) == false) return false; if (other.getZoneAwarenessConfig() == null ^ this.getZoneAwarenessConfig() == null) return false; if (other.getZoneAwarenessConfig() != null && other.getZoneAwarenessConfig().equals(this.getZoneAwarenessConfig()) == false) return false; if (other.getDedicatedMasterType() == null ^ this.getDedicatedMasterType() == null) return false; if (other.getDedicatedMasterType() != null && other.getDedicatedMasterType().equals(this.getDedicatedMasterType()) == false) return false; if (other.getDedicatedMasterCount() == null ^ this.getDedicatedMasterCount() == null) return false; if (other.getDedicatedMasterCount() != null && other.getDedicatedMasterCount().equals(this.getDedicatedMasterCount()) == false) return false; if (other.getWarmEnabled() == null ^ this.getWarmEnabled() == null) return false; if (other.getWarmEnabled() != null && other.getWarmEnabled().equals(this.getWarmEnabled()) == false) return false; if (other.getWarmType() == null ^ this.getWarmType() == null) return false; if (other.getWarmType() != null && other.getWarmType().equals(this.getWarmType()) == false) return false; if (other.getWarmCount() == null ^ this.getWarmCount() == null) return false; if (other.getWarmCount() != null && other.getWarmCount().equals(this.getWarmCount()) == false) return false; if (other.getColdStorageOptions() == null ^ this.getColdStorageOptions() == null) return false; if (other.getColdStorageOptions() != null && other.getColdStorageOptions().equals(this.getColdStorageOptions()) == false) return false; if (other.getMultiAZWithStandbyEnabled() == null ^ this.getMultiAZWithStandbyEnabled() == null) return false; if (other.getMultiAZWithStandbyEnabled() != null && other.getMultiAZWithStandbyEnabled().equals(this.getMultiAZWithStandbyEnabled()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); hashCode = prime * hashCode + ((getDedicatedMasterEnabled() == null) ? 0 : getDedicatedMasterEnabled().hashCode()); hashCode = prime * hashCode + ((getZoneAwarenessEnabled() == null) ? 0 : getZoneAwarenessEnabled().hashCode()); hashCode = prime * hashCode + ((getZoneAwarenessConfig() == null) ? 0 : getZoneAwarenessConfig().hashCode()); hashCode = prime * hashCode + ((getDedicatedMasterType() == null) ? 0 : getDedicatedMasterType().hashCode()); hashCode = prime * hashCode + ((getDedicatedMasterCount() == null) ? 0 : getDedicatedMasterCount().hashCode()); hashCode = prime * hashCode + ((getWarmEnabled() == null) ? 0 : getWarmEnabled().hashCode()); hashCode = prime * hashCode + ((getWarmType() == null) ? 0 : getWarmType().hashCode()); hashCode = prime * hashCode + ((getWarmCount() == null) ? 0 : getWarmCount().hashCode()); hashCode = prime * hashCode + ((getColdStorageOptions() == null) ? 0 : getColdStorageOptions().hashCode()); hashCode = prime * hashCode + ((getMultiAZWithStandbyEnabled() == null) ? 0 : getMultiAZWithStandbyEnabled().hashCode()); return hashCode; } @Override public ClusterConfig clone() { try { return (ClusterConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.opensearch.model.transform.ClusterConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }