list_task_definitions
async
¶
list_task_definitions(
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
family_prefix: Optional[String] = None,
status: Optional[TaskDefinitionStatus] = None,
sort: Optional[SortOrder] = None,
next_token: Optional[String] = None,
max_results: Optional[BoxedInteger] = None,
) -> ListTaskDefinitionsResponse
Returns a list of task definitions that are registered to your account. You can filter the results by family name with the familyPrefix parameter or by status with the status parameter.
Parameters:
-
family_prefix(Optional[String], default:None) –The full family name to filter the
ListTaskDefinitionsresults with. Specifying afamilyPrefixlimits the listed task definitions to task definition revisions that belong to that family. -
status(Optional[TaskDefinitionStatus], default:None) –The task definition status to filter the
ListTaskDefinitionsresults with. By default, onlyACTIVEtask definitions are listed. By setting this parameter toINACTIVE, you can view task definitions that areINACTIVEas long as an active task or service still references them. If you paginate the resulting output, be sure to keep thestatusvalue constant in each subsequent request. -
sort(Optional[SortOrder], default:None) –The order to sort the results in. Valid values are
ASCandDESC. By default, (ASC) task definitions are listed lexicographically by family name and in ascending numerical order by revision so that the newest task definitions in a family are listed last. Setting this parameter toDESCreverses the sort order on family name and revision. This is so that the newest task definitions in a family are listed first. -
next_token(Optional[String], default:None) –The
nextTokenvalue returned from aListTaskDefinitionsrequest indicating that more results are available to fulfill the request and further calls will be needed. IfmaxResultswas provided, it is possible the number of results to be fewer thanmaxResults.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.
-
max_results(Optional[BoxedInteger], default:None) –The maximum number of task definition results that
ListTaskDefinitionsreturned in paginated output. When this parameter is used,ListTaskDefinitionsonly returnsmaxResultsresults in a single page along with anextTokenresponse element. The remaining results of the initial request can be seen by sending anotherListTaskDefinitionsrequest with the returnednextTokenvalue. This value can be between 1 and 100. If this parameter isn't used, thenListTaskDefinitionsreturns up to 100 results and anextTokenvalue if applicable.
Raises:
-
AccessDeniedException–You don't have authorization to perform the requested action.
-
ClientException–These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
-
InvalidParameterException–The specified parameter isn't valid. Review the available parameters for the API request.
For more information about service event errors, see Amazon ECS service event messages.
-
ServerException–These errors are usually caused by a server issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list your registered task definitions This example lists all of your registered task definitions.
>>> await client.list_task_definitions()
To list the registered task definitions in a family
This example lists the task definition revisions of a specified family.
Source code in docs_src/capo_ecs/_services/async_ecs.py
5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 | |