updateMonitoring method

Future<UpdateMonitoringResponse> updateMonitoring({
  1. required String clusterArn,
  2. required String currentVersion,
  3. EnhancedMonitoring? enhancedMonitoring,
  4. LoggingInfo? loggingInfo,
  5. OpenMonitoringInfo? openMonitoring,
})

Updates the monitoring settings for the cluster. You can use this operation to specify which Apache Kafka metrics you want Amazon MSK to send to Amazon CloudWatch. You can also specify settings for open monitoring with Prometheus.

May throw ServiceUnavailableException. May throw BadRequestException. May throw UnauthorizedException. May throw InternalServerErrorException. May throw ForbiddenException.

Parameter clusterArn :

The Amazon Resource Name (ARN) that uniquely identifies the cluster.

Parameter currentVersion :

The version of the MSK cluster to update. Cluster versions aren't simple numbers. You can describe an MSK cluster to find its version. When this update operation is successful, it generates a new cluster version.

Parameter enhancedMonitoring :

Specifies which Apache Kafka metrics Amazon MSK gathers and sends to Amazon CloudWatch for this cluster.

Parameter openMonitoring :

The settings for open monitoring.

Implementation

Future<UpdateMonitoringResponse> updateMonitoring({
  required String clusterArn,
  required String currentVersion,
  EnhancedMonitoring? enhancedMonitoring,
  LoggingInfo? loggingInfo,
  OpenMonitoringInfo? openMonitoring,
}) async {
  ArgumentError.checkNotNull(clusterArn, 'clusterArn');
  ArgumentError.checkNotNull(currentVersion, 'currentVersion');
  final $payload = <String, dynamic>{
    'currentVersion': currentVersion,
    if (enhancedMonitoring != null)
      'enhancedMonitoring': enhancedMonitoring.toValue(),
    if (loggingInfo != null) 'loggingInfo': loggingInfo,
    if (openMonitoring != null) 'openMonitoring': openMonitoring,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/v1/clusters/${Uri.encodeComponent(clusterArn)}/monitoring',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateMonitoringResponse.fromJson(response);
}