batchDeleteRumMetricDefinitions method

Future<BatchDeleteRumMetricDefinitionsResponse> batchDeleteRumMetricDefinitions({
  1. required String appMonitorName,
  2. required MetricDestination destination,
  3. required List<String> metricDefinitionIds,
  4. String? destinationArn,
})

Removes the specified metrics from being sent to an extended metrics destination.

If some metric definition IDs specified in a BatchDeleteRumMetricDefinitions operations are not valid, those metric definitions fail and return errors, but all valid metric definition IDs in the same operation are still deleted.

The maximum number of metric definitions that you can specify in one BatchDeleteRumMetricDefinitions operation is 200.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter appMonitorName : The name of the CloudWatch RUM app monitor that is sending these metrics.

Parameter destination : Defines the destination where you want to stop sending the specified metrics. Valid values are CloudWatch and Evidently. If you specify Evidently, you must also specify the ARN of the CloudWatchEvidently experiment that is to be the destination and an IAM role that has permission to write to the experiment.

Parameter metricDefinitionIds : An array of structures which define the metrics that you want to stop sending.

Parameter destinationArn : This parameter is required if Destination is Evidently. If Destination is CloudWatch, do not use this parameter.

This parameter specifies the ARN of the Evidently experiment that was receiving the metrics that are being deleted.

Implementation

Future<BatchDeleteRumMetricDefinitionsResponse>
    batchDeleteRumMetricDefinitions({
  required String appMonitorName,
  required MetricDestination destination,
  required List<String> metricDefinitionIds,
  String? destinationArn,
}) async {
  final $query = <String, List<String>>{
    'destination': [destination.value],
    'metricDefinitionIds': metricDefinitionIds,
    if (destinationArn != null) 'destinationArn': [destinationArn],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/rummetrics/${Uri.encodeComponent(appMonitorName)}/metrics',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return BatchDeleteRumMetricDefinitionsResponse.fromJson(response);
}