createMonitoringSubscription2020_05_31 method
Future<CreateMonitoringSubscriptionResult>
createMonitoringSubscription2020_05_31({
- required String distributionId,
- required MonitoringSubscription monitoringSubscription,
Enables additional CloudWatch metrics for the specified CloudFront distribution. The additional metrics incur an additional cost.
For more information, see Viewing additional CloudFront distribution metrics in the Amazon CloudFront Developer Guide.
May throw AccessDenied. May throw NoSuchDistribution.
Parameter distributionId
:
The ID of the distribution that you are enabling metrics for.
Parameter monitoringSubscription
:
A monitoring subscription. This structure contains information about
whether additional CloudWatch metrics are enabled for a given CloudFront
distribution.
Implementation
Future<CreateMonitoringSubscriptionResult>
createMonitoringSubscription2020_05_31({
required String distributionId,
required MonitoringSubscription monitoringSubscription,
}) async {
ArgumentError.checkNotNull(distributionId, 'distributionId');
ArgumentError.checkNotNull(
monitoringSubscription, 'monitoringSubscription');
final $result = await _protocol.sendRaw(
method: 'POST',
requestUri:
'/2020-05-31/distributions/${Uri.encodeComponent(distributionId)}/monitoring-subscription',
payload: monitoringSubscription.toXml('MonitoringSubscription'),
exceptionFnMap: _exceptionFns,
);
final $elem = await _s.xmlFromResponse($result);
return CreateMonitoringSubscriptionResult(
monitoringSubscription: MonitoringSubscription.fromXml($elem),
);
}