/* * 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.eks.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateNodegroupVersionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the Amazon EKS cluster that is associated with the managed node group to update. *

*/ private String clusterName; /** *

* The name of the managed node group to update. *

*/ private String nodegroupName; /** *

* The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group * does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI * version of the cluster's Kubernetes version. If you specify launchTemplate, and your launch template * uses a custom AMI, then don't specify version, or the node group update will fail. For more * information about using launch templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

*/ private String version; /** *

* The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI * version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized Amazon * Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support the November * 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized * Windows AMI versions in the Amazon EKS User Guide. *

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify * releaseVersion, or the node group update will fail. For more information about using launch * templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

*/ private String releaseVersion; /** *

* An object representing a node group's launch template specification. You can only update a node group using a * launch template if the node group was originally deployed with a launch template. *

*/ private LaunchTemplateSpecification launchTemplate; /** *

* Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. * If an update fails because pods could not be drained, you can force the update after it fails to terminate the * old node whether or not any pods are running on the node. *

*/ private Boolean force; /** *

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

*/ private String clientRequestToken; /** *

* The name of the Amazon EKS cluster that is associated with the managed node group to update. *

* * @param clusterName * The name of the Amazon EKS cluster that is associated with the managed node group to update. */ public void setClusterName(String clusterName) { this.clusterName = clusterName; } /** *

* The name of the Amazon EKS cluster that is associated with the managed node group to update. *

* * @return The name of the Amazon EKS cluster that is associated with the managed node group to update. */ public String getClusterName() { return this.clusterName; } /** *

* The name of the Amazon EKS cluster that is associated with the managed node group to update. *

* * @param clusterName * The name of the Amazon EKS cluster that is associated with the managed node group to update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withClusterName(String clusterName) { setClusterName(clusterName); return this; } /** *

* The name of the managed node group to update. *

* * @param nodegroupName * The name of the managed node group to update. */ public void setNodegroupName(String nodegroupName) { this.nodegroupName = nodegroupName; } /** *

* The name of the managed node group to update. *

* * @return The name of the managed node group to update. */ public String getNodegroupName() { return this.nodegroupName; } /** *

* The name of the managed node group to update. *

* * @param nodegroupName * The name of the managed node group to update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withNodegroupName(String nodegroupName) { setNodegroupName(nodegroupName); return this; } /** *

* The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group * does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI * version of the cluster's Kubernetes version. If you specify launchTemplate, and your launch template * uses a custom AMI, then don't specify version, or the node group update will fail. For more * information about using launch templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

* * @param version * The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node * group does not change. You can specify the Kubernetes version of the cluster to update the node group to * the latest AMI version of the cluster's Kubernetes version. If you specify launchTemplate, * and your launch template uses a custom AMI, then don't specify version, or the node group * update will fail. For more information about using launch templates with Amazon EKS, see Launch template support * in the Amazon EKS User Guide. */ public void setVersion(String version) { this.version = version; } /** *

* The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group * does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI * version of the cluster's Kubernetes version. If you specify launchTemplate, and your launch template * uses a custom AMI, then don't specify version, or the node group update will fail. For more * information about using launch templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

* * @return The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node * group does not change. You can specify the Kubernetes version of the cluster to update the node group to * the latest AMI version of the cluster's Kubernetes version. If you specify launchTemplate, * and your launch template uses a custom AMI, then don't specify version, or the node group * update will fail. For more information about using launch templates with Amazon EKS, see Launch template support * in the Amazon EKS User Guide. */ public String getVersion() { return this.version; } /** *

* The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group * does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI * version of the cluster's Kubernetes version. If you specify launchTemplate, and your launch template * uses a custom AMI, then don't specify version, or the node group update will fail. For more * information about using launch templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

* * @param version * The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node * group does not change. You can specify the Kubernetes version of the cluster to update the node group to * the latest AMI version of the cluster's Kubernetes version. If you specify launchTemplate, * and your launch template uses a custom AMI, then don't specify version, or the node group * update will fail. For more information about using launch templates with Amazon EKS, see Launch template support * in the Amazon EKS User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withVersion(String version) { setVersion(version); return this; } /** *

* The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI * version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized Amazon * Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support the November * 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized * Windows AMI versions in the Amazon EKS User Guide. *

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify * releaseVersion, or the node group update will fail. For more information about using launch * templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

* * @param releaseVersion * The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available * AMI version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized * Amazon Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support * the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized * Windows AMI versions in the Amazon EKS User Guide.

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify * releaseVersion, or the node group update will fail. For more information about using launch * templates with Amazon EKS, see Launch template support * in the Amazon EKS User Guide. */ public void setReleaseVersion(String releaseVersion) { this.releaseVersion = releaseVersion; } /** *

* The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI * version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized Amazon * Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support the November * 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized * Windows AMI versions in the Amazon EKS User Guide. *

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify * releaseVersion, or the node group update will fail. For more information about using launch * templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

* * @return The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available * AMI version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized * Amazon Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support * the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS * optimized Windows AMI versions in the Amazon EKS User Guide.

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't * specify releaseVersion, or the node group update will fail. For more information about using * launch templates with Amazon EKS, see Launch template support * in the Amazon EKS User Guide. */ public String getReleaseVersion() { return this.releaseVersion; } /** *

* The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI * version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized Amazon * Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support the November * 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized * Windows AMI versions in the Amazon EKS User Guide. *

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify * releaseVersion, or the node group update will fail. For more information about using launch * templates with Amazon EKS, see Launch template support in the * Amazon EKS User Guide. *

* * @param releaseVersion * The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available * AMI version for the node group's Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized * Amazon Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support * the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized * Windows AMI versions in the Amazon EKS User Guide.

*

* If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify * releaseVersion, or the node group update will fail. For more information about using launch * templates with Amazon EKS, see Launch template support * in the Amazon EKS User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withReleaseVersion(String releaseVersion) { setReleaseVersion(releaseVersion); return this; } /** *

* An object representing a node group's launch template specification. You can only update a node group using a * launch template if the node group was originally deployed with a launch template. *

* * @param launchTemplate * An object representing a node group's launch template specification. You can only update a node group * using a launch template if the node group was originally deployed with a launch template. */ public void setLaunchTemplate(LaunchTemplateSpecification launchTemplate) { this.launchTemplate = launchTemplate; } /** *

* An object representing a node group's launch template specification. You can only update a node group using a * launch template if the node group was originally deployed with a launch template. *

* * @return An object representing a node group's launch template specification. You can only update a node group * using a launch template if the node group was originally deployed with a launch template. */ public LaunchTemplateSpecification getLaunchTemplate() { return this.launchTemplate; } /** *

* An object representing a node group's launch template specification. You can only update a node group using a * launch template if the node group was originally deployed with a launch template. *

* * @param launchTemplate * An object representing a node group's launch template specification. You can only update a node group * using a launch template if the node group was originally deployed with a launch template. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withLaunchTemplate(LaunchTemplateSpecification launchTemplate) { setLaunchTemplate(launchTemplate); return this; } /** *

* Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. * If an update fails because pods could not be drained, you can force the update after it fails to terminate the * old node whether or not any pods are running on the node. *

* * @param force * Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget * issue. If an update fails because pods could not be drained, you can force the update after it fails to * terminate the old node whether or not any pods are running on the node. */ public void setForce(Boolean force) { this.force = force; } /** *

* Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. * If an update fails because pods could not be drained, you can force the update after it fails to terminate the * old node whether or not any pods are running on the node. *

* * @return Force the update if the existing node group's pods are unable to be drained due to a pod disruption * budget issue. If an update fails because pods could not be drained, you can force the update after it * fails to terminate the old node whether or not any pods are running on the node. */ public Boolean getForce() { return this.force; } /** *

* Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. * If an update fails because pods could not be drained, you can force the update after it fails to terminate the * old node whether or not any pods are running on the node. *

* * @param force * Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget * issue. If an update fails because pods could not be drained, you can force the update after it fails to * terminate the old node whether or not any pods are running on the node. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withForce(Boolean force) { setForce(force); return this; } /** *

* Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. * If an update fails because pods could not be drained, you can force the update after it fails to terminate the * old node whether or not any pods are running on the node. *

* * @return Force the update if the existing node group's pods are unable to be drained due to a pod disruption * budget issue. If an update fails because pods could not be drained, you can force the update after it * fails to terminate the old node whether or not any pods are running on the node. */ public Boolean isForce() { return this.force; } /** *

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

* * @param clientRequestToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. */ public void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } /** *

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

* * @return Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. */ public String getClientRequestToken() { return this.clientRequestToken; } /** *

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

* * @param clientRequestToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateNodegroupVersionRequest withClientRequestToken(String clientRequestToken) { setClientRequestToken(clientRequestToken); return this; } /** * 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 (getClusterName() != null) sb.append("ClusterName: ").append(getClusterName()).append(","); if (getNodegroupName() != null) sb.append("NodegroupName: ").append(getNodegroupName()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getReleaseVersion() != null) sb.append("ReleaseVersion: ").append(getReleaseVersion()).append(","); if (getLaunchTemplate() != null) sb.append("LaunchTemplate: ").append(getLaunchTemplate()).append(","); if (getForce() != null) sb.append("Force: ").append(getForce()).append(","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: ").append(getClientRequestToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateNodegroupVersionRequest == false) return false; UpdateNodegroupVersionRequest other = (UpdateNodegroupVersionRequest) obj; if (other.getClusterName() == null ^ this.getClusterName() == null) return false; if (other.getClusterName() != null && other.getClusterName().equals(this.getClusterName()) == false) return false; if (other.getNodegroupName() == null ^ this.getNodegroupName() == null) return false; if (other.getNodegroupName() != null && other.getNodegroupName().equals(this.getNodegroupName()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; if (other.getReleaseVersion() == null ^ this.getReleaseVersion() == null) return false; if (other.getReleaseVersion() != null && other.getReleaseVersion().equals(this.getReleaseVersion()) == false) return false; if (other.getLaunchTemplate() == null ^ this.getLaunchTemplate() == null) return false; if (other.getLaunchTemplate() != null && other.getLaunchTemplate().equals(this.getLaunchTemplate()) == false) return false; if (other.getForce() == null ^ this.getForce() == null) return false; if (other.getForce() != null && other.getForce().equals(this.getForce()) == false) return false; if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) return false; if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClusterName() == null) ? 0 : getClusterName().hashCode()); hashCode = prime * hashCode + ((getNodegroupName() == null) ? 0 : getNodegroupName().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getReleaseVersion() == null) ? 0 : getReleaseVersion().hashCode()); hashCode = prime * hashCode + ((getLaunchTemplate() == null) ? 0 : getLaunchTemplate().hashCode()); hashCode = prime * hashCode + ((getForce() == null) ? 0 : getForce().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); return hashCode; } @Override public UpdateNodegroupVersionRequest clone() { return (UpdateNodegroupVersionRequest) super.clone(); } }