Skip to content

list_service_quotas async

list_service_quotas(
    service_code: ServiceCode,
    *,
    config_overrides: Optional[AsyncServiceQuotasClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    quota_code: Optional[QuotaCode] = None,
    quota_applied_at_level: Optional[AppliedLevelEnum] = None,
) -> ListServiceQuotasResponse

Lists the applied quota values for the specified Amazon Web Services service. For some quotas, only the default values are available. If the applied quota value is not available for a quota, the quota is not retrieved. Filter responses to return applied quota values at either the account level, resource level, or all levels.

Parameters:

  • service_code (ServiceCode) –

    Specifies the service identifier. To find the service code value for an Amazon Web Services service, use the ListServices operation.

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

    Specifies a value for receiving additional results after you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.

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

    Specifies the maximum number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value appropriate to the operation. If additional items exist beyond those included in the current response, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results.

    An API operation can return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

  • quota_code (Optional[QuotaCode], default: None ) –

    Specifies the quota identifier. To find the quota code for a specific quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.

  • quota_applied_at_level (Optional[AppliedLevelEnum], default: None ) –

    Filters the response to return applied quota values for the ACCOUNT, RESOURCE, or ALL levels. ACCOUNT is the default.

Raises:

Source code in docs_src/capo_service_quotas/_services/async_service_quotas.py
async def list_service_quotas(
    self,
    service_code: "capo_service_quotas.types.service_code.ServiceCode",
    *,
    config_overrides: Optional[AsyncServiceQuotasClientConfig] = None,
    next_token: Optional["capo_service_quotas.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_service_quotas.types.max_results.MaxResults"
    ] = None,
    quota_code: Optional["capo_service_quotas.types.quota_code.QuotaCode"] = None,
    quota_applied_at_level: Optional[
        "capo_service_quotas.types.applied_level_enum.AppliedLevelEnum"
    ] = None,
) -> "capo_service_quotas.types.list_service_quotas_response.ListServiceQuotasResponse":
    """<p>Lists the applied quota values for the specified Amazon Web Services service. For some quotas, only the default values are available. If the applied quota value is not available for a quota, the quota is not retrieved. Filter responses to return applied quota values at either the account level, resource level, or all levels.</p>

    Args:
        service_code: <p>Specifies the service identifier. To find the service code value for an Amazon Web Services service, use the <a>ListServices</a> operation.</p>
        next_token: <p>Specifies a value for receiving additional results after you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value of the previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
        max_results: <p>Specifies the maximum number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value appropriate to the operation. If additional items exist beyond those included in the current response, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results.</p> <note> <p>An API operation can return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p> </note>
        quota_code: <p>Specifies the quota identifier. To find the quota code for a specific quota, use the <a>ListServiceQuotas</a> operation, and look for the <code>QuotaCode</code> response in the output for the quota you want.</p>
        quota_applied_at_level: <p>Filters the response to return applied quota values for the <code>ACCOUNT</code>, <code>RESOURCE</code>, or <code>ALL</code> levels. <code>ACCOUNT</code> is the default.</p>

    Raises:
        capo_service_quotas.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permission to perform this action.</p>
        capo_service_quotas.errors.illegal_argument_exception.IllegalArgumentException: <p>Invalid input was provided.</p>
        capo_service_quotas.errors.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>Invalid input was provided.</p>
        capo_service_quotas.errors.no_such_resource_exception.NoSuchResourceException: <p>The specified resource does not exist.</p>
        capo_service_quotas.errors.service_exception.ServiceException: <p>Something went wrong.</p>
        capo_service_quotas.errors.too_many_requests_exception.TooManyRequestsException: <p>Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase for this quota.</p>
        capo_service_quotas.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_service_quotas.types.list_service_quotas_request.ListServiceQuotasRequest]",
    ) -> AsyncOperationResponse[
        "capo_service_quotas.types.list_service_quotas_response.ListServiceQuotasResponse"
    ]:
        import capo_service_quotas._operations.service_quotas_v20190624.list_service_quotas

        (
            output,
            http_response,
        ) = await capo_service_quotas._operations.service_quotas_v20190624.list_service_quotas.async_list_service_quotas(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListServiceQuotas")
    )
    input_: capo_service_quotas.types.list_service_quotas_request.ListServiceQuotasRequest = {
        "service_code": service_code
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if quota_code is not None:
        input_["quota_code"] = quota_code
    if quota_applied_at_level is not None:
        input_["quota_applied_at_level"] = quota_applied_at_level

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