Skip to content

update_model_monitor_config async

update_model_monitor_config(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    model_monitor_config_name_or_arn: Optional[ModelMonitorConfigNameOrArn] = None,
    evaluation_config: Optional[EvaluationConfig] = None,
    schedule_config: Optional[ModelMonitorScheduleConfig] = None,
    role_arn: Optional[RoleArn] = None,
    enabled: Optional[Boolean] = None,
    client_token: Optional[ModelMonitorClientToken] = None,
) -> UpdateModelMonitorConfigResponse

Updates a model monitor configuration. Parameters that you don't specify keep their current values. If another request modifies the configuration at the same time, you get a ConflictException.

The operation runs synchronously and is idempotent. If you retry the request with the same ClientToken, you get the result of the original request.

This operation is in public preview release for Amazon SageMaker AI and is subject to change. This feature is not recommended for production environments.

Parameters:

  • model_monitor_config_name_or_arn (Optional[ModelMonitorConfigNameOrArn], default: None ) –

    The name or Amazon Resource Name (ARN) of the model monitor configuration. Specify one of the following:

    • The name of the model monitor configuration.

    • The Amazon Resource Name (ARN) of the model monitor configuration.

  • evaluation_config (Optional[EvaluationConfig], default: None ) –

    The evaluation monitoring settings. The settings that you specify replace the current evaluation settings. If you omit this parameter, the current value doesn't change.

  • schedule_config (Optional[ModelMonitorScheduleConfig], default: None ) –

    The schedule on which the model monitor configuration runs. If you omit this parameter, the current value doesn't change.

  • role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role that the model monitor configuration uses. If you omit this parameter, the current value doesn't change.

  • enabled (Optional[Boolean], default: None ) –

    Specifies whether the model monitor configuration is enabled. Use this parameter to pause or resume the configuration.

    • true - Resume the configuration. The status becomes Active, and the configuration runs on its schedule.

    • false - Pause the configuration. The status becomes Inactive. The configuration keeps its schedule but doesn't run.

    If you omit this parameter, the configuration stays enabled or disabled as it is. You can enable or disable a configuration only when its status is Active or Inactive. Otherwise, you get a ConflictException.

  • client_token (Optional[ModelMonitorClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token, you get the result of the original request and no error.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def update_model_monitor_config(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    model_monitor_config_name_or_arn: Optional[
        "capo_sagemaker.types.model_monitor_config_name_or_arn.ModelMonitorConfigNameOrArn"
    ] = None,
    evaluation_config: Optional[
        "capo_sagemaker.types.evaluation_config.EvaluationConfig"
    ] = None,
    schedule_config: Optional[
        "capo_sagemaker.types.model_monitor_schedule_config.ModelMonitorScheduleConfig"
    ] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    enabled: Optional["capo_sagemaker.types.boolean.Boolean"] = None,
    client_token: Optional[
        "capo_sagemaker.types.model_monitor_client_token.ModelMonitorClientToken"
    ] = None,
) -> "capo_sagemaker.types.update_model_monitor_config_response.UpdateModelMonitorConfigResponse":
    """<p>Updates a model monitor configuration. Parameters that you don't specify keep their current values. If another request modifies the configuration at the same time, you get a <code>ConflictException</code>.</p> <p>The operation runs synchronously and is idempotent. If you retry the request with the same <code>ClientToken</code>, you get the result of the original request.</p> <note> <p>This operation is in public preview release for Amazon SageMaker AI and is subject to change. This feature is not recommended for production environments.</p> </note>

    Args:
        model_monitor_config_name_or_arn: <p>The name or Amazon Resource Name (ARN) of the model monitor configuration. Specify one of the following:</p> <ul> <li> <p>The name of the model monitor configuration.</p> </li> <li> <p>The Amazon Resource Name (ARN) of the model monitor configuration.</p> </li> </ul>
        evaluation_config: <p>The evaluation monitoring settings. The settings that you specify replace the current evaluation settings. If you omit this parameter, the current value doesn't change.</p>
        schedule_config: <p>The schedule on which the model monitor configuration runs. If you omit this parameter, the current value doesn't change.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that the model monitor configuration uses. If you omit this parameter, the current value doesn't change.</p>
        enabled: <p>Specifies whether the model monitor configuration is enabled. Use this parameter to pause or resume the configuration.</p> <ul> <li> <p> <code>true</code> - Resume the configuration. The status becomes <code>Active</code>, and the configuration runs on its schedule.</p> </li> <li> <p> <code>false</code> - Pause the configuration. The status becomes <code>Inactive</code>. The configuration keeps its schedule but doesn't run.</p> </li> </ul> <p>If you omit this parameter, the configuration stays enabled or disabled as it is. You can enable or disable a configuration only when its status is <code>Active</code> or <code>Inactive</code>. Otherwise, you get a <code>ConflictException</code>.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token, you get the result of the original request and no error.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_model_monitor_config_request.UpdateModelMonitorConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_model_monitor_config_response.UpdateModelMonitorConfigResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_model_monitor_config

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.update_model_monitor_config.async_update_model_monitor_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateModelMonitorConfig")
    )
    input_: capo_sagemaker.types.update_model_monitor_config_request.UpdateModelMonitorConfigRequest = {}
    if model_monitor_config_name_or_arn is not None:
        input_["model_monitor_config_name_or_arn"] = (
            model_monitor_config_name_or_arn
        )
    if evaluation_config is not None:
        input_["evaluation_config"] = evaluation_config
    if schedule_config is not None:
        input_["schedule_config"] = schedule_config
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if enabled is not None:
        input_["enabled"] = enabled
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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