Skip to content

list_daemons

list_daemons(
    *,
    config_overrides: Optional[ECSClientConfig] = None,
    cluster_arn: Optional[String] = None,
    capacity_provider_arns: Optional[StringList] = None,
    max_results: Optional[BoxedInteger] = None,
    next_token: Optional[String] = None,
) -> ListDaemonsResponse

Returns a list of daemons. You can filter the results by cluster or capacity provider.

Parameters:

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

    The Amazon Resource Name (ARN) of the cluster to filter daemons by. If you do not specify a cluster, the default cluster is assumed.

  • capacity_provider_arns (Optional[StringList], default: None ) –

    The Amazon Resource Names (ARNs) of the capacity providers to filter daemons by. Only daemons associated with the specified capacity providers are returned.

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

    The maximum number of daemon results that ListDaemons returned in paginated output. When this parameter is used, ListDaemons 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 ListDaemons request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then ListDaemons returns up to 100 results and a nextToken value if applicable.

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

    The nextToken value returned from a ListDaemons request indicating that more results are available to fulfill the request and further calls will be needed. If maxResults was provided, it's possible for 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.

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.

  • ClusterNotFoundException –

    The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.

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

  • UnsupportedFeatureException –

    The specified task isn't supported in this Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To list daemons in a cluster This example lists all daemons in the specified cluster.

>>> client.list_daemons(cluster_arn='arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster')
Source code in docs_src/capo_ecs/_services/ecs.py
def list_daemons(
    self,
    *,
    config_overrides: Optional[ECSClientConfig] = None,
    cluster_arn: Optional["capo_ecs.types.string.String"] = None,
    capacity_provider_arns: Optional[
        "capo_ecs.types.string_list.StringList"
    ] = None,
    max_results: Optional["capo_ecs.types.boxed_integer.BoxedInteger"] = None,
    next_token: Optional["capo_ecs.types.string.String"] = None,
) -> "capo_ecs.types.list_daemons_response.ListDaemonsResponse":
    """<p>Returns a list of daemons. You can filter the results by cluster or capacity provider.</p>

    Args:
        cluster_arn: <p>The Amazon Resource Name (ARN) of the cluster to filter daemons by. If you do not specify a cluster, the default cluster is assumed.</p>
        capacity_provider_arns: <p>The Amazon Resource Names (ARNs) of the capacity providers to filter daemons by. Only daemons associated with the specified capacity providers are returned.</p>
        max_results: <p>The maximum number of daemon results that <code>ListDaemons</code> returned in paginated output. When this parameter is used, <code>ListDaemons</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>ListDaemons</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>ListDaemons</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
        next_token: <p>The <code>nextToken</code> value returned from a <code>ListDaemons</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's possible for 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>

    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.cluster_not_found_exception.ClusterNotFoundException: <p>The specified cluster wasn't found. You can view your available clusters with <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html">ListClusters</a>. Amazon ECS clusters are Region specific.</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.unsupported_feature_exception.UnsupportedFeatureException: <p>The specified task isn't supported in this Region.</p>
        capo_ecs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list daemons in a cluster
        This example lists all daemons in the specified cluster.

        >>> client.list_daemons(cluster_arn='arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster')
    """

    def _handler(
        req: "OperationRequest[capo_ecs.types.list_daemons_request.ListDaemonsRequest]",
    ) -> OperationResponse[
        "capo_ecs.types.list_daemons_response.ListDaemonsResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.list_daemons

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDaemons")
    )
    input_: capo_ecs.types.list_daemons_request.ListDaemonsRequest = {}
    if cluster_arn is not None:
        input_["cluster_arn"] = cluster_arn
    if capacity_provider_arns is not None:
        input_["capacity_provider_arns"] = capacity_provider_arns
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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