Skip to content

update_monitoring async

update_monitoring(
    cluster_arn: __string,
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    current_version: Optional[__string] = None,
    enhanced_monitoring: Optional[EnhancedMonitoring] = None,
    open_monitoring: Optional[OpenMonitoringInfo] = None,
    logging_info: Optional[LoggingInfo] = None,
) -> UpdateMonitoringResponse

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.

Parameters:

  • cluster_arn (__string) –

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

  • current_version (Optional[__string], default: None ) –

    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.

  • enhanced_monitoring (Optional[EnhancedMonitoring], default: None ) –

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

  • open_monitoring (Optional[OpenMonitoringInfo], default: None ) –

    The settings for open monitoring.

Raises:

Source code in docs_src/capo_kafka/_services/async_kafka.py
async def update_monitoring(
    self,
    cluster_arn: "capo_kafka.types.__string.__string",
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    current_version: Optional["capo_kafka.types.__string.__string"] = None,
    enhanced_monitoring: Optional[
        "capo_kafka.types.enhanced_monitoring.EnhancedMonitoring"
    ] = None,
    open_monitoring: Optional[
        "capo_kafka.types.open_monitoring_info.OpenMonitoringInfo"
    ] = None,
    logging_info: Optional["capo_kafka.types.logging_info.LoggingInfo"] = None,
) -> "capo_kafka.types.update_monitoring_response.UpdateMonitoringResponse":
    """<p>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.</p>

    Args:
        cluster_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
        current_version: <p>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.</p>
        enhanced_monitoring: <p>Specifies which Apache Kafka metrics Amazon MSK gathers and sends to Amazon CloudWatch for this cluster.</p>
        open_monitoring: <p>The settings for open monitoring.</p>

    Raises:
        capo_kafka.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
        capo_kafka.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
        capo_kafka.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
        capo_kafka.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returns information about an error.</p>
        capo_kafka.errors.unauthorized_exception.UnauthorizedException: <p>Returns information about an error.</p>
        capo_kafka.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kafka.types.update_monitoring_request.UpdateMonitoringRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafka.types.update_monitoring_response.UpdateMonitoringResponse"
    ]:
        import capo_kafka._operations.kafka.update_monitoring

        (
            output,
            http_response,
        ) = await capo_kafka._operations.kafka.update_monitoring.async_update_monitoring(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMonitoring")
    )
    input_: capo_kafka.types.update_monitoring_request.UpdateMonitoringRequest = {
        "cluster_arn": cluster_arn
    }
    if current_version is not None:
        input_["current_version"] = current_version
    if enhanced_monitoring is not None:
        input_["enhanced_monitoring"] = enhanced_monitoring
    if open_monitoring is not None:
        input_["open_monitoring"] = open_monitoring
    if logging_info is not None:
        input_["logging_info"] = logging_info

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output