
com.amazonaws.services.eks.model.CreateFargateProfileRequest Maven / Gradle / Ivy
/*
* 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 CreateFargateProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the Fargate profile.
*
*/
private String fargateProfileName;
/**
*
* The name of the Amazon EKS cluster to apply the Fargate profile to.
*
*/
private String clusterName;
/**
*
* The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the Fargate
* profile. The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it
* provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the
* Amazon EKS User Guide.
*
*/
private String podExecutionRoleArn;
/**
*
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP
* addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.
*
*/
private java.util.List subnets;
/**
*
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace.
* Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate
* profile.
*
*/
private java.util.List selectors;
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*/
private String clientRequestToken;
/**
*
* The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag consists of
* a key and an optional value. You define both. Fargate profile tags do not propagate to any other resources
* associated with the Fargate profile, such as the pods that are scheduled with it.
*
*/
private java.util.Map tags;
/**
*
* The name of the Fargate profile.
*
*
* @param fargateProfileName
* The name of the Fargate profile.
*/
public void setFargateProfileName(String fargateProfileName) {
this.fargateProfileName = fargateProfileName;
}
/**
*
* The name of the Fargate profile.
*
*
* @return The name of the Fargate profile.
*/
public String getFargateProfileName() {
return this.fargateProfileName;
}
/**
*
* The name of the Fargate profile.
*
*
* @param fargateProfileName
* The name of the Fargate profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withFargateProfileName(String fargateProfileName) {
setFargateProfileName(fargateProfileName);
return this;
}
/**
*
* The name of the Amazon EKS cluster to apply the Fargate profile to.
*
*
* @param clusterName
* The name of the Amazon EKS cluster to apply the Fargate profile to.
*/
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
/**
*
* The name of the Amazon EKS cluster to apply the Fargate profile to.
*
*
* @return The name of the Amazon EKS cluster to apply the Fargate profile to.
*/
public String getClusterName() {
return this.clusterName;
}
/**
*
* The name of the Amazon EKS cluster to apply the Fargate profile to.
*
*
* @param clusterName
* The name of the Amazon EKS cluster to apply the Fargate profile to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withClusterName(String clusterName) {
setClusterName(clusterName);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the Fargate
* profile. The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it
* provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the
* Amazon EKS User Guide.
*
*
* @param podExecutionRoleArn
* The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the
* Fargate profile. The pod execution role allows Fargate infrastructure to register with your cluster as a
* node, and it provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in
* the Amazon EKS User Guide.
*/
public void setPodExecutionRoleArn(String podExecutionRoleArn) {
this.podExecutionRoleArn = podExecutionRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the Fargate
* profile. The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it
* provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the
* Amazon EKS User Guide.
*
*
* @return The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the
* Fargate profile. The pod execution role allows Fargate infrastructure to register with your cluster as a
* node, and it provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in
* the Amazon EKS User Guide.
*/
public String getPodExecutionRoleArn() {
return this.podExecutionRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the Fargate
* profile. The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it
* provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the
* Amazon EKS User Guide.
*
*
* @param podExecutionRoleArn
* The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the
* Fargate profile. The pod execution role allows Fargate infrastructure to register with your cluster as a
* node, and it provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in
* the Amazon EKS User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withPodExecutionRoleArn(String podExecutionRoleArn) {
setPodExecutionRoleArn(podExecutionRoleArn);
return this;
}
/**
*
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP
* addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.
*
*
* @return The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned
* public IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted
* for this parameter.
*/
public java.util.List getSubnets() {
return subnets;
}
/**
*
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP
* addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.
*
*
* @param subnets
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public
* IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this
* parameter.
*/
public void setSubnets(java.util.Collection subnets) {
if (subnets == null) {
this.subnets = null;
return;
}
this.subnets = new java.util.ArrayList(subnets);
}
/**
*
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP
* addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSubnets(java.util.Collection)} or {@link #withSubnets(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param subnets
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public
* IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this
* parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withSubnets(String... subnets) {
if (this.subnets == null) {
setSubnets(new java.util.ArrayList(subnets.length));
}
for (String ele : subnets) {
this.subnets.add(ele);
}
return this;
}
/**
*
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP
* addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.
*
*
* @param subnets
* The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public
* IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this
* parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withSubnets(java.util.Collection subnets) {
setSubnets(subnets);
return this;
}
/**
*
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace.
* Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate
* profile.
*
*
* @return The selectors to match for pods to use this Fargate profile. Each selector must have an associated
* namespace. Optionally, you can also specify labels for a namespace. You may specify up to five selectors
* in a Fargate profile.
*/
public java.util.List getSelectors() {
return selectors;
}
/**
*
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace.
* Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate
* profile.
*
*
* @param selectors
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated
* namespace. Optionally, you can also specify labels for a namespace. You may specify up to five selectors
* in a Fargate profile.
*/
public void setSelectors(java.util.Collection selectors) {
if (selectors == null) {
this.selectors = null;
return;
}
this.selectors = new java.util.ArrayList(selectors);
}
/**
*
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace.
* Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate
* profile.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSelectors(java.util.Collection)} or {@link #withSelectors(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param selectors
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated
* namespace. Optionally, you can also specify labels for a namespace. You may specify up to five selectors
* in a Fargate profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withSelectors(FargateProfileSelector... selectors) {
if (this.selectors == null) {
setSelectors(new java.util.ArrayList(selectors.length));
}
for (FargateProfileSelector ele : selectors) {
this.selectors.add(ele);
}
return this;
}
/**
*
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace.
* Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate
* profile.
*
*
* @param selectors
* The selectors to match for pods to use this Fargate profile. Each selector must have an associated
* namespace. Optionally, you can also specify labels for a namespace. You may specify up to five selectors
* in a Fargate profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withSelectors(java.util.Collection selectors) {
setSelectors(selectors);
return this;
}
/**
*
* 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 CreateFargateProfileRequest withClientRequestToken(String clientRequestToken) {
setClientRequestToken(clientRequestToken);
return this;
}
/**
*
* The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag consists of
* a key and an optional value. You define both. Fargate profile tags do not propagate to any other resources
* associated with the Fargate profile, such as the pods that are scheduled with it.
*
*
* @return The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag
* consists of a key and an optional value. You define both. Fargate profile tags do not propagate to any
* other resources associated with the Fargate profile, such as the pods that are scheduled with it.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag consists of
* a key and an optional value. You define both. Fargate profile tags do not propagate to any other resources
* associated with the Fargate profile, such as the pods that are scheduled with it.
*
*
* @param tags
* The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag
* consists of a key and an optional value. You define both. Fargate profile tags do not propagate to any
* other resources associated with the Fargate profile, such as the pods that are scheduled with it.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag consists of
* a key and an optional value. You define both. Fargate profile tags do not propagate to any other resources
* associated with the Fargate profile, such as the pods that are scheduled with it.
*
*
* @param tags
* The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag
* consists of a key and an optional value. You define both. Fargate profile tags do not propagate to any
* other resources associated with the Fargate profile, such as the pods that are scheduled with it.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see CreateFargateProfileRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFargateProfileRequest clearTagsEntries() {
this.tags = null;
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 (getFargateProfileName() != null)
sb.append("FargateProfileName: ").append(getFargateProfileName()).append(",");
if (getClusterName() != null)
sb.append("ClusterName: ").append(getClusterName()).append(",");
if (getPodExecutionRoleArn() != null)
sb.append("PodExecutionRoleArn: ").append(getPodExecutionRoleArn()).append(",");
if (getSubnets() != null)
sb.append("Subnets: ").append(getSubnets()).append(",");
if (getSelectors() != null)
sb.append("Selectors: ").append(getSelectors()).append(",");
if (getClientRequestToken() != null)
sb.append("ClientRequestToken: ").append(getClientRequestToken()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateFargateProfileRequest == false)
return false;
CreateFargateProfileRequest other = (CreateFargateProfileRequest) obj;
if (other.getFargateProfileName() == null ^ this.getFargateProfileName() == null)
return false;
if (other.getFargateProfileName() != null && other.getFargateProfileName().equals(this.getFargateProfileName()) == false)
return false;
if (other.getClusterName() == null ^ this.getClusterName() == null)
return false;
if (other.getClusterName() != null && other.getClusterName().equals(this.getClusterName()) == false)
return false;
if (other.getPodExecutionRoleArn() == null ^ this.getPodExecutionRoleArn() == null)
return false;
if (other.getPodExecutionRoleArn() != null && other.getPodExecutionRoleArn().equals(this.getPodExecutionRoleArn()) == false)
return false;
if (other.getSubnets() == null ^ this.getSubnets() == null)
return false;
if (other.getSubnets() != null && other.getSubnets().equals(this.getSubnets()) == false)
return false;
if (other.getSelectors() == null ^ this.getSelectors() == null)
return false;
if (other.getSelectors() != null && other.getSelectors().equals(this.getSelectors()) == false)
return false;
if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null)
return false;
if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFargateProfileName() == null) ? 0 : getFargateProfileName().hashCode());
hashCode = prime * hashCode + ((getClusterName() == null) ? 0 : getClusterName().hashCode());
hashCode = prime * hashCode + ((getPodExecutionRoleArn() == null) ? 0 : getPodExecutionRoleArn().hashCode());
hashCode = prime * hashCode + ((getSubnets() == null) ? 0 : getSubnets().hashCode());
hashCode = prime * hashCode + ((getSelectors() == null) ? 0 : getSelectors().hashCode());
hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateFargateProfileRequest clone() {
return (CreateFargateProfileRequest) super.clone();
}
}