| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.ECS.ListTasks
Description
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. Currently, stopped tasks appear in the returned results for at least one hour.
This operation returns paginated results.
Synopsis
- data ListTasks = ListTasks' {}
- newListTasks :: ListTasks
- listTasks_cluster :: Lens' ListTasks (Maybe Text)
- listTasks_containerInstance :: Lens' ListTasks (Maybe Text)
- listTasks_desiredStatus :: Lens' ListTasks (Maybe DesiredStatus)
- listTasks_family :: Lens' ListTasks (Maybe Text)
- listTasks_launchType :: Lens' ListTasks (Maybe LaunchType)
- listTasks_maxResults :: Lens' ListTasks (Maybe Int)
- listTasks_nextToken :: Lens' ListTasks (Maybe Text)
- listTasks_serviceName :: Lens' ListTasks (Maybe Text)
- listTasks_startedBy :: Lens' ListTasks (Maybe Text)
- data ListTasksResponse = ListTasksResponse' {}
- newListTasksResponse :: Int -> ListTasksResponse
- listTasksResponse_nextToken :: Lens' ListTasksResponse (Maybe Text)
- listTasksResponse_taskArns :: Lens' ListTasksResponse (Maybe [Text])
- listTasksResponse_httpStatus :: Lens' ListTasksResponse Int
Creating a Request
See: newListTasks smart constructor.
Constructors
| ListTasks' | |
Fields
| |
Instances
newListTasks :: ListTasks Source #
Create a value of ListTasks with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:cluster:ListTasks', listTasks_cluster - The short name or full Amazon Resource Name (ARN) of the cluster to use
when filtering the ListTasks results. If you do not specify a cluster,
the default cluster is assumed.
$sel:containerInstance:ListTasks', listTasks_containerInstance - The container instance ID or full ARN of the container instance to use
when filtering the ListTasks results. Specifying a containerInstance
limits the results to tasks that belong to that container instance.
ListTasks, listTasks_desiredStatus - The task desired status to use when filtering the ListTasks results.
Specifying a desiredStatus of STOPPED limits the results to tasks
that Amazon ECS has set the desired status to STOPPED. This can be
useful for debugging tasks that aren't starting properly or have died
or finished. The default status filter is RUNNING, which shows tasks
that Amazon ECS has set the desired status to RUNNING.
Although you can filter results based on a desired status of PENDING,
this doesn't return any results. Amazon ECS never sets the desired
status of a task to that value (only a task's lastStatus may have a
value of PENDING).
ListTasks, listTasks_family - The name of the task definition family to use when filtering the
ListTasks results. Specifying a family limits the results to tasks
that belong to that family.
ListTasks, listTasks_launchType - The launch type to use when filtering the ListTasks results.
$sel:maxResults:ListTasks', listTasks_maxResults - The maximum number of task results that ListTasks returned in
paginated output. When this parameter is used, ListTasks only returns
maxResults results in a single page along with a nextToken response
element. The remaining results of the initial request can be seen by
sending another ListTasks request with the returned nextToken value.
This value can be between 1 and 100. If this parameter isn't used, then
ListTasks returns up to 100 results and a nextToken value if
applicable.
ListTasks, listTasks_nextToken - The nextToken value returned from a ListTasks request indicating
that more results are available to fulfill the request and further calls
will be needed. If maxResults was provided, it's possible the number
of results to be fewer than maxResults.
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.
ListTasks, listTasks_serviceName - The name of the service to use when filtering the ListTasks results.
Specifying a serviceName limits the results to tasks that belong to
that service.
ListTasks, listTasks_startedBy - The startedBy value to filter the task results with. Specifying a
startedBy value limits the results to tasks that were started with
that value.
When you specify startedBy as the filter, it must be the only filter
that you use.
Request Lenses
listTasks_cluster :: Lens' ListTasks (Maybe Text) Source #
The short name or full Amazon Resource Name (ARN) of the cluster to use
when filtering the ListTasks results. If you do not specify a cluster,
the default cluster is assumed.
listTasks_containerInstance :: Lens' ListTasks (Maybe Text) Source #
The container instance ID or full ARN of the container instance to use
when filtering the ListTasks results. Specifying a containerInstance
limits the results to tasks that belong to that container instance.
listTasks_desiredStatus :: Lens' ListTasks (Maybe DesiredStatus) Source #
The task desired status to use when filtering the ListTasks results.
Specifying a desiredStatus of STOPPED limits the results to tasks
that Amazon ECS has set the desired status to STOPPED. This can be
useful for debugging tasks that aren't starting properly or have died
or finished. The default status filter is RUNNING, which shows tasks
that Amazon ECS has set the desired status to RUNNING.
Although you can filter results based on a desired status of PENDING,
this doesn't return any results. Amazon ECS never sets the desired
status of a task to that value (only a task's lastStatus may have a
value of PENDING).
listTasks_family :: Lens' ListTasks (Maybe Text) Source #
The name of the task definition family to use when filtering the
ListTasks results. Specifying a family limits the results to tasks
that belong to that family.
listTasks_launchType :: Lens' ListTasks (Maybe LaunchType) Source #
The launch type to use when filtering the ListTasks results.
listTasks_maxResults :: Lens' ListTasks (Maybe Int) Source #
The maximum number of task results that ListTasks returned in
paginated output. When this parameter is used, ListTasks only returns
maxResults results in a single page along with a nextToken response
element. The remaining results of the initial request can be seen by
sending another ListTasks request with the returned nextToken value.
This value can be between 1 and 100. If this parameter isn't used, then
ListTasks returns up to 100 results and a nextToken value if
applicable.
listTasks_nextToken :: Lens' ListTasks (Maybe Text) Source #
The nextToken value returned from a ListTasks request indicating
that more results are available to fulfill the request and further calls
will be needed. If maxResults was provided, it's possible the number
of results to be fewer than maxResults.
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.
listTasks_serviceName :: Lens' ListTasks (Maybe Text) Source #
The name of the service to use when filtering the ListTasks results.
Specifying a serviceName limits the results to tasks that belong to
that service.
listTasks_startedBy :: Lens' ListTasks (Maybe Text) Source #
The startedBy value to filter the task results with. Specifying a
startedBy value limits the results to tasks that were started with
that value.
When you specify startedBy as the filter, it must be the only filter
that you use.
Destructuring the Response
data ListTasksResponse Source #
See: newListTasksResponse smart constructor.
Constructors
| ListTasksResponse' | |
Fields
| |
Instances
Arguments
| :: Int | |
| -> ListTasksResponse |
Create a value of ListTasksResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
ListTasks, listTasksResponse_nextToken - The nextToken value to include in a future ListTasks request. When
the results of a ListTasks request exceed maxResults, this value can
be used to retrieve the next page of results. This value is null when
there are no more results to return.
$sel:taskArns:ListTasksResponse', listTasksResponse_taskArns - The list of task ARN entries for the ListTasks request.
$sel:httpStatus:ListTasksResponse', listTasksResponse_httpStatus - The response's http status code.
Response Lenses
listTasksResponse_nextToken :: Lens' ListTasksResponse (Maybe Text) Source #
The nextToken value to include in a future ListTasks request. When
the results of a ListTasks request exceed maxResults, this value can
be used to retrieve the next page of results. This value is null when
there are no more results to return.
listTasksResponse_taskArns :: Lens' ListTasksResponse (Maybe [Text]) Source #
The list of task ARN entries for the ListTasks request.
listTasksResponse_httpStatus :: Lens' ListTasksResponse Int Source #
The response's http status code.