AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the ListTasks operation. Returns a list of tasks. You can filter the results by cluster, task definition family, container instance, launch type, what IAM principal started the task, or by the desired status of the task.
Recently stopped tasks might appear in the returned results.
Namespace: Amazon.ECS.Model
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z
public class ListTasksRequest : AmazonECSRequest IAmazonWebServiceRequest
The ListTasksRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
ListTasksRequest() |
Name | Type | Description | |
---|---|---|---|
![]() |
Cluster | System.String |
Gets and sets the property Cluster.
The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering
the |
![]() |
ContainerInstance | System.String |
Gets and sets the property ContainerInstance.
The container instance ID or full ARN of the container instance to use when filtering
the |
![]() |
DesiredStatus | Amazon.ECS.DesiredStatus |
Gets and sets the property DesiredStatus.
The task desired status to use when filtering the
Although you can filter results based on a desired status of |
![]() |
Family | System.String |
Gets and sets the property Family.
The name of the task definition family to use when filtering the |
![]() |
LaunchType | Amazon.ECS.LaunchType |
Gets and sets the property LaunchType.
The launch type to use when filtering the |
![]() |
MaxResults | System.Int32 |
Gets and sets the property MaxResults.
The maximum number of task results that |
![]() |
NextToken | System.String |
Gets and sets the property NextToken.
The This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes. |
![]() |
ServiceName | System.String |
Gets and sets the property ServiceName.
The name of the service to use when filtering the |
![]() |
StartedBy | System.String |
Gets and sets the property StartedBy.
The
When you specify |
This example lists all of the tasks in a cluster.
var client = new AmazonECSClient(); var response = client.ListTasks(new ListTasksRequest { Cluster = "default" }); List<string> taskArns = response.TaskArns;
This example lists the tasks of a specified container instance. Specifying a ``containerInstance`` value limits the results to tasks that belong to that container instance.
var client = new AmazonECSClient(); var response = client.ListTasks(new ListTasksRequest { Cluster = "default", ContainerInstance = "f6bbb147-5370-4ace-8c73-c7181ded911f" }); List<string> taskArns = response.TaskArns;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5