Skip to content

describe_services async

describe_services(
    *,
    config_overrides: Optional[AsyncPricingClientConfig] = None,
    service_code: Optional[String] = None,
    format_version: Optional[FormatVersion] = None,
    next_token: Optional[String] = None,
    max_results: Optional[DescribeServicesMaxResults] = None,
) -> DescribeServicesResponse

Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as AmazonEC2, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 are volumeType, maxIopsVolume, operation, locationType, and instanceCapacity10xlarge.

Parameters:

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

    The code for the service whose information you want to retrieve, such as AmazonEC2. You can use the ServiceCode to filter the results in a GetProducts call. To retrieve a list of all services, leave this blank.

  • format_version (Optional[FormatVersion], default: None ) –

    The format version that you want the response to be in.

    Valid values are: aws_v1

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

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

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

    The maximum number of results that you want returned in the response.

Raises:

Examples:

To retrieve a list of services and service codes Retrieves the service for the given Service Code.

>>> await client.describe_services(service_code='AmazonEC2', format_version='aws_v1', max_results=1)
Source code in docs_src/capo_pricing/_services/async_pricing.py
async def describe_services(
    self,
    *,
    config_overrides: Optional[AsyncPricingClientConfig] = None,
    service_code: Optional["capo_pricing.types.string.String"] = None,
    format_version: Optional[
        "capo_pricing.types.format_version.FormatVersion"
    ] = None,
    next_token: Optional["capo_pricing.types.string.String"] = None,
    max_results: Optional[
        "capo_pricing.types.describe_services_max_results.DescribeServicesMaxResults"
    ] = None,
) -> "capo_pricing.types.describe_services_response.DescribeServicesResponse":
    """<p>Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as <code>AmazonEC2</code>, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 are <code>volumeType</code>, <code>maxIopsVolume</code>, <code>operation</code>, <code>locationType</code>, and <code>instanceCapacity10xlarge</code>.</p>

    Args:
        service_code: <p>The code for the service whose information you want to retrieve, such as <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the results in a <code>GetProducts</code> call. To retrieve a list of all services, leave this blank.</p>
        format_version: <p>The format version that you want the response to be in.</p> <p>Valid values are: <code>aws_v1</code> </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 that you want returned 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.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.

    Examples:
        To retrieve a list of services and service codes
        Retrieves the service for the given Service Code.

        >>> await client.describe_services(service_code='AmazonEC2', format_version='aws_v1', max_results=1)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pricing.types.describe_services_request.DescribeServicesRequest]",
    ) -> AsyncOperationResponse[
        "capo_pricing.types.describe_services_response.DescribeServicesResponse"
    ]:
        import capo_pricing._operations.aws_price_list_service.describe_services

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeServices")
    )
    input_: capo_pricing.types.describe_services_request.DescribeServicesRequest = {}
    if service_code is not None:
        input_["service_code"] = service_code
    if format_version is not None:
        input_["format_version"] = format_version
    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