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 Taskclone()booleanequals(Object obj)StringgetClusterArn()The Amazon Resource Name (ARN) of the cluster that hosts the task.StringgetContainerInstanceArn()The Amazon Resource Name (ARN) of the container instances that host the task.List<Container>getContainers()The containers associated with the task.DategetCreatedAt()The Unix time in seconds and milliseconds when the task was created (the task entered thePENDINGstate).StringgetDesiredStatus()The desired status of the task.StringgetLastStatus()The last known status of the task.TaskOverridegetOverrides()One or more container overrides.DategetStartedAt()The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDINGstate to theRUNNINGstate).StringgetStartedBy()The tag specified when a task is started.DategetStoppedAt()The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNINGstate to theSTOPPEDstate).StringgetStoppedReason()The reason the task was stopped.StringgetTaskArn()The Amazon Resource Name (ARN) of the task.StringgetTaskDefinitionArn()The Amazon Resource Name (ARN) of the task definition that creates the task.inthashCode()voidsetClusterArn(String clusterArn)The Amazon Resource Name (ARN) of the cluster that hosts the task.voidsetContainerInstanceArn(String containerInstanceArn)The Amazon Resource Name (ARN) of the container instances that host the task.voidsetContainers(Collection<Container> containers)The containers associated with the task.voidsetCreatedAt(Date createdAt)The Unix time in seconds and milliseconds when the task was created (the task entered thePENDINGstate).voidsetDesiredStatus(String desiredStatus)The desired status of the task.voidsetLastStatus(String lastStatus)The last known status of the task.voidsetOverrides(TaskOverride overrides)One or more container overrides.voidsetStartedAt(Date startedAt)The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDINGstate to theRUNNINGstate).voidsetStartedBy(String startedBy)The tag specified when a task is started.voidsetStoppedAt(Date stoppedAt)The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNINGstate to theSTOPPEDstate).voidsetStoppedReason(String stoppedReason)The reason the task was stopped.voidsetTaskArn(String taskArn)The Amazon Resource Name (ARN) of the task.voidsetTaskDefinitionArn(String taskDefinitionArn)The Amazon Resource Name (ARN) of the task definition that creates the task.StringtoString()Returns a string representation of this object; useful for testing and debugging.TaskwithClusterArn(String clusterArn)The Amazon Resource Name (ARN) of the cluster that hosts the task.TaskwithContainerInstanceArn(String containerInstanceArn)The Amazon Resource Name (ARN) of the container instances that host the task.TaskwithContainers(Container... containers)The containers associated with the task.TaskwithContainers(Collection<Container> containers)The containers associated with the task.TaskwithCreatedAt(Date createdAt)The Unix time in seconds and milliseconds when the task was created (the task entered thePENDINGstate).TaskwithDesiredStatus(String desiredStatus)The desired status of the task.TaskwithLastStatus(String lastStatus)The last known status of the task.TaskwithOverrides(TaskOverride overrides)One or more container overrides.TaskwithStartedAt(Date startedAt)The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDINGstate to theRUNNINGstate).TaskwithStartedBy(String startedBy)The tag specified when a task is started.TaskwithStoppedAt(Date stoppedAt)The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNINGstate to theSTOPPEDstate).TaskwithStoppedReason(String stoppedReason)The reason the task was stopped.TaskwithTaskArn(String taskArn)The Amazon Resource Name (ARN) of the task.TaskwithTaskDefinitionArn(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
startedByparameter 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 thestartedByparameter 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
startedByparameter 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
startedByparameter 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
startedByparameter 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 thestartedByparameter 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
PENDINGstate).- Parameters:
createdAt- The Unix time in seconds and milliseconds when the task was created (the task entered thePENDINGstate).
-
getCreatedAt
public Date getCreatedAt()
The Unix time in seconds and milliseconds when the task was created (the task entered the
PENDINGstate).- Returns:
- The Unix time in seconds and milliseconds when the task was
created (the task entered the
PENDINGstate).
-
withCreatedAt
public Task withCreatedAt(Date createdAt)
The Unix time in seconds and milliseconds when the task was created (the task entered the
PENDINGstate).- Parameters:
createdAt- The Unix time in seconds and milliseconds when the task was created (the task entered thePENDINGstate).- 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
PENDINGstate to theRUNNINGstate).- Parameters:
startedAt- The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDINGstate to theRUNNINGstate).
-
getStartedAt
public Date getStartedAt()
The Unix time in seconds and milliseconds when the task was started (the task transitioned from the
PENDINGstate to theRUNNINGstate).- Returns:
- The Unix time in seconds and milliseconds when the task was
started (the task transitioned from the
PENDINGstate to theRUNNINGstate).
-
withStartedAt
public Task withStartedAt(Date startedAt)
The Unix time in seconds and milliseconds when the task was started (the task transitioned from the
PENDINGstate to theRUNNINGstate).- Parameters:
startedAt- The Unix time in seconds and milliseconds when the task was started (the task transitioned from thePENDINGstate to theRUNNINGstate).- 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
RUNNINGstate to theSTOPPEDstate).- Parameters:
stoppedAt- The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNINGstate to theSTOPPEDstate).
-
getStoppedAt
public Date getStoppedAt()
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from the
RUNNINGstate to theSTOPPEDstate).- Returns:
- The Unix time in seconds and milliseconds when the task was
stopped (the task transitioned from the
RUNNINGstate to theSTOPPEDstate).
-
withStoppedAt
public Task withStoppedAt(Date stoppedAt)
The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from the
RUNNINGstate to theSTOPPEDstate).- Parameters:
stoppedAt- The Unix time in seconds and milliseconds when the task was stopped (the task transitioned from theRUNNINGstate to theSTOPPEDstate).- 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:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-