Gets information about whether additional CloudWatch metrics are enabled for the specified CloudFront distribution.
Parameters:
-
distribution_id
(string)
–
The ID of the distribution that you are getting metrics information for.
Raises:
Source code in docs_src/capo_cloudfront/_services/cloud_front.py
| def get_monitoring_subscription(
self,
distribution_id: "capo_cloudfront.types.string.string",
*,
config_overrides: Optional[CloudFrontClientConfig] = None,
) -> "capo_cloudfront.types.get_monitoring_subscription_result.GetMonitoringSubscriptionResult":
"""<p>Gets information about whether additional CloudWatch metrics are enabled for the specified CloudFront distribution.</p>
Args:
distribution_id: <p>The ID of the distribution that you are getting metrics information for.</p>
Raises:
capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
capo_cloudfront.errors.no_such_distribution.NoSuchDistribution: <p>The specified distribution does not exist.</p>
capo_cloudfront.errors.no_such_monitoring_subscription.NoSuchMonitoringSubscription: <p>A monitoring subscription does not exist for the specified distribution.</p>
capo_cloudfront.errors.unsupported_operation.UnsupportedOperation: <p>This operation is not supported in this Amazon Web Services Region.</p>
capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudfront.types.get_monitoring_subscription_request.GetMonitoringSubscriptionRequest]",
) -> OperationResponse[
"capo_cloudfront.types.get_monitoring_subscription_result.GetMonitoringSubscriptionResult"
]:
import capo_cloudfront._operations.cloudfront2020_05_31.get_monitoring_subscription
output, http_response = (
capo_cloudfront._operations.cloudfront2020_05_31.get_monitoring_subscription.get_monitoring_subscription(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetMonitoringSubscription")
)
input_: capo_cloudfront.types.get_monitoring_subscription_request.GetMonitoringSubscriptionRequest = {
"distribution_id": distribution_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|