Skip to content

list_task_definition_families

list_task_definition_families(
    *,
    config_overrides: Optional[ECSClientConfig] = None,
    family_prefix: Optional[String] = None,
    status: Optional[TaskDefinitionFamilyStatus] = None,
    next_token: Optional[String] = None,
    max_results: Optional[BoxedInteger] = None,
) -> ListTaskDefinitionFamiliesResponse

Returns a list of task definition families that are registered to your account. This list includes task definition families that no longer have any ACTIVE task definition revisions.

You can filter out task definition families that don't contain any ACTIVE task definition revisions by setting the status parameter to ACTIVE. You can also filter the results with the familyPrefix parameter.

Parameters:

  • family_prefix (Optional[String], default: None ) –

    The familyPrefix is a string that's used to filter the results of ListTaskDefinitionFamilies. If you specify a familyPrefix, only task definition family names that begin with the familyPrefix string are returned.

  • status (Optional[TaskDefinitionFamilyStatus], default: None ) –

    The task definition family status to filter the ListTaskDefinitionFamilies results with. By default, both ACTIVE and INACTIVE task definition families are listed. If this parameter is set to ACTIVE, only task definition families that have an ACTIVE task definition revision are returned. If this parameter is set to INACTIVE, only task definition families that do not have any ACTIVE task definition revisions are returned. If you paginate the resulting output, be sure to keep the status value constant in each subsequent request.

  • next_token (Optional[String], default: None ) –

    The nextToken value returned from a ListTaskDefinitionFamilies 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.

  • max_results (Optional[BoxedInteger], default: None ) –

    The maximum number of task definition family results that ListTaskDefinitionFamilies returned in paginated output. When this parameter is used, ListTaskDefinitions 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 ListTaskDefinitionFamilies request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then ListTaskDefinitionFamilies returns up to 100 results and a nextToken value 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 definition families This example lists all of your registered task definition families.

>>> client.list_task_definition_families()
To filter your registered task definition families
This example lists the task definition revisions that start with "hpcc".
>>> client.list_task_definition_families(family_prefix='hpcc')
Source code in docs_src/capo_ecs/_services/ecs.py
def list_task_definition_families(
    self,
    *,
    config_overrides: Optional[ECSClientConfig] = None,
    family_prefix: Optional["capo_ecs.types.string.String"] = None,
    status: Optional[
        "capo_ecs.types.task_definition_family_status.TaskDefinitionFamilyStatus"
    ] = None,
    next_token: Optional["capo_ecs.types.string.String"] = None,
    max_results: Optional["capo_ecs.types.boxed_integer.BoxedInteger"] = None,
) -> "capo_ecs.types.list_task_definition_families_response.ListTaskDefinitionFamiliesResponse":
    """<p>Returns a list of task definition families that are registered to your account. This list includes task definition families that no longer have any <code>ACTIVE</code> task definition revisions.</p> <p>You can filter out task definition families that don't contain any <code>ACTIVE</code> task definition revisions by setting the <code>status</code> parameter to <code>ACTIVE</code>. You can also filter the results with the <code>familyPrefix</code> parameter.</p>

    Args:
        family_prefix: <p>The <code>familyPrefix</code> is a string that's used to filter the results of <code>ListTaskDefinitionFamilies</code>. If you specify a <code>familyPrefix</code>, only task definition family names that begin with the <code>familyPrefix</code> string are returned.</p>
        status: <p>The task definition family status to filter the <code>ListTaskDefinitionFamilies</code> results with. By default, both <code>ACTIVE</code> and <code>INACTIVE</code> task definition families are listed. If this parameter is set to <code>ACTIVE</code>, only task definition families that have an <code>ACTIVE</code> task definition revision are returned. If this parameter is set to <code>INACTIVE</code>, only task definition families that do not have any <code>ACTIVE</code> task definition revisions are returned. If you paginate the resulting output, be sure to keep the <code>status</code> value constant in each subsequent request.</p>
        next_token: <p>The <code>nextToken</code> value returned from a <code>ListTaskDefinitionFamilies</code> request indicating that more results are available to fulfill the request and further calls will be needed. If <code>maxResults</code> was provided, it is possible the number of results to be fewer than <code>maxResults</code>.</p> <note> <p>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.</p> </note>
        max_results: <p>The maximum number of task definition family results that <code>ListTaskDefinitionFamilies</code> returned in paginated output. When this parameter is used, <code>ListTaskDefinitions</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListTaskDefinitionFamilies</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>ListTaskDefinitionFamilies</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>

    Raises:
        capo_ecs.errors.access_denied_exception.AccessDeniedException: <p>You don't have authorization to perform the requested action.</p>
        capo_ecs.errors.client_exception.ClientException: <p>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.</p>
        capo_ecs.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter isn't valid. Review the available parameters for the API request.</p> <p>For more information about service event errors, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages-list.html">Amazon ECS service event messages</a>. </p>
        capo_ecs.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
        capo_ecs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list your registered task definition families
        This example lists all of your registered task definition families.

        >>> client.list_task_definition_families()
        To filter your registered task definition families
        This example lists the task definition revisions that start with "hpcc".

        >>> client.list_task_definition_families(family_prefix='hpcc')
    """

    def _handler(
        req: "OperationRequest[capo_ecs.types.list_task_definition_families_request.ListTaskDefinitionFamiliesRequest]",
    ) -> OperationResponse[
        "capo_ecs.types.list_task_definition_families_response.ListTaskDefinitionFamiliesResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.list_task_definition_families

        output, http_response = (
            capo_ecs._operations.amazon_ec2_container_service_v20141113.list_task_definition_families.list_task_definition_families(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTaskDefinitionFamilies")
    )
    input_: capo_ecs.types.list_task_definition_families_request.ListTaskDefinitionFamiliesRequest = {}
    if family_prefix is not None:
        input_["family_prefix"] = family_prefix
    if status is not None:
        input_["status"] = status
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output