/* * 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.batch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* The properties for the pod. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EksPodProperties implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the service account that's used to run the pod. For more information, see Kubernetes service accounts and * Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service * accounts for pods in the Kubernetes documentation. *

*/ private String serviceAccountName; /** *

* Indicates if the pod uses the hosts' network IP address. The default value is true. Setting this to * false enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don't * require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and * Pod networking in the * Kubernetes documentation. *

*/ private Boolean hostNetwork; /** *

* The DNS policy for the pod. The default value is ClusterFirst. If the hostNetwork * parameter is not specified, the default is ClusterFirstWithHostNet. ClusterFirst * indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the * upstream nameserver inherited from the node. For more information, see Pod's DNS * policy in the Kubernetes documentation. *

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet *

*/ private String dnsPolicy; /** *

* The properties of the container that's used on the Amazon EKS pod. *

*/ private java.util.List containers; /** *

* Specifies the volumes for a job definition that uses Amazon EKS resources. *

*/ private java.util.List volumes; /** *

* Metadata about the Kubernetes pod. For more information, see Understanding * Kubernetes Objects in the Kubernetes documentation. *

*/ private EksMetadata metadata; /** *

* The name of the service account that's used to run the pod. For more information, see Kubernetes service accounts and * Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service * accounts for pods in the Kubernetes documentation. *

* * @param serviceAccountName * The name of the service account that's used to run the pod. For more information, see Kubernetes service * accounts and Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure * service accounts for pods in the Kubernetes documentation. */ public void setServiceAccountName(String serviceAccountName) { this.serviceAccountName = serviceAccountName; } /** *

* The name of the service account that's used to run the pod. For more information, see Kubernetes service accounts and * Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service * accounts for pods in the Kubernetes documentation. *

* * @return The name of the service account that's used to run the pod. For more information, see Kubernetes service * accounts and Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure * service accounts for pods in the Kubernetes documentation. */ public String getServiceAccountName() { return this.serviceAccountName; } /** *

* The name of the service account that's used to run the pod. For more information, see Kubernetes service accounts and * Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service * accounts for pods in the Kubernetes documentation. *

* * @param serviceAccountName * The name of the service account that's used to run the pod. For more information, see Kubernetes service * accounts and Configure a * Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure * service accounts for pods in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withServiceAccountName(String serviceAccountName) { setServiceAccountName(serviceAccountName); return this; } /** *

* Indicates if the pod uses the hosts' network IP address. The default value is true. Setting this to * false enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don't * require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and * Pod networking in the * Kubernetes documentation. *

* * @param hostNetwork * Indicates if the pod uses the hosts' network IP address. The default value is true. Setting * this to false enables the Kubernetes pod networking model. Most Batch workloads are * egress-only and don't require the overhead of IP allocation for each pod for incoming connections. For * more information, see Host * namespaces and Pod * networking in the Kubernetes documentation. */ public void setHostNetwork(Boolean hostNetwork) { this.hostNetwork = hostNetwork; } /** *

* Indicates if the pod uses the hosts' network IP address. The default value is true. Setting this to * false enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don't * require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and * Pod networking in the * Kubernetes documentation. *

* * @return Indicates if the pod uses the hosts' network IP address. The default value is true. Setting * this to false enables the Kubernetes pod networking model. Most Batch workloads are * egress-only and don't require the overhead of IP allocation for each pod for incoming connections. For * more information, see Host * namespaces and Pod * networking in the Kubernetes documentation. */ public Boolean getHostNetwork() { return this.hostNetwork; } /** *

* Indicates if the pod uses the hosts' network IP address. The default value is true. Setting this to * false enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don't * require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and * Pod networking in the * Kubernetes documentation. *

* * @param hostNetwork * Indicates if the pod uses the hosts' network IP address. The default value is true. Setting * this to false enables the Kubernetes pod networking model. Most Batch workloads are * egress-only and don't require the overhead of IP allocation for each pod for incoming connections. For * more information, see Host * namespaces and Pod * networking in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withHostNetwork(Boolean hostNetwork) { setHostNetwork(hostNetwork); return this; } /** *

* Indicates if the pod uses the hosts' network IP address. The default value is true. Setting this to * false enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don't * require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and * Pod networking in the * Kubernetes documentation. *

* * @return Indicates if the pod uses the hosts' network IP address. The default value is true. Setting * this to false enables the Kubernetes pod networking model. Most Batch workloads are * egress-only and don't require the overhead of IP allocation for each pod for incoming connections. For * more information, see Host * namespaces and Pod * networking in the Kubernetes documentation. */ public Boolean isHostNetwork() { return this.hostNetwork; } /** *

* The DNS policy for the pod. The default value is ClusterFirst. If the hostNetwork * parameter is not specified, the default is ClusterFirstWithHostNet. ClusterFirst * indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the * upstream nameserver inherited from the node. For more information, see Pod's DNS * policy in the Kubernetes documentation. *

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet *

* * @param dnsPolicy * The DNS policy for the pod. The default value is ClusterFirst. If the * hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet. * ClusterFirst indicates that any DNS query that does not match the configured cluster domain * suffix is forwarded to the upstream nameserver inherited from the node. For more information, see Pod's DNS * policy in the Kubernetes documentation.

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet */ public void setDnsPolicy(String dnsPolicy) { this.dnsPolicy = dnsPolicy; } /** *

* The DNS policy for the pod. The default value is ClusterFirst. If the hostNetwork * parameter is not specified, the default is ClusterFirstWithHostNet. ClusterFirst * indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the * upstream nameserver inherited from the node. For more information, see Pod's DNS * policy in the Kubernetes documentation. *

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet *

* * @return The DNS policy for the pod. The default value is ClusterFirst. If the * hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet. * ClusterFirst indicates that any DNS query that does not match the configured cluster domain * suffix is forwarded to the upstream nameserver inherited from the node. For more information, see Pod's * DNS policy in the Kubernetes documentation.

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet */ public String getDnsPolicy() { return this.dnsPolicy; } /** *

* The DNS policy for the pod. The default value is ClusterFirst. If the hostNetwork * parameter is not specified, the default is ClusterFirstWithHostNet. ClusterFirst * indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the * upstream nameserver inherited from the node. For more information, see Pod's DNS * policy in the Kubernetes documentation. *

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet *

* * @param dnsPolicy * The DNS policy for the pod. The default value is ClusterFirst. If the * hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet. * ClusterFirst indicates that any DNS query that does not match the configured cluster domain * suffix is forwarded to the upstream nameserver inherited from the node. For more information, see Pod's DNS * policy in the Kubernetes documentation.

*

* Valid values: Default | ClusterFirst | ClusterFirstWithHostNet * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withDnsPolicy(String dnsPolicy) { setDnsPolicy(dnsPolicy); return this; } /** *

* The properties of the container that's used on the Amazon EKS pod. *

* * @return The properties of the container that's used on the Amazon EKS pod. */ public java.util.List getContainers() { return containers; } /** *

* The properties of the container that's used on the Amazon EKS pod. *

* * @param containers * The properties of the container that's used on the Amazon EKS pod. */ public void setContainers(java.util.Collection containers) { if (containers == null) { this.containers = null; return; } this.containers = new java.util.ArrayList(containers); } /** *

* The properties of the container that's used on the Amazon EKS pod. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setContainers(java.util.Collection)} or {@link #withContainers(java.util.Collection)} if you want to * override the existing values. *

* * @param containers * The properties of the container that's used on the Amazon EKS pod. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withContainers(EksContainer... containers) { if (this.containers == null) { setContainers(new java.util.ArrayList(containers.length)); } for (EksContainer ele : containers) { this.containers.add(ele); } return this; } /** *

* The properties of the container that's used on the Amazon EKS pod. *

* * @param containers * The properties of the container that's used on the Amazon EKS pod. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withContainers(java.util.Collection containers) { setContainers(containers); return this; } /** *

* Specifies the volumes for a job definition that uses Amazon EKS resources. *

* * @return Specifies the volumes for a job definition that uses Amazon EKS resources. */ public java.util.List getVolumes() { return volumes; } /** *

* Specifies the volumes for a job definition that uses Amazon EKS resources. *

* * @param volumes * Specifies the volumes for a job definition that uses Amazon EKS resources. */ public void setVolumes(java.util.Collection volumes) { if (volumes == null) { this.volumes = null; return; } this.volumes = new java.util.ArrayList(volumes); } /** *

* Specifies the volumes for a job definition that uses Amazon EKS resources. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setVolumes(java.util.Collection)} or {@link #withVolumes(java.util.Collection)} if you want to override * the existing values. *

* * @param volumes * Specifies the volumes for a job definition that uses Amazon EKS resources. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withVolumes(EksVolume... volumes) { if (this.volumes == null) { setVolumes(new java.util.ArrayList(volumes.length)); } for (EksVolume ele : volumes) { this.volumes.add(ele); } return this; } /** *

* Specifies the volumes for a job definition that uses Amazon EKS resources. *

* * @param volumes * Specifies the volumes for a job definition that uses Amazon EKS resources. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withVolumes(java.util.Collection volumes) { setVolumes(volumes); return this; } /** *

* Metadata about the Kubernetes pod. For more information, see Understanding * Kubernetes Objects in the Kubernetes documentation. *

* * @param metadata * Metadata about the Kubernetes pod. For more information, see Understanding * Kubernetes Objects in the Kubernetes documentation. */ public void setMetadata(EksMetadata metadata) { this.metadata = metadata; } /** *

* Metadata about the Kubernetes pod. For more information, see Understanding * Kubernetes Objects in the Kubernetes documentation. *

* * @return Metadata about the Kubernetes pod. For more information, see Understanding Kubernetes Objects in the Kubernetes documentation. */ public EksMetadata getMetadata() { return this.metadata; } /** *

* Metadata about the Kubernetes pod. For more information, see Understanding * Kubernetes Objects in the Kubernetes documentation. *

* * @param metadata * Metadata about the Kubernetes pod. For more information, see Understanding * Kubernetes Objects in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodProperties withMetadata(EksMetadata metadata) { setMetadata(metadata); 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 (getServiceAccountName() != null) sb.append("ServiceAccountName: ").append(getServiceAccountName()).append(","); if (getHostNetwork() != null) sb.append("HostNetwork: ").append(getHostNetwork()).append(","); if (getDnsPolicy() != null) sb.append("DnsPolicy: ").append(getDnsPolicy()).append(","); if (getContainers() != null) sb.append("Containers: ").append(getContainers()).append(","); if (getVolumes() != null) sb.append("Volumes: ").append(getVolumes()).append(","); if (getMetadata() != null) sb.append("Metadata: ").append(getMetadata()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EksPodProperties == false) return false; EksPodProperties other = (EksPodProperties) obj; if (other.getServiceAccountName() == null ^ this.getServiceAccountName() == null) return false; if (other.getServiceAccountName() != null && other.getServiceAccountName().equals(this.getServiceAccountName()) == false) return false; if (other.getHostNetwork() == null ^ this.getHostNetwork() == null) return false; if (other.getHostNetwork() != null && other.getHostNetwork().equals(this.getHostNetwork()) == false) return false; if (other.getDnsPolicy() == null ^ this.getDnsPolicy() == null) return false; if (other.getDnsPolicy() != null && other.getDnsPolicy().equals(this.getDnsPolicy()) == false) return false; if (other.getContainers() == null ^ this.getContainers() == null) return false; if (other.getContainers() != null && other.getContainers().equals(this.getContainers()) == false) return false; if (other.getVolumes() == null ^ this.getVolumes() == null) return false; if (other.getVolumes() != null && other.getVolumes().equals(this.getVolumes()) == false) return false; if (other.getMetadata() == null ^ this.getMetadata() == null) return false; if (other.getMetadata() != null && other.getMetadata().equals(this.getMetadata()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getServiceAccountName() == null) ? 0 : getServiceAccountName().hashCode()); hashCode = prime * hashCode + ((getHostNetwork() == null) ? 0 : getHostNetwork().hashCode()); hashCode = prime * hashCode + ((getDnsPolicy() == null) ? 0 : getDnsPolicy().hashCode()); hashCode = prime * hashCode + ((getContainers() == null) ? 0 : getContainers().hashCode()); hashCode = prime * hashCode + ((getVolumes() == null) ? 0 : getVolumes().hashCode()); hashCode = prime * hashCode + ((getMetadata() == null) ? 0 : getMetadata().hashCode()); return hashCode; } @Override public EksPodProperties clone() { try { return (EksPodProperties) 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.batch.model.transform.EksPodPropertiesMarshaller.getInstance().marshall(this, protocolMarshaller); } }