libZSservicesZSamazonka-ecsZSamazonka-ecs
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

  • 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 are not 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 does not 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).

  • 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.

  • 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.

  • 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 is 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.

  • startedBy :: Maybe Text

    The startedBy value with which to filter the task results. Specifying a startedBy value limits the results to tasks that were started with that value.

  • 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.

  • launchType :: Maybe LaunchType

    The launch type to use when filtering the ListTasks results.

  • 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.

  • maxResults :: Maybe Int

    The maximum number of task results returned by ListTasks 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 is not used, then ListTasks returns up to 100 results and a nextToken value if applicable.

Instances

Instances details
Eq ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Read ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Show ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Generic ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Associated Types

type Rep ListTasks :: Type -> Type #

NFData ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Methods

rnf :: ListTasks -> () #

Hashable ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

ToJSON 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 #

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

type Rep ListTasks Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

type AWSResponse 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:desiredStatus: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 are not 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 does not 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).

$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:family: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.

$sel:nextToken: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 is 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.

$sel:startedBy:ListTasks', listTasks_startedBy - The startedBy value with which to filter the task results. Specifying a startedBy value limits the results to tasks that were started with that value.

$sel:serviceName: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.

$sel:launchType:ListTasks', listTasks_launchType - The launch type to use when filtering the ListTasks results.

$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.

$sel:maxResults:ListTasks', listTasks_maxResults - The maximum number of task results returned by ListTasks 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 is not used, then ListTasks returns up to 100 results and a nextToken value if applicable.

Request Lenses

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 are not 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 does not 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_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_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_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 is 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_startedBy :: Lens' ListTasks (Maybe Text) Source #

The startedBy value with which to filter the task results. Specifying a startedBy value limits the results to tasks that were started with that value.

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_launchType :: Lens' ListTasks (Maybe LaunchType) Source #

The launch type to use when filtering the ListTasks results.

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_maxResults :: Lens' ListTasks (Maybe Int) Source #

The maximum number of task results returned by ListTasks 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 is not used, then ListTasks returns up to 100 results and a nextToken value if applicable.

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
Eq ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Read ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Show ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Generic ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Associated Types

type Rep ListTasksResponse :: Type -> Type #

NFData ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

Methods

rnf :: ListTasksResponse -> () #

type Rep ListTasksResponse Source # 
Instance details

Defined in Amazonka.ECS.ListTasks

type Rep ListTasksResponse = D1 ('MetaData "ListTasksResponse" "Amazonka.ECS.ListTasks" "libZSservicesZSamazonka-ecsZSamazonka-ecs" '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:

$sel:nextToken: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.