Class ContainerInstance
- java.lang.Object
-
- com.amazonaws.services.ecs.model.ContainerInstance
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class ContainerInstance extends Object implements Serializable, Cloneable
An EC2 instance that is running the Amazon ECS agent and has been registered with a cluster.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContainerInstance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerInstance
clone()
boolean
equals(Object obj)
Boolean
getAgentConnected()
This parameter returnstrue
if the agent is actually connected to Amazon ECS.String
getAgentUpdateStatus()
The status of the most recent agent update.List<Attribute>
getAttributes()
The attributes set for the container instance by the Amazon ECS container agent at instance registration.String
getContainerInstanceArn()
The Amazon Resource Name (ARN) of the container instance.String
getEc2InstanceId()
The EC2 instance ID of the container instance.Integer
getPendingTasksCount()
The number of tasks on the container instance that are in thePENDING
status.List<Resource>
getRegisteredResources()
The registered resources on the container instance that are in use by current tasks.List<Resource>
getRemainingResources()
The remaining resources of the container instance that are available for new tasks.Integer
getRunningTasksCount()
The number of tasks on the container instance that are in theRUNNING
status.String
getStatus()
The status of the container instance.VersionInfo
getVersionInfo()
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.int
hashCode()
Boolean
isAgentConnected()
This parameter returnstrue
if the agent is actually connected to Amazon ECS.void
setAgentConnected(Boolean agentConnected)
This parameter returnstrue
if the agent is actually connected to Amazon ECS.void
setAgentUpdateStatus(AgentUpdateStatus agentUpdateStatus)
The status of the most recent agent update.void
setAgentUpdateStatus(String agentUpdateStatus)
The status of the most recent agent update.void
setAttributes(Collection<Attribute> attributes)
The attributes set for the container instance by the Amazon ECS container agent at instance registration.void
setContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instance.void
setEc2InstanceId(String ec2InstanceId)
The EC2 instance ID of the container instance.void
setPendingTasksCount(Integer pendingTasksCount)
The number of tasks on the container instance that are in thePENDING
status.void
setRegisteredResources(Collection<Resource> registeredResources)
The registered resources on the container instance that are in use by current tasks.void
setRemainingResources(Collection<Resource> remainingResources)
The remaining resources of the container instance that are available for new tasks.void
setRunningTasksCount(Integer runningTasksCount)
The number of tasks on the container instance that are in theRUNNING
status.void
setStatus(String status)
The status of the container instance.void
setVersionInfo(VersionInfo versionInfo)
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.String
toString()
Returns a string representation of this object; useful for testing and debugging.ContainerInstance
withAgentConnected(Boolean agentConnected)
This parameter returnstrue
if the agent is actually connected to Amazon ECS.ContainerInstance
withAgentUpdateStatus(AgentUpdateStatus agentUpdateStatus)
The status of the most recent agent update.ContainerInstance
withAgentUpdateStatus(String agentUpdateStatus)
The status of the most recent agent update.ContainerInstance
withAttributes(Attribute... attributes)
The attributes set for the container instance by the Amazon ECS container agent at instance registration.ContainerInstance
withAttributes(Collection<Attribute> attributes)
The attributes set for the container instance by the Amazon ECS container agent at instance registration.ContainerInstance
withContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instance.ContainerInstance
withEc2InstanceId(String ec2InstanceId)
The EC2 instance ID of the container instance.ContainerInstance
withPendingTasksCount(Integer pendingTasksCount)
The number of tasks on the container instance that are in thePENDING
status.ContainerInstance
withRegisteredResources(Resource... registeredResources)
The registered resources on the container instance that are in use by current tasks.ContainerInstance
withRegisteredResources(Collection<Resource> registeredResources)
The registered resources on the container instance that are in use by current tasks.ContainerInstance
withRemainingResources(Resource... remainingResources)
The remaining resources of the container instance that are available for new tasks.ContainerInstance
withRemainingResources(Collection<Resource> remainingResources)
The remaining resources of the container instance that are available for new tasks.ContainerInstance
withRunningTasksCount(Integer runningTasksCount)
The number of tasks on the container instance that are in theRUNNING
status.ContainerInstance
withStatus(String status)
The status of the container instance.ContainerInstance
withVersionInfo(VersionInfo versionInfo)
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
-
-
-
Method Detail
-
setContainerInstanceArn
public void setContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instance. The ARN contains the
arn:aws:ecs
namespace, followed by the region of the container instance, the AWS account ID of the container instance owner, thecontainer-instance
namespace, and then the container instance ID. For example,arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID
.- Parameters:
containerInstanceArn
- The Amazon Resource Name (ARN) of the container instance. The ARN contains thearn:aws:ecs
namespace, followed by the region of the container instance, the AWS account ID of the container instance owner, thecontainer-instance
namespace, and then the container instance ID. For example,arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID
.
-
getContainerInstanceArn
public String getContainerInstanceArn()
The Amazon Resource Name (ARN) of the container instance. The ARN contains the
arn:aws:ecs
namespace, followed by the region of the container instance, the AWS account ID of the container instance owner, thecontainer-instance
namespace, and then the container instance ID. For example,arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID
.- Returns:
- The Amazon Resource Name (ARN) of the container instance. The ARN
contains the
arn:aws:ecs
namespace, followed by the region of the container instance, the AWS account ID of the container instance owner, thecontainer-instance
namespace, and then the container instance ID. For example,arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID
.
-
withContainerInstanceArn
public ContainerInstance withContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instance. The ARN contains the
arn:aws:ecs
namespace, followed by the region of the container instance, the AWS account ID of the container instance owner, thecontainer-instance
namespace, and then the container instance ID. For example,arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID
.- Parameters:
containerInstanceArn
- The Amazon Resource Name (ARN) of the container instance. The ARN contains thearn:aws:ecs
namespace, followed by the region of the container instance, the AWS account ID of the container instance owner, thecontainer-instance
namespace, and then the container instance ID. For example,arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setEc2InstanceId
public void setEc2InstanceId(String ec2InstanceId)
The EC2 instance ID of the container instance.
- Parameters:
ec2InstanceId
- The EC2 instance ID of the container instance.
-
getEc2InstanceId
public String getEc2InstanceId()
The EC2 instance ID of the container instance.
- Returns:
- The EC2 instance ID of the container instance.
-
withEc2InstanceId
public ContainerInstance withEc2InstanceId(String ec2InstanceId)
The EC2 instance ID of the container instance.
- Parameters:
ec2InstanceId
- The EC2 instance ID of the container instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setVersionInfo
public void setVersionInfo(VersionInfo versionInfo)
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
- Parameters:
versionInfo
- The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
-
getVersionInfo
public VersionInfo getVersionInfo()
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
- Returns:
- The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
-
withVersionInfo
public ContainerInstance withVersionInfo(VersionInfo versionInfo)
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
- Parameters:
versionInfo
- The version information for the Amazon ECS container agent and Docker daemon running on the container instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getRemainingResources
public List<Resource> getRemainingResources()
The remaining resources of the container instance that are available for new tasks.
- Returns:
- The remaining resources of the container instance that are available for new tasks.
-
setRemainingResources
public void setRemainingResources(Collection<Resource> remainingResources)
The remaining resources of the container instance that are available for new tasks.
- Parameters:
remainingResources
- The remaining resources of the container instance that are available for new tasks.
-
withRemainingResources
public ContainerInstance withRemainingResources(Resource... remainingResources)
The remaining resources of the container instance that are available for new tasks.
NOTE: This method appends the values to the existing list (if any). Use
setRemainingResources(java.util.Collection)
orwithRemainingResources(java.util.Collection)
if you want to override the existing values.- Parameters:
remainingResources
- The remaining resources of the container instance that are available for new tasks.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withRemainingResources
public ContainerInstance withRemainingResources(Collection<Resource> remainingResources)
The remaining resources of the container instance that are available for new tasks.
- Parameters:
remainingResources
- The remaining resources of the container instance that are available for new tasks.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getRegisteredResources
public List<Resource> getRegisteredResources()
The registered resources on the container instance that are in use by current tasks.
- Returns:
- The registered resources on the container instance that are in use by current tasks.
-
setRegisteredResources
public void setRegisteredResources(Collection<Resource> registeredResources)
The registered resources on the container instance that are in use by current tasks.
- Parameters:
registeredResources
- The registered resources on the container instance that are in use by current tasks.
-
withRegisteredResources
public ContainerInstance withRegisteredResources(Resource... registeredResources)
The registered resources on the container instance that are in use by current tasks.
NOTE: This method appends the values to the existing list (if any). Use
setRegisteredResources(java.util.Collection)
orwithRegisteredResources(java.util.Collection)
if you want to override the existing values.- Parameters:
registeredResources
- The registered resources on the container instance that are in use by current tasks.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withRegisteredResources
public ContainerInstance withRegisteredResources(Collection<Resource> registeredResources)
The registered resources on the container instance that are in use by current tasks.
- Parameters:
registeredResources
- The registered resources on the container instance that are in use by current tasks.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStatus
public void setStatus(String status)
The status of the container instance. The valid values are
ACTIVE
orINACTIVE
.ACTIVE
indicates that the container instance can accept tasks.- Parameters:
status
- The status of the container instance. The valid values areACTIVE
orINACTIVE
.ACTIVE
indicates that the container instance can accept tasks.
-
getStatus
public String getStatus()
The status of the container instance. The valid values are
ACTIVE
orINACTIVE
.ACTIVE
indicates that the container instance can accept tasks.- Returns:
- The status of the container instance. The valid values are
ACTIVE
orINACTIVE
.ACTIVE
indicates that the container instance can accept tasks.
-
withStatus
public ContainerInstance withStatus(String status)
The status of the container instance. The valid values are
ACTIVE
orINACTIVE
.ACTIVE
indicates that the container instance can accept tasks.- Parameters:
status
- The status of the container instance. The valid values areACTIVE
orINACTIVE
.ACTIVE
indicates that the container instance can accept tasks.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAgentConnected
public void setAgentConnected(Boolean agentConnected)
This parameter returns
true
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.- Parameters:
agentConnected
- This parameter returnstrue
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.
-
getAgentConnected
public Boolean getAgentConnected()
This parameter returns
true
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.- Returns:
- This parameter returns
true
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.
-
withAgentConnected
public ContainerInstance withAgentConnected(Boolean agentConnected)
This parameter returns
true
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.- Parameters:
agentConnected
- This parameter returnstrue
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isAgentConnected
public Boolean isAgentConnected()
This parameter returns
true
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.- Returns:
- This parameter returns
true
if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped returnfalse
, and instances without a connected agent cannot accept placement requests.
-
setRunningTasksCount
public void setRunningTasksCount(Integer runningTasksCount)
The number of tasks on the container instance that are in the
RUNNING
status.- Parameters:
runningTasksCount
- The number of tasks on the container instance that are in theRUNNING
status.
-
getRunningTasksCount
public Integer getRunningTasksCount()
The number of tasks on the container instance that are in the
RUNNING
status.- Returns:
- The number of tasks on the container instance that are in the
RUNNING
status.
-
withRunningTasksCount
public ContainerInstance withRunningTasksCount(Integer runningTasksCount)
The number of tasks on the container instance that are in the
RUNNING
status.- Parameters:
runningTasksCount
- The number of tasks on the container instance that are in theRUNNING
status.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPendingTasksCount
public void setPendingTasksCount(Integer pendingTasksCount)
The number of tasks on the container instance that are in the
PENDING
status.- Parameters:
pendingTasksCount
- The number of tasks on the container instance that are in thePENDING
status.
-
getPendingTasksCount
public Integer getPendingTasksCount()
The number of tasks on the container instance that are in the
PENDING
status.- Returns:
- The number of tasks on the container instance that are in the
PENDING
status.
-
withPendingTasksCount
public ContainerInstance withPendingTasksCount(Integer pendingTasksCount)
The number of tasks on the container instance that are in the
PENDING
status.- Parameters:
pendingTasksCount
- The number of tasks on the container instance that are in thePENDING
status.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAgentUpdateStatus
public void setAgentUpdateStatus(String agentUpdateStatus)
The status of the most recent agent update. If an update has never been requested, this value is
NULL
.- Parameters:
agentUpdateStatus
- The status of the most recent agent update. If an update has never been requested, this value isNULL
.- See Also:
AgentUpdateStatus
-
getAgentUpdateStatus
public String getAgentUpdateStatus()
The status of the most recent agent update. If an update has never been requested, this value is
NULL
.- Returns:
- The status of the most recent agent update. If an update has
never been requested, this value is
NULL
. - See Also:
AgentUpdateStatus
-
withAgentUpdateStatus
public ContainerInstance withAgentUpdateStatus(String agentUpdateStatus)
The status of the most recent agent update. If an update has never been requested, this value is
NULL
.- Parameters:
agentUpdateStatus
- The status of the most recent agent update. If an update has never been requested, this value isNULL
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
AgentUpdateStatus
-
setAgentUpdateStatus
public void setAgentUpdateStatus(AgentUpdateStatus agentUpdateStatus)
The status of the most recent agent update. If an update has never been requested, this value is
NULL
.- Parameters:
agentUpdateStatus
- The status of the most recent agent update. If an update has never been requested, this value isNULL
.- See Also:
AgentUpdateStatus
-
withAgentUpdateStatus
public ContainerInstance withAgentUpdateStatus(AgentUpdateStatus agentUpdateStatus)
The status of the most recent agent update. If an update has never been requested, this value is
NULL
.- Parameters:
agentUpdateStatus
- The status of the most recent agent update. If an update has never been requested, this value isNULL
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
AgentUpdateStatus
-
getAttributes
public List<Attribute> getAttributes()
The attributes set for the container instance by the Amazon ECS container agent at instance registration.
- Returns:
- The attributes set for the container instance by the Amazon ECS container agent at instance registration.
-
setAttributes
public void setAttributes(Collection<Attribute> attributes)
The attributes set for the container instance by the Amazon ECS container agent at instance registration.
- Parameters:
attributes
- The attributes set for the container instance by the Amazon ECS container agent at instance registration.
-
withAttributes
public ContainerInstance withAttributes(Attribute... attributes)
The attributes set for the container instance by the Amazon ECS container agent at instance registration.
NOTE: This method appends the values to the existing list (if any). Use
setAttributes(java.util.Collection)
orwithAttributes(java.util.Collection)
if you want to override the existing values.- Parameters:
attributes
- The attributes set for the container instance by the Amazon ECS container agent at instance registration.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withAttributes
public ContainerInstance withAttributes(Collection<Attribute> attributes)
The attributes set for the container instance by the Amazon ECS container agent at instance registration.
- Parameters:
attributes
- The attributes set for the container instance by the Amazon ECS container agent at instance registration.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public ContainerInstance clone()
-
-