Class Task
- java.lang.Object
-
- com.amazonaws.services.ecs.model.Task
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class Task extends Object implements Serializable, Cloneable
Details on a task in a cluster.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Task()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Task
clone()
boolean
equals(Object obj)
String
getClusterArn()
The Amazon Resource Name (ARN) of the cluster that hosts the task.String
getContainerInstanceArn()
The Amazon Resource Name (ARN) of the container instances that host the task.List<Container>
getContainers()
The containers associated with the task.Date
getCreatedAt()
The Unix time in seconds and milliseconds when the task was created (the task entered thePENDING
state).String
getDesiredStatus()
The desired status of the task.String
getLastStatus()
The last known status of the task.TaskOverride
getOverrides()
One or more container overrides.Date
getStartedAt()
The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDING
state to theRUNNING
state).String
getStartedBy()
The tag specified when a task is started.Date
getStoppedAt()
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNING
state to theSTOPPED
state).String
getStoppedReason()
The reason the task was stopped.String
getTaskArn()
The Amazon Resource Name (ARN) of the task.String
getTaskDefinitionArn()
The Amazon Resource Name (ARN) of the task definition that creates the task.int
hashCode()
void
setClusterArn(String clusterArn)
The Amazon Resource Name (ARN) of the cluster that hosts the task.void
setContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instances that host the task.void
setContainers(Collection<Container> containers)
The containers associated with the task.void
setCreatedAt(Date createdAt)
The Unix time in seconds and milliseconds when the task was created (the task entered thePENDING
state).void
setDesiredStatus(String desiredStatus)
The desired status of the task.void
setLastStatus(String lastStatus)
The last known status of the task.void
setOverrides(TaskOverride overrides)
One or more container overrides.void
setStartedAt(Date startedAt)
The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDING
state to theRUNNING
state).void
setStartedBy(String startedBy)
The tag specified when a task is started.void
setStoppedAt(Date stoppedAt)
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNING
state to theSTOPPED
state).void
setStoppedReason(String stoppedReason)
The reason the task was stopped.void
setTaskArn(String taskArn)
The Amazon Resource Name (ARN) of the task.void
setTaskDefinitionArn(String taskDefinitionArn)
The Amazon Resource Name (ARN) of the task definition that creates the task.String
toString()
Returns a string representation of this object; useful for testing and debugging.Task
withClusterArn(String clusterArn)
The Amazon Resource Name (ARN) of the cluster that hosts the task.Task
withContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instances that host the task.Task
withContainers(Container... containers)
The containers associated with the task.Task
withContainers(Collection<Container> containers)
The containers associated with the task.Task
withCreatedAt(Date createdAt)
The Unix time in seconds and milliseconds when the task was created (the task entered thePENDING
state).Task
withDesiredStatus(String desiredStatus)
The desired status of the task.Task
withLastStatus(String lastStatus)
The last known status of the task.Task
withOverrides(TaskOverride overrides)
One or more container overrides.Task
withStartedAt(Date startedAt)
The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDING
state to theRUNNING
state).Task
withStartedBy(String startedBy)
The tag specified when a task is started.Task
withStoppedAt(Date stoppedAt)
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNING
state to theSTOPPED
state).Task
withStoppedReason(String stoppedReason)
The reason the task was stopped.Task
withTaskArn(String taskArn)
The Amazon Resource Name (ARN) of the task.Task
withTaskDefinitionArn(String taskDefinitionArn)
The Amazon Resource Name (ARN) of the task definition that creates the task.
-
-
-
Method Detail
-
setTaskArn
public void setTaskArn(String taskArn)
The Amazon Resource Name (ARN) of the task.
- Parameters:
taskArn
- The Amazon Resource Name (ARN) of the task.
-
getTaskArn
public String getTaskArn()
The Amazon Resource Name (ARN) of the task.
- Returns:
- The Amazon Resource Name (ARN) of the task.
-
withTaskArn
public Task withTaskArn(String taskArn)
The Amazon Resource Name (ARN) of the task.
- Parameters:
taskArn
- The Amazon Resource Name (ARN) of the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setClusterArn
public void setClusterArn(String clusterArn)
The Amazon Resource Name (ARN) of the cluster that hosts the task.
- Parameters:
clusterArn
- The Amazon Resource Name (ARN) of the cluster that hosts the task.
-
getClusterArn
public String getClusterArn()
The Amazon Resource Name (ARN) of the cluster that hosts the task.
- Returns:
- The Amazon Resource Name (ARN) of the cluster that hosts the task.
-
withClusterArn
public Task withClusterArn(String clusterArn)
The Amazon Resource Name (ARN) of the cluster that hosts the task.
- Parameters:
clusterArn
- The Amazon Resource Name (ARN) of the cluster that hosts the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setTaskDefinitionArn
public void setTaskDefinitionArn(String taskDefinitionArn)
The Amazon Resource Name (ARN) of the task definition that creates the task.
- Parameters:
taskDefinitionArn
- The Amazon Resource Name (ARN) of the task definition that creates the task.
-
getTaskDefinitionArn
public String getTaskDefinitionArn()
The Amazon Resource Name (ARN) of the task definition that creates the task.
- Returns:
- The Amazon Resource Name (ARN) of the task definition that creates the task.
-
withTaskDefinitionArn
public Task withTaskDefinitionArn(String taskDefinitionArn)
The Amazon Resource Name (ARN) of the task definition that creates the task.
- Parameters:
taskDefinitionArn
- The Amazon Resource Name (ARN) of the task definition that creates the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setContainerInstanceArn
public void setContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instances that host the task.
- Parameters:
containerInstanceArn
- The Amazon Resource Name (ARN) of the container instances that host the task.
-
getContainerInstanceArn
public String getContainerInstanceArn()
The Amazon Resource Name (ARN) of the container instances that host the task.
- Returns:
- The Amazon Resource Name (ARN) of the container instances that host the task.
-
withContainerInstanceArn
public Task withContainerInstanceArn(String containerInstanceArn)
The Amazon Resource Name (ARN) of the container instances that host the task.
- Parameters:
containerInstanceArn
- The Amazon Resource Name (ARN) of the container instances that host the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setOverrides
public void setOverrides(TaskOverride overrides)
One or more container overrides.
- Parameters:
overrides
- One or more container overrides.
-
getOverrides
public TaskOverride getOverrides()
One or more container overrides.
- Returns:
- One or more container overrides.
-
withOverrides
public Task withOverrides(TaskOverride overrides)
One or more container overrides.
- Parameters:
overrides
- One or more container overrides.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setLastStatus
public void setLastStatus(String lastStatus)
The last known status of the task.
- Parameters:
lastStatus
- The last known status of the task.
-
getLastStatus
public String getLastStatus()
The last known status of the task.
- Returns:
- The last known status of the task.
-
withLastStatus
public Task withLastStatus(String lastStatus)
The last known status of the task.
- Parameters:
lastStatus
- The last known status of the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDesiredStatus
public void setDesiredStatus(String desiredStatus)
The desired status of the task.
- Parameters:
desiredStatus
- The desired status of the task.
-
getDesiredStatus
public String getDesiredStatus()
The desired status of the task.
- Returns:
- The desired status of the task.
-
withDesiredStatus
public Task withDesiredStatus(String desiredStatus)
The desired status of the task.
- Parameters:
desiredStatus
- The desired status of the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getContainers
public List<Container> getContainers()
The containers associated with the task.
- Returns:
- The containers associated with the task.
-
setContainers
public void setContainers(Collection<Container> containers)
The containers associated with the task.
- Parameters:
containers
- The containers associated with the task.
-
withContainers
public Task withContainers(Container... containers)
The containers associated with the task.
NOTE: This method appends the values to the existing list (if any). Use
setContainers(java.util.Collection)
orwithContainers(java.util.Collection)
if you want to override the existing values.- Parameters:
containers
- The containers associated with the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withContainers
public Task withContainers(Collection<Container> containers)
The containers associated with the task.
- Parameters:
containers
- The containers associated with the task.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStartedBy
public void setStartedBy(String startedBy)
The tag specified when a task is started. If the task is started by an Amazon ECS service, then the
startedBy
parameter contains the deployment ID of the service that starts it.- Parameters:
startedBy
- The tag specified when a task is started. If the task is started by an Amazon ECS service, then thestartedBy
parameter contains the deployment ID of the service that starts it.
-
getStartedBy
public String getStartedBy()
The tag specified when a task is started. If the task is started by an Amazon ECS service, then the
startedBy
parameter contains the deployment ID of the service that starts it.- Returns:
- The tag specified when a task is started. If the task is started
by an Amazon ECS service, then the
startedBy
parameter contains the deployment ID of the service that starts it.
-
withStartedBy
public Task withStartedBy(String startedBy)
The tag specified when a task is started. If the task is started by an Amazon ECS service, then the
startedBy
parameter contains the deployment ID of the service that starts it.- Parameters:
startedBy
- The tag specified when a task is started. If the task is started by an Amazon ECS service, then thestartedBy
parameter contains the deployment ID of the service that starts it.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStoppedReason
public void setStoppedReason(String stoppedReason)
The reason the task was stopped.
- Parameters:
stoppedReason
- The reason the task was stopped.
-
getStoppedReason
public String getStoppedReason()
The reason the task was stopped.
- Returns:
- The reason the task was stopped.
-
withStoppedReason
public Task withStoppedReason(String stoppedReason)
The reason the task was stopped.
- Parameters:
stoppedReason
- The reason the task was stopped.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCreatedAt
public void setCreatedAt(Date createdAt)
The Unix time in seconds and milliseconds when the task was created (the task entered the
PENDING
state).- Parameters:
createdAt
- The Unix time in seconds and milliseconds when the task was created (the task entered thePENDING
state).
-
getCreatedAt
public Date getCreatedAt()
The Unix time in seconds and milliseconds when the task was created (the task entered the
PENDING
state).- Returns:
- The Unix time in seconds and milliseconds when the task was
created (the task entered the
PENDING
state).
-
withCreatedAt
public Task withCreatedAt(Date createdAt)
The Unix time in seconds and milliseconds when the task was created (the task entered the
PENDING
state).- Parameters:
createdAt
- The Unix time in seconds and milliseconds when the task was created (the task entered thePENDING
state).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStartedAt
public void setStartedAt(Date startedAt)
The Unix time in seconds and milliseconds when the task was started (the task transitioned from the
PENDING
state to theRUNNING
state).- Parameters:
startedAt
- The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDING
state to theRUNNING
state).
-
getStartedAt
public Date getStartedAt()
The Unix time in seconds and milliseconds when the task was started (the task transitioned from the
PENDING
state to theRUNNING
state).- Returns:
- The Unix time in seconds and milliseconds when the task was
started (the task transitioned from the
PENDING
state to theRUNNING
state).
-
withStartedAt
public Task withStartedAt(Date startedAt)
The Unix time in seconds and milliseconds when the task was started (the task transitioned from the
PENDING
state to theRUNNING
state).- Parameters:
startedAt
- The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDING
state to theRUNNING
state).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStoppedAt
public void setStoppedAt(Date stoppedAt)
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from the
RUNNING
state to theSTOPPED
state).- Parameters:
stoppedAt
- The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNING
state to theSTOPPED
state).
-
getStoppedAt
public Date getStoppedAt()
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from the
RUNNING
state to theSTOPPED
state).- Returns:
- The Unix time in seconds and milliseconds when the task was
stopped (the task transitioned from the
RUNNING
state to theSTOPPED
state).
-
withStoppedAt
public Task withStoppedAt(Date stoppedAt)
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from the
RUNNING
state to theSTOPPED
state).- Parameters:
stoppedAt
- The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNING
state to theSTOPPED
state).- 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()
-
-