/* * 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 details for the pod. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EksPodPropertiesDetail 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.
*
* 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. If no value was specified for dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by either of
*
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter. For more
* information, see Pod's DNS
* policy in the Kubernetes documentation.
*
* Valid values: Default
| ClusterFirst
| ClusterFirstWithHostNet
*
* The properties of the container that's used on the Amazon EKS pod. *
*/ private java.util.List* Specifies the volumes for a job definition using Amazon EKS resources. *
*/ private java.util.List* The name of the pod for this job. *
*/ private String podName; /** ** The name of the node for this job. *
*/ private String nodeName; 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 EksPodPropertiesDetail 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.
*
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.
*
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.
*
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 EksPodPropertiesDetail 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.
*
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. If no value was specified for dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by either of
*
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter. For more
* information, see Pod's DNS
* policy in the Kubernetes documentation.
*
* Valid values: Default
| ClusterFirst
| ClusterFirstWithHostNet
*
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. If no value was specified for
* dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by
* either of
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter.
* 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. If no value was specified for dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by either of
*
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter. For more
* information, see Pod's DNS
* policy in the Kubernetes documentation.
*
* Valid values: Default
| ClusterFirst
| ClusterFirstWithHostNet
*
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. If no value was specified for
* dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by
* either of
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter.
* 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. If no value was specified for dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by either of
*
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter. For more
* information, see Pod's DNS
* policy in the Kubernetes documentation.
*
* Valid values: Default
| ClusterFirst
| ClusterFirstWithHostNet
*
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. If no value was specified for
* dnsPolicy
in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy
by
* either of
* DescribeJobDefinitions or DescribeJobs API
* operations. The pod spec setting will contain either ClusterFirst
or
* ClusterFirstWithHostNet
, depending on the value of the hostNetwork
parameter.
* 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 EksPodPropertiesDetail 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* 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* 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 EksPodPropertiesDetail withContainers(EksContainerDetail... containers) { if (this.containers == null) { setContainers(new java.util.ArrayList* 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 EksPodPropertiesDetail withContainers(java.util.Collection* Specifies the volumes for a job definition using Amazon EKS resources. *
* * @return Specifies the volumes for a job definition using Amazon EKS resources. */ public java.util.List* Specifies the volumes for a job definition using Amazon EKS resources. *
* * @param volumes * Specifies the volumes for a job definition using Amazon EKS resources. */ public void setVolumes(java.util.Collection* Specifies the volumes for a job definition using 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 using Amazon EKS resources. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodPropertiesDetail withVolumes(EksVolume... volumes) { if (this.volumes == null) { setVolumes(new java.util.ArrayList* Specifies the volumes for a job definition using Amazon EKS resources. *
* * @param volumes * Specifies the volumes for a job definition using Amazon EKS resources. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodPropertiesDetail withVolumes(java.util.Collection* The name of the pod for this job. *
* * @param podName * The name of the pod for this job. */ public void setPodName(String podName) { this.podName = podName; } /** ** The name of the pod for this job. *
* * @return The name of the pod for this job. */ public String getPodName() { return this.podName; } /** ** The name of the pod for this job. *
* * @param podName * The name of the pod for this job. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodPropertiesDetail withPodName(String podName) { setPodName(podName); return this; } /** ** The name of the node for this job. *
* * @param nodeName * The name of the node for this job. */ public void setNodeName(String nodeName) { this.nodeName = nodeName; } /** ** The name of the node for this job. *
* * @return The name of the node for this job. */ public String getNodeName() { return this.nodeName; } /** ** The name of the node for this job. *
* * @param nodeName * The name of the node for this job. * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodPropertiesDetail withNodeName(String nodeName) { setNodeName(nodeName); return this; } /** * @param metadata */ public void setMetadata(EksMetadata metadata) { this.metadata = metadata; } /** * @return */ public EksMetadata getMetadata() { return this.metadata; } /** * @param metadata * @return Returns a reference to this object so that method calls can be chained together. */ public EksPodPropertiesDetail 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 (getPodName() != null) sb.append("PodName: ").append(getPodName()).append(","); if (getNodeName() != null) sb.append("NodeName: ").append(getNodeName()).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 EksPodPropertiesDetail == false) return false; EksPodPropertiesDetail other = (EksPodPropertiesDetail) 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.getPodName() == null ^ this.getPodName() == null) return false; if (other.getPodName() != null && other.getPodName().equals(this.getPodName()) == false) return false; if (other.getNodeName() == null ^ this.getNodeName() == null) return false; if (other.getNodeName() != null && other.getNodeName().equals(this.getNodeName()) == 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 + ((getPodName() == null) ? 0 : getPodName().hashCode()); hashCode = prime * hashCode + ((getNodeName() == null) ? 0 : getNodeName().hashCode()); hashCode = prime * hashCode + ((getMetadata() == null) ? 0 : getMetadata().hashCode()); return hashCode; } @Override public EksPodPropertiesDetail clone() { try { return (EksPodPropertiesDetail) 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.EksPodPropertiesDetailMarshaller.getInstance().marshall(this, protocolMarshaller); } }