Skip to content

update_monitoring_alert

update_monitoring_alert(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    monitoring_schedule_name: Optional[MonitoringScheduleName] = None,
    monitoring_alert_name: Optional[MonitoringAlertName] = None,
    datapoints_to_alert: Optional[MonitoringDatapointsToAlert] = None,
    evaluation_period: Optional[MonitoringEvaluationPeriod] = None,
) -> UpdateMonitoringAlertResponse

Update the parameters of a model monitor alert.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_monitoring_alert(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    monitoring_schedule_name: Optional[
        "capo_sagemaker.types.monitoring_schedule_name.MonitoringScheduleName"
    ] = None,
    monitoring_alert_name: Optional[
        "capo_sagemaker.types.monitoring_alert_name.MonitoringAlertName"
    ] = None,
    datapoints_to_alert: Optional[
        "capo_sagemaker.types.monitoring_datapoints_to_alert.MonitoringDatapointsToAlert"
    ] = None,
    evaluation_period: Optional[
        "capo_sagemaker.types.monitoring_evaluation_period.MonitoringEvaluationPeriod"
    ] = None,
) -> "capo_sagemaker.types.update_monitoring_alert_response.UpdateMonitoringAlertResponse":
    """<p>Update the parameters of a model monitor alert.</p>

    Args:
        monitoring_schedule_name: <p>The name of a monitoring schedule.</p>
        monitoring_alert_name: <p>The name of a monitoring alert.</p>
        datapoints_to_alert: <p>Within <code>EvaluationPeriod</code>, how many execution failures will raise an alert.</p>
        evaluation_period: <p>The number of most recent monitoring executions to consider when evaluating alert status.</p>

    Raises:
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_monitoring_alert_request.UpdateMonitoringAlertRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_monitoring_alert_response.UpdateMonitoringAlertResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_monitoring_alert

        output, http_response = (
            capo_sagemaker._operations.sage_maker.update_monitoring_alert.update_monitoring_alert(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMonitoringAlert")
    )
    input_: capo_sagemaker.types.update_monitoring_alert_request.UpdateMonitoringAlertRequest = {}
    if monitoring_schedule_name is not None:
        input_["monitoring_schedule_name"] = monitoring_schedule_name
    if monitoring_alert_name is not None:
        input_["monitoring_alert_name"] = monitoring_alert_name
    if datapoints_to_alert is not None:
        input_["datapoints_to_alert"] = datapoints_to_alert
    if evaluation_period is not None:
        input_["evaluation_period"] = evaluation_period

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output