Skip to content

list_price_lists async

list_price_lists(
    service_code: ServiceCode,
    effective_date: EffectiveDate,
    currency_code: CurrencyCode,
    *,
    config_overrides: Optional[AsyncPricingClientConfig] = None,
    region_code: Optional[RegionCode] = None,
    next_token: Optional[String] = None,
    max_results: Optional[MaxResults] = None,
) -> ListPriceListsResponse

This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (Section 1.10).

This returns a list of Price List references that the requester if authorized to view, given a ServiceCode, CurrencyCode, and an EffectiveDate. Use without a RegionCode filter to list Price List references from all available Amazon Web Services Regions. Use with a RegionCode filter to get the Price List reference that's specific to a specific Amazon Web Services Region. You can use the PriceListArn from the response to get your preferred Price List files through the GetPriceListFileUrl API.

Parameters:

  • service_code (ServiceCode) –

    The service code or the Savings Plans service code for the attributes that you want to retrieve. For example, to get the list of applicable Amazon EC2 price lists, use AmazonEC2. For a full list of service codes containing On-Demand and Reserved Instance (RI) pricing, use the DescribeServices API.

    To retrieve the Reserved Instance and Compute Savings Plans price lists, use ComputeSavingsPlans.

    To retrieve Machine Learning Savings Plans price lists, use MachineLearningSavingsPlans.

  • effective_date (EffectiveDate) –

    The date that the Price List file prices are effective from.

  • region_code (Optional[RegionCode], default: None ) –

    This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the US East (N. Virginia) Region, use us-east-1. If nothing is specified, you retrieve price lists for all applicable Regions. The available RegionCode list can be retrieved from GetAttributeValues API.

  • currency_code (CurrencyCode) –

    The three alphabetical character ISO-4217 currency code that the Price List files are denominated in.

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

    The pagination token that indicates the next set of results that you want to retrieve.

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

    The maximum number of results to return in the response.

Raises:

Source code in docs_src/capo_pricing/_services/async_pricing.py
async def list_price_lists(
    self,
    service_code: "capo_pricing.types.service_code.ServiceCode",
    effective_date: "capo_pricing.types.effective_date.EffectiveDate",
    currency_code: "capo_pricing.types.currency_code.CurrencyCode",
    *,
    config_overrides: Optional[AsyncPricingClientConfig] = None,
    region_code: Optional["capo_pricing.types.region_code.RegionCode"] = None,
    next_token: Optional["capo_pricing.types.string.String"] = None,
    max_results: Optional["capo_pricing.types.max_results.MaxResults"] = None,
) -> "capo_pricing.types.list_price_lists_response.ListPriceListsResponse":
    """<p> <i> <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the <a href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b> </i> </p> <p>This returns a list of Price List references that the requester if authorized to view, given a <code>ServiceCode</code>, <code>CurrencyCode</code>, and an <code>EffectiveDate</code>. Use without a <code>RegionCode</code> filter to list Price List references from all available Amazon Web Services Regions. Use with a <code>RegionCode</code> filter to get the Price List reference that's specific to a specific Amazon Web Services Region. You can use the <code>PriceListArn</code> from the response to get your preferred Price List files through the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html">GetPriceListFileUrl</a> API.</p>

    Args:
        service_code: <p>The service code or the Savings Plans service code for the attributes that you want to retrieve. For example, to get the list of applicable Amazon EC2 price lists, use <code>AmazonEC2</code>. For a full list of service codes containing On-Demand and Reserved Instance (RI) pricing, use the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html#awscostmanagement-pricing_DescribeServices-request-FormatVersion">DescribeServices</a> API.</p> <p>To retrieve the Reserved Instance and Compute Savings Plans price lists, use <code>ComputeSavingsPlans</code>. </p> <p>To retrieve Machine Learning Savings Plans price lists, use <code>MachineLearningSavingsPlans</code>. </p>
        effective_date: <p>The date that the Price List file prices are effective from. </p>
        region_code: <p>This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the <code>US East (N. Virginia)</code> Region, use <code>us-east-1</code>. If nothing is specified, you retrieve price lists for all applicable Regions. The available <code>RegionCode</code> list can be retrieved from <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html">GetAttributeValues</a> API.</p>
        currency_code: <p>The three alphabetical character ISO-4217 currency code that the Price List files are denominated in. </p>
        next_token: <p>The pagination token that indicates the next set of results that you want to retrieve. </p>
        max_results: <p>The maximum number of results to return in the response. </p>

    Raises:
        capo_pricing.errors.access_denied_exception.AccessDeniedException: <p>General authentication failure. The request wasn't signed correctly.</p>
        capo_pricing.errors.expired_next_token_exception.ExpiredNextTokenException: <p>The pagination token expired. Try again without a pagination token.</p>
        capo_pricing.errors.internal_error_exception.InternalErrorException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
        capo_pricing.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid. Try again without a pagination token.</p>
        capo_pricing.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters had an invalid value.</p>
        capo_pricing.errors.not_found_exception.NotFoundException: <p>The requested resource can't be found.</p>
        capo_pricing.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_pricing.errors.throttling_exception.ThrottlingException: <p>You've made too many requests exceeding service quotas. </p>
        capo_pricing.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pricing.types.list_price_lists_request.ListPriceListsRequest]",
    ) -> AsyncOperationResponse[
        "capo_pricing.types.list_price_lists_response.ListPriceListsResponse"
    ]:
        import capo_pricing._operations.aws_price_list_service.list_price_lists

        (
            output,
            http_response,
        ) = await capo_pricing._operations.aws_price_list_service.list_price_lists.async_list_price_lists(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPriceLists")
    )
    input_: capo_pricing.types.list_price_lists_request.ListPriceListsRequest = {
        "service_code": service_code,
        "effective_date": effective_date,
        "currency_code": currency_code,
    }
    if region_code is not None:
        input_["region_code"] = region_code
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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