Skip to content

describe_capacity_providers async

describe_capacity_providers(
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    capacity_providers: Optional[StringList] = None,
    cluster: Optional[String] = None,
    include: Optional[CapacityProviderFieldList] = None,
    max_results: Optional[BoxedInteger] = None,
    next_token: Optional[String] = None,
) -> DescribeCapacityProvidersResponse

Describes one or more of your capacity providers.

Parameters:

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

    The short name or full Amazon Resource Name (ARN) of one or more capacity providers. Up to 100 capacity providers can be described in an action.

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

    The name of the cluster to describe capacity providers for. When specified, only capacity providers associated with this cluster are returned, including Amazon ECS Managed Instances capacity providers.

  • include (Optional[CapacityProviderFieldList], default: None ) –

    Specifies whether or not you want to see the resource tags for the capacity provider. If TAGS is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.

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

    The maximum number of account setting results returned by DescribeCapacityProviders in paginated output. When this parameter is used, DescribeCapacityProviders 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 DescribeCapacityProviders request with the returned nextToken value. This value can be between 1 and 10. If this parameter is not used, then DescribeCapacityProviders returns up to 10 results and a nextToken value if applicable.

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

    The nextToken value returned from a previous paginated DescribeCapacityProviders request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

    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 describe all capacity providers This example retrieves details about all capacity providers.

>>> await client.describe_capacity_providers()
To describe a specific capacity provider
This example retrieves details about the capacity provider MyCapacityProvider
>>> await client.describe_capacity_providers(capacity_providers=['MyCapacityProvider'], include=['TAGS'])
Source code in docs_src/capo_ecs/_services/async_ecs.py
async def describe_capacity_providers(
    self,
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    capacity_providers: Optional["capo_ecs.types.string_list.StringList"] = None,
    cluster: Optional["capo_ecs.types.string.String"] = None,
    include: Optional[
        "capo_ecs.types.capacity_provider_field_list.CapacityProviderFieldList"
    ] = None,
    max_results: Optional["capo_ecs.types.boxed_integer.BoxedInteger"] = None,
    next_token: Optional["capo_ecs.types.string.String"] = None,
) -> "capo_ecs.types.describe_capacity_providers_response.DescribeCapacityProvidersResponse":
    """<p>Describes one or more of your capacity providers.</p>

    Args:
        capacity_providers: <p>The short name or full Amazon Resource Name (ARN) of one or more capacity providers. Up to <code>100</code> capacity providers can be described in an action.</p>
        cluster: <p>The name of the cluster to describe capacity providers for. When specified, only capacity providers associated with this cluster are returned, including Amazon ECS Managed Instances capacity providers.</p>
        include: <p>Specifies whether or not you want to see the resource tags for the capacity provider. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>
        max_results: <p>The maximum number of account setting results returned by <code>DescribeCapacityProviders</code> in paginated output. When this parameter is used, <code>DescribeCapacityProviders</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>DescribeCapacityProviders</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 10. If this parameter is not used, then <code>DescribeCapacityProviders</code> returns up to 10 results and a <code>nextToken</code> value if applicable.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeCapacityProviders</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</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 describe all capacity providers
        This example retrieves details about all capacity providers.

        >>> await client.describe_capacity_providers()
        To describe a specific capacity provider
        This example retrieves details about the capacity provider MyCapacityProvider

        >>> await client.describe_capacity_providers(capacity_providers=['MyCapacityProvider'], include=['TAGS'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecs.types.describe_capacity_providers_request.DescribeCapacityProvidersRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecs.types.describe_capacity_providers_response.DescribeCapacityProvidersResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.describe_capacity_providers

        (
            output,
            http_response,
        ) = await capo_ecs._operations.amazon_ec2_container_service_v20141113.describe_capacity_providers.async_describe_capacity_providers(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCapacityProviders")
    )
    input_: capo_ecs.types.describe_capacity_providers_request.DescribeCapacityProvidersRequest = {}
    if capacity_providers is not None:
        input_["capacity_providers"] = capacity_providers
    if cluster is not None:
        input_["cluster"] = cluster
    if include is not None:
        input_["include"] = include
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output