All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.batch.model.EksContainerOverride Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Batch module holds the client classes that are used for communicating with AWS Batch.

There is a newer version: 1.12.772
Show newest version
/*
 * Copyright 2019-2024 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;

/**
 * 

* Object representing any Kubernetes overrides to a job definition that's used in a SubmitJob API operation. *

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

* A pointer to the container that you want to override. The name must match a unique container name that you wish * to override. *

*/ private String name; /** *

* The override of the Docker image that's used to start the container. *

*/ private String image; /** *

* The command to send to the container that overrides the default command from the Docker image or the job * definition. *

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

* The arguments to the entrypoint to send to the container that overrides the default arguments from the Docker * image or the job definition. For more information, see Dockerfile reference: CMD and Define a * command an arguments for a pod in the Kubernetes documentation. *

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

* The environment variables to send to the container. You can add new environment variables, which are added to the * container at launch. Or, you can override the existing environment variables from the Docker image or the job * definition. *

* *

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

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

* The type and amount of resources to assign to a container. These override the settings in the job definition. The * supported resources include memory, cpu, and nvidia.com/gpu. For more * information, see Resource management for * pods and containers in the Kubernetes documentation. *

*/ private EksContainerResourceRequirements resources; /** *

* A pointer to the container that you want to override. The name must match a unique container name that you wish * to override. *

* * @param name * A pointer to the container that you want to override. The name must match a unique container name that you * wish to override. */ public void setName(String name) { this.name = name; } /** *

* A pointer to the container that you want to override. The name must match a unique container name that you wish * to override. *

* * @return A pointer to the container that you want to override. The name must match a unique container name that * you wish to override. */ public String getName() { return this.name; } /** *

* A pointer to the container that you want to override. The name must match a unique container name that you wish * to override. *

* * @param name * A pointer to the container that you want to override. The name must match a unique container name that you * wish to override. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withName(String name) { setName(name); return this; } /** *

* The override of the Docker image that's used to start the container. *

* * @param image * The override of the Docker image that's used to start the container. */ public void setImage(String image) { this.image = image; } /** *

* The override of the Docker image that's used to start the container. *

* * @return The override of the Docker image that's used to start the container. */ public String getImage() { return this.image; } /** *

* The override of the Docker image that's used to start the container. *

* * @param image * The override of the Docker image that's used to start the container. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withImage(String image) { setImage(image); return this; } /** *

* The command to send to the container that overrides the default command from the Docker image or the job * definition. *

* * @return The command to send to the container that overrides the default command from the Docker image or the job * definition. */ public java.util.List getCommand() { return command; } /** *

* The command to send to the container that overrides the default command from the Docker image or the job * definition. *

* * @param command * The command to send to the container that overrides the default command from the Docker image or the job * definition. */ public void setCommand(java.util.Collection command) { if (command == null) { this.command = null; return; } this.command = new java.util.ArrayList(command); } /** *

* The command to send to the container that overrides the default command from the Docker image or the job * definition. *

*

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

* * @param command * The command to send to the container that overrides the default command from the Docker image or the job * definition. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withCommand(String... command) { if (this.command == null) { setCommand(new java.util.ArrayList(command.length)); } for (String ele : command) { this.command.add(ele); } return this; } /** *

* The command to send to the container that overrides the default command from the Docker image or the job * definition. *

* * @param command * The command to send to the container that overrides the default command from the Docker image or the job * definition. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withCommand(java.util.Collection command) { setCommand(command); return this; } /** *

* The arguments to the entrypoint to send to the container that overrides the default arguments from the Docker * image or the job definition. For more information, see Dockerfile reference: CMD and Define a * command an arguments for a pod in the Kubernetes documentation. *

* * @return The arguments to the entrypoint to send to the container that overrides the default arguments from the * Docker image or the job definition. For more information, see Dockerfile reference: CMD and Define * a command an arguments for a pod in the Kubernetes documentation. */ public java.util.List getArgs() { return args; } /** *

* The arguments to the entrypoint to send to the container that overrides the default arguments from the Docker * image or the job definition. For more information, see Dockerfile reference: CMD and Define a * command an arguments for a pod in the Kubernetes documentation. *

* * @param args * The arguments to the entrypoint to send to the container that overrides the default arguments from the * Docker image or the job definition. For more information, see Dockerfile reference: CMD and Define * a command an arguments for a pod in the Kubernetes documentation. */ public void setArgs(java.util.Collection args) { if (args == null) { this.args = null; return; } this.args = new java.util.ArrayList(args); } /** *

* The arguments to the entrypoint to send to the container that overrides the default arguments from the Docker * image or the job definition. For more information, see Dockerfile reference: CMD and Define a * command an arguments for a pod in the Kubernetes documentation. *

*

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

* * @param args * The arguments to the entrypoint to send to the container that overrides the default arguments from the * Docker image or the job definition. For more information, see Dockerfile reference: CMD and Define * a command an arguments for a pod in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withArgs(String... args) { if (this.args == null) { setArgs(new java.util.ArrayList(args.length)); } for (String ele : args) { this.args.add(ele); } return this; } /** *

* The arguments to the entrypoint to send to the container that overrides the default arguments from the Docker * image or the job definition. For more information, see Dockerfile reference: CMD and Define a * command an arguments for a pod in the Kubernetes documentation. *

* * @param args * The arguments to the entrypoint to send to the container that overrides the default arguments from the * Docker image or the job definition. For more information, see Dockerfile reference: CMD and Define * a command an arguments for a pod in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withArgs(java.util.Collection args) { setArgs(args); return this; } /** *

* The environment variables to send to the container. You can add new environment variables, which are added to the * container at launch. Or, you can override the existing environment variables from the Docker image or the job * definition. *

* *

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

*
* * @return The environment variables to send to the container. You can add new environment variables, which are * added to the container at launch. Or, you can override the existing environment variables from the Docker * image or the job definition.

*

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

*/ public java.util.List getEnv() { return env; } /** *

* The environment variables to send to the container. You can add new environment variables, which are added to the * container at launch. Or, you can override the existing environment variables from the Docker image or the job * definition. *

* *

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

*
* * @param env * The environment variables to send to the container. You can add new environment variables, which are added * to the container at launch. Or, you can override the existing environment variables from the Docker image * or the job definition.

*

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

*/ public void setEnv(java.util.Collection env) { if (env == null) { this.env = null; return; } this.env = new java.util.ArrayList(env); } /** *

* The environment variables to send to the container. You can add new environment variables, which are added to the * container at launch. Or, you can override the existing environment variables from the Docker image or the job * definition. *

* *

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

*
*

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

* * @param env * The environment variables to send to the container. You can add new environment variables, which are added * to the container at launch. Or, you can override the existing environment variables from the Docker image * or the job definition.

*

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

* @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withEnv(EksContainerEnvironmentVariable... env) { if (this.env == null) { setEnv(new java.util.ArrayList(env.length)); } for (EksContainerEnvironmentVariable ele : env) { this.env.add(ele); } return this; } /** *

* The environment variables to send to the container. You can add new environment variables, which are added to the * container at launch. Or, you can override the existing environment variables from the Docker image or the job * definition. *

* *

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

*
* * @param env * The environment variables to send to the container. You can add new environment variables, which are added * to the container at launch. Or, you can override the existing environment variables from the Docker image * or the job definition.

*

* Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for * variables that Batch sets. *

* @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withEnv(java.util.Collection env) { setEnv(env); return this; } /** *

* The type and amount of resources to assign to a container. These override the settings in the job definition. The * supported resources include memory, cpu, and nvidia.com/gpu. For more * information, see Resource management for * pods and containers in the Kubernetes documentation. *

* * @param resources * The type and amount of resources to assign to a container. These override the settings in the job * definition. The supported resources include memory, cpu, and * nvidia.com/gpu. For more information, see Resource management * for pods and containers in the Kubernetes documentation. */ public void setResources(EksContainerResourceRequirements resources) { this.resources = resources; } /** *

* The type and amount of resources to assign to a container. These override the settings in the job definition. The * supported resources include memory, cpu, and nvidia.com/gpu. For more * information, see Resource management for * pods and containers in the Kubernetes documentation. *

* * @return The type and amount of resources to assign to a container. These override the settings in the job * definition. The supported resources include memory, cpu, and * nvidia.com/gpu. For more information, see Resource management * for pods and containers in the Kubernetes documentation. */ public EksContainerResourceRequirements getResources() { return this.resources; } /** *

* The type and amount of resources to assign to a container. These override the settings in the job definition. The * supported resources include memory, cpu, and nvidia.com/gpu. For more * information, see Resource management for * pods and containers in the Kubernetes documentation. *

* * @param resources * The type and amount of resources to assign to a container. These override the settings in the job * definition. The supported resources include memory, cpu, and * nvidia.com/gpu. For more information, see Resource management * for pods and containers in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksContainerOverride withResources(EksContainerResourceRequirements resources) { setResources(resources); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getImage() != null) sb.append("Image: ").append(getImage()).append(","); if (getCommand() != null) sb.append("Command: ").append(getCommand()).append(","); if (getArgs() != null) sb.append("Args: ").append(getArgs()).append(","); if (getEnv() != null) sb.append("Env: ").append(getEnv()).append(","); if (getResources() != null) sb.append("Resources: ").append(getResources()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EksContainerOverride == false) return false; EksContainerOverride other = (EksContainerOverride) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getImage() == null ^ this.getImage() == null) return false; if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) return false; if (other.getCommand() == null ^ this.getCommand() == null) return false; if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == false) return false; if (other.getArgs() == null ^ this.getArgs() == null) return false; if (other.getArgs() != null && other.getArgs().equals(this.getArgs()) == false) return false; if (other.getEnv() == null ^ this.getEnv() == null) return false; if (other.getEnv() != null && other.getEnv().equals(this.getEnv()) == false) return false; if (other.getResources() == null ^ this.getResources() == null) return false; if (other.getResources() != null && other.getResources().equals(this.getResources()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); hashCode = prime * hashCode + ((getArgs() == null) ? 0 : getArgs().hashCode()); hashCode = prime * hashCode + ((getEnv() == null) ? 0 : getEnv().hashCode()); hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode()); return hashCode; } @Override public EksContainerOverride clone() { try { return (EksContainerOverride) 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.EksContainerOverrideMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy