Skip to content

get_subscription

get_subscription(
    arn: SubscriptionArn,
    *,
    config_overrides: Optional[PricingPlanManagerClientConfig] = None,
) -> GetSubscriptionOutput

Returns the details of a flat-rate pricing subscription, including its current status, associated resources, and any pending scheduled changes.

Parameters:

Raises:

  • AccessDeniedException –

    You do not have the required permissions to perform this operation. Verify that your IAM policy grants access to this action.

  • InternalServerException –

    An unexpected error occurred on the server. Retry the request.

  • ResourceNotFoundException –

    The specified subscription was not found. Verify that the ARN is correct and that the subscription belongs to your account.

  • ThrottlingException –

    The request rate exceeds the allowed limit. Wait briefly and retry the request.

  • ValidationException –

    The request failed a business rule validation. For example, the specified resource might already be associated with another subscription, or the subscription might not be in the required state for this operation.

  • UnknownServiceError –

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

Examples:

Get subscription details

>>> client.get_subscription(arn='arn:aws:pricingplanmanager::123456789012:subscription/sub-1234567890')
Source code in docs_src/capo_pricing_plan_manager/_services/pricing_plan_manager.py
def get_subscription(
    self,
    arn: "capo_pricing_plan_manager.types.subscription_arn.SubscriptionArn",
    *,
    config_overrides: Optional[PricingPlanManagerClientConfig] = None,
) -> (
    "capo_pricing_plan_manager.types.get_subscription_output.GetSubscriptionOutput"
):
    """<p>Returns the details of a flat-rate pricing subscription, including its current status, associated resources, and any pending scheduled changes.</p>

    Args:
        arn: <p>The ARN of the subscription to retrieve.</p>

    Raises:
        capo_pricing_plan_manager.errors.access_denied_exception.AccessDeniedException: <p>You do not have the required permissions to perform this operation. Verify that your IAM policy grants access to this action.</p>
        capo_pricing_plan_manager.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred on the server. Retry the request.</p>
        capo_pricing_plan_manager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified subscription was not found. Verify that the ARN is correct and that the subscription belongs to your account.</p>
        capo_pricing_plan_manager.errors.throttling_exception.ThrottlingException: <p>The request rate exceeds the allowed limit. Wait briefly and retry the request.</p>
        capo_pricing_plan_manager.errors.validation_exception.ValidationException: <p>The request failed a business rule validation. For example, the specified resource might already be associated with another subscription, or the subscription might not be in the required state for this operation.</p>
        capo_pricing_plan_manager.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get subscription details

        >>> client.get_subscription(arn='arn:aws:pricingplanmanager::123456789012:subscription/sub-1234567890')
    """

    def _handler(
        req: "OperationRequest[capo_pricing_plan_manager.types.get_subscription_input.GetSubscriptionInput]",
    ) -> OperationResponse[
        "capo_pricing_plan_manager.types.get_subscription_output.GetSubscriptionOutput"
    ]:
        import capo_pricing_plan_manager._operations.aws_pricing_plan_manager.get_subscription

        output, http_response = (
            capo_pricing_plan_manager._operations.aws_pricing_plan_manager.get_subscription.get_subscription(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSubscription")
    )
    input_: capo_pricing_plan_manager.types.get_subscription_input.GetSubscriptionInput = {
        "arn": arn
    }

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