/* * 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.ecs.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A Docker container that's part of a task. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Container implements Serializable, Cloneable, StructuredPojo { /** ** The Amazon Resource Name (ARN) of the container. *
*/ private String containerArn; /** ** The ARN of the task. *
*/ private String taskArn; /** ** The name of the container. *
*/ private String name; /** ** The image used for the container. *
*/ private String image; /** ** The container image manifest digest. *
*/ private String imageDigest; /** ** The ID of the Docker container. *
*/ private String runtimeId; /** ** The last known status of the container. *
*/ private String lastStatus; /** ** The exit code returned from the container. *
*/ private Integer exitCode; /** ** A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *
*/ private String reason; /** ** The network bindings associated with the container. *
*/ private com.amazonaws.internal.SdkInternalList* The network interfaces associated with the container. *
*/ private com.amazonaws.internal.SdkInternalList
* The health status of the container. If health checks aren't configured for this container in its task definition,
* then it reports the health status as UNKNOWN
.
*
* The details of any Amazon ECS managed agents associated with the container. *
*/ private com.amazonaws.internal.SdkInternalList
* The number of CPU units set for the container. The value is 0
if no value was specified in the
* container definition when the task definition was registered.
*
* The hard limit (in MiB) of memory set for the container. *
*/ private String memory; /** ** The soft limit (in MiB) of memory set for the container. *
*/ private String memoryReservation; /** ** The IDs of each GPU assigned to the container. *
*/ private com.amazonaws.internal.SdkInternalList* The Amazon Resource Name (ARN) of the container. *
* * @param containerArn * The Amazon Resource Name (ARN) of the container. */ public void setContainerArn(String containerArn) { this.containerArn = containerArn; } /** ** The Amazon Resource Name (ARN) of the container. *
* * @return The Amazon Resource Name (ARN) of the container. */ public String getContainerArn() { return this.containerArn; } /** ** The Amazon Resource Name (ARN) of the container. *
* * @param containerArn * The Amazon Resource Name (ARN) of the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withContainerArn(String containerArn) { setContainerArn(containerArn); return this; } /** ** The ARN of the task. *
* * @param taskArn * The ARN of the task. */ public void setTaskArn(String taskArn) { this.taskArn = taskArn; } /** ** The ARN of the task. *
* * @return The ARN of the task. */ public String getTaskArn() { return this.taskArn; } /** ** The ARN of the task. *
* * @param taskArn * The ARN of the task. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withTaskArn(String taskArn) { setTaskArn(taskArn); return this; } /** ** The name of the container. *
* * @param name * The name of the container. */ public void setName(String name) { this.name = name; } /** ** The name of the container. *
* * @return The name of the container. */ public String getName() { return this.name; } /** ** The name of the container. *
* * @param name * The name of the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withName(String name) { setName(name); return this; } /** ** The image used for the container. *
* * @param image * The image used for the container. */ public void setImage(String image) { this.image = image; } /** ** The image used for the container. *
* * @return The image used for the container. */ public String getImage() { return this.image; } /** ** The image used for the container. *
* * @param image * The image used for the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withImage(String image) { setImage(image); return this; } /** ** The container image manifest digest. *
* * @param imageDigest * The container image manifest digest. */ public void setImageDigest(String imageDigest) { this.imageDigest = imageDigest; } /** ** The container image manifest digest. *
* * @return The container image manifest digest. */ public String getImageDigest() { return this.imageDigest; } /** ** The container image manifest digest. *
* * @param imageDigest * The container image manifest digest. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withImageDigest(String imageDigest) { setImageDigest(imageDigest); return this; } /** ** The ID of the Docker container. *
* * @param runtimeId * The ID of the Docker container. */ public void setRuntimeId(String runtimeId) { this.runtimeId = runtimeId; } /** ** The ID of the Docker container. *
* * @return The ID of the Docker container. */ public String getRuntimeId() { return this.runtimeId; } /** ** The ID of the Docker container. *
* * @param runtimeId * The ID of the Docker container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withRuntimeId(String runtimeId) { setRuntimeId(runtimeId); return this; } /** ** The last known status of the container. *
* * @param lastStatus * The last known status of the container. */ public void setLastStatus(String lastStatus) { this.lastStatus = lastStatus; } /** ** The last known status of the container. *
* * @return The last known status of the container. */ public String getLastStatus() { return this.lastStatus; } /** ** The last known status of the container. *
* * @param lastStatus * The last known status of the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withLastStatus(String lastStatus) { setLastStatus(lastStatus); return this; } /** ** The exit code returned from the container. *
* * @param exitCode * The exit code returned from the container. */ public void setExitCode(Integer exitCode) { this.exitCode = exitCode; } /** ** The exit code returned from the container. *
* * @return The exit code returned from the container. */ public Integer getExitCode() { return this.exitCode; } /** ** The exit code returned from the container. *
* * @param exitCode * The exit code returned from the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withExitCode(Integer exitCode) { setExitCode(exitCode); return this; } /** ** A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *
* * @param reason * A short (255 max characters) human-readable string to provide additional details about a running or * stopped container. */ public void setReason(String reason) { this.reason = reason; } /** ** A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *
* * @return A short (255 max characters) human-readable string to provide additional details about a running or * stopped container. */ public String getReason() { return this.reason; } /** ** A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *
* * @param reason * A short (255 max characters) human-readable string to provide additional details about a running or * stopped container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withReason(String reason) { setReason(reason); return this; } /** ** The network bindings associated with the container. *
* * @return The network bindings associated with the container. */ public java.util.List* The network bindings associated with the container. *
* * @param networkBindings * The network bindings associated with the container. */ public void setNetworkBindings(java.util.Collection* The network bindings associated with the container. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setNetworkBindings(java.util.Collection)} or {@link #withNetworkBindings(java.util.Collection)} if you * want to override the existing values. *
* * @param networkBindings * The network bindings associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkBindings(NetworkBinding... networkBindings) { if (this.networkBindings == null) { setNetworkBindings(new com.amazonaws.internal.SdkInternalList* The network bindings associated with the container. *
* * @param networkBindings * The network bindings associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkBindings(java.util.Collection* The network interfaces associated with the container. *
* * @return The network interfaces associated with the container. */ public java.util.List* The network interfaces associated with the container. *
* * @param networkInterfaces * The network interfaces associated with the container. */ public void setNetworkInterfaces(java.util.Collection* The network interfaces associated with the container. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setNetworkInterfaces(java.util.Collection)} or {@link #withNetworkInterfaces(java.util.Collection)} if * you want to override the existing values. *
* * @param networkInterfaces * The network interfaces associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkInterfaces(NetworkInterface... networkInterfaces) { if (this.networkInterfaces == null) { setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList* The network interfaces associated with the container. *
* * @param networkInterfaces * The network interfaces associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkInterfaces(java.util.Collection
* The health status of the container. If health checks aren't configured for this container in its task definition,
* then it reports the health status as UNKNOWN
.
*
UNKNOWN
.
* @see HealthStatus
*/
public void setHealthStatus(String healthStatus) {
this.healthStatus = healthStatus;
}
/**
*
* The health status of the container. If health checks aren't configured for this container in its task definition,
* then it reports the health status as UNKNOWN
.
*
UNKNOWN
.
* @see HealthStatus
*/
public String getHealthStatus() {
return this.healthStatus;
}
/**
*
* The health status of the container. If health checks aren't configured for this container in its task definition,
* then it reports the health status as UNKNOWN
.
*
UNKNOWN
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see HealthStatus
*/
public Container withHealthStatus(String healthStatus) {
setHealthStatus(healthStatus);
return this;
}
/**
*
* The health status of the container. If health checks aren't configured for this container in its task definition,
* then it reports the health status as UNKNOWN
.
*
UNKNOWN
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see HealthStatus
*/
public Container withHealthStatus(HealthStatus healthStatus) {
this.healthStatus = healthStatus.toString();
return this;
}
/**
* * The details of any Amazon ECS managed agents associated with the container. *
* * @return The details of any Amazon ECS managed agents associated with the container. */ public java.util.List* The details of any Amazon ECS managed agents associated with the container. *
* * @param managedAgents * The details of any Amazon ECS managed agents associated with the container. */ public void setManagedAgents(java.util.Collection* The details of any Amazon ECS managed agents associated with the container. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setManagedAgents(java.util.Collection)} or {@link #withManagedAgents(java.util.Collection)} if you want * to override the existing values. *
* * @param managedAgents * The details of any Amazon ECS managed agents associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withManagedAgents(ManagedAgent... managedAgents) { if (this.managedAgents == null) { setManagedAgents(new com.amazonaws.internal.SdkInternalList* The details of any Amazon ECS managed agents associated with the container. *
* * @param managedAgents * The details of any Amazon ECS managed agents associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withManagedAgents(java.util.Collection
* The number of CPU units set for the container. The value is 0
if no value was specified in the
* container definition when the task definition was registered.
*
0
if no value was specified in
* the container definition when the task definition was registered.
*/
public void setCpu(String cpu) {
this.cpu = cpu;
}
/**
*
* The number of CPU units set for the container. The value is 0
if no value was specified in the
* container definition when the task definition was registered.
*
0
if no value was specified in
* the container definition when the task definition was registered.
*/
public String getCpu() {
return this.cpu;
}
/**
*
* The number of CPU units set for the container. The value is 0
if no value was specified in the
* container definition when the task definition was registered.
*
0
if no value was specified in
* the container definition when the task definition was registered.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Container withCpu(String cpu) {
setCpu(cpu);
return this;
}
/**
* * The hard limit (in MiB) of memory set for the container. *
* * @param memory * The hard limit (in MiB) of memory set for the container. */ public void setMemory(String memory) { this.memory = memory; } /** ** The hard limit (in MiB) of memory set for the container. *
* * @return The hard limit (in MiB) of memory set for the container. */ public String getMemory() { return this.memory; } /** ** The hard limit (in MiB) of memory set for the container. *
* * @param memory * The hard limit (in MiB) of memory set for the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withMemory(String memory) { setMemory(memory); return this; } /** ** The soft limit (in MiB) of memory set for the container. *
* * @param memoryReservation * The soft limit (in MiB) of memory set for the container. */ public void setMemoryReservation(String memoryReservation) { this.memoryReservation = memoryReservation; } /** ** The soft limit (in MiB) of memory set for the container. *
* * @return The soft limit (in MiB) of memory set for the container. */ public String getMemoryReservation() { return this.memoryReservation; } /** ** The soft limit (in MiB) of memory set for the container. *
* * @param memoryReservation * The soft limit (in MiB) of memory set for the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withMemoryReservation(String memoryReservation) { setMemoryReservation(memoryReservation); return this; } /** ** The IDs of each GPU assigned to the container. *
* * @return The IDs of each GPU assigned to the container. */ public java.util.List* The IDs of each GPU assigned to the container. *
* * @param gpuIds * The IDs of each GPU assigned to the container. */ public void setGpuIds(java.util.Collection* The IDs of each GPU assigned to the container. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setGpuIds(java.util.Collection)} or {@link #withGpuIds(java.util.Collection)} if you want to override the * existing values. *
* * @param gpuIds * The IDs of each GPU assigned to the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withGpuIds(String... gpuIds) { if (this.gpuIds == null) { setGpuIds(new com.amazonaws.internal.SdkInternalList* The IDs of each GPU assigned to the container. *
* * @param gpuIds * The IDs of each GPU assigned to the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withGpuIds(java.util.Collection