amazonka-ecs-2.0: Amazon EC2 Container Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Creating a Request

data ListTasks Source #

See: newListTasks smart constructor.

Constructors

ListTasks' 

Fields

  • cluster :: Maybe Text

    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.

  • containerInstance :: Maybe Text

    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.

  • desiredStatus :: Maybe 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).

  • family :: Maybe Text

    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.

  • launchType :: Maybe LaunchType

    The launch type to use when filtering the ListTasks results.

  • maxResults :: Maybe Int

    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.

  • nextToken :: Maybe Text

    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.

  • serviceName :: Maybe Text

    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.

  • startedBy :: Maybe Text

    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.

Instances

Instances details
ToJSON ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

ToHeaders ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Methods

toHeaders :: ListTasks -> [Header] #

ToPath ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

ToQuery ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

AWSPager ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

AWSRequest ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Associated Types

type AWSResponse ListTasks #

Generic ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Associated Types

type Rep ListTasks :: Type -> Type #

Read ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Show ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

NFData ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Methods

rnf :: ListTasks -> () #

Eq ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Hashable ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

type AWSResponse ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

type Rep ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

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

  • nextToken :: Maybe Text

    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.

  • taskArns :: Maybe [Text]

    The list of task ARN entries for the ListTasks request.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Associated Types

type Rep ListTasksResponse :: Type -> Type #

Read ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Show ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

NFData ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Methods

rnf :: ListTasksResponse -> () #

Eq ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

type Rep ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

type Rep ListTasksResponse = D1 ('MetaData "ListTasksResponse" "Amazonka.ECS.ListTasks" "amazonka-ecs-2.0-3xFxVqi9x5nBZ44jBEC5G8" 'False) (C1 ('MetaCons "ListTasksResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "taskArns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newListTasksResponse Source #

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.