Skip to content

update_detector_model async

update_detector_model(
    detector_model_name: DetectorModelName,
    detector_model_definition: DetectorModelDefinition,
    role_arn: AmazonResourceName,
    *,
    config_overrides: Optional[AsyncIoTEventsClientConfig] = None,
    detector_model_description: Optional[DetectorModelDescription] = None,
    evaluation_method: Optional[EvaluationMethod] = None,
) -> UpdateDetectorModelResponse

Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created as new inputs arrive.

Parameters:

  • detector_model_name (DetectorModelName) –

    The name of the detector model that is updated.

  • detector_model_definition (DetectorModelDefinition) –

    Information that defines how a detector operates.

  • detector_model_description (Optional[DetectorModelDescription], default: None ) –

    A brief description of the detector model.

  • role_arn (AmazonResourceName) –

    The ARN of the role that grants permission to AWS IoT Events to perform its operations.

  • evaluation_method (Optional[EvaluationMethod], default: None ) –

    Information about the order in which events are evaluated and how actions are executed.

Raises:

Source code in docs_src/capo_iot_events/_services/async_io_t_events.py
async def update_detector_model(
    self,
    detector_model_name: "capo_iot_events.types.detector_model_name.DetectorModelName",
    detector_model_definition: "capo_iot_events.types.detector_model_definition.DetectorModelDefinition",
    role_arn: "capo_iot_events.types.amazon_resource_name.AmazonResourceName",
    *,
    config_overrides: Optional[AsyncIoTEventsClientConfig] = None,
    detector_model_description: Optional[
        "capo_iot_events.types.detector_model_description.DetectorModelDescription"
    ] = None,
    evaluation_method: Optional[
        "capo_iot_events.types.evaluation_method.EvaluationMethod"
    ] = None,
) -> "capo_iot_events.types.update_detector_model_response.UpdateDetectorModelResponse":
    """<p>Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created as new inputs arrive.</p>

    Args:
        detector_model_name: <p>The name of the detector model that is updated.</p>
        detector_model_definition: <p>Information that defines how a detector operates.</p>
        detector_model_description: <p>A brief description of the detector model.</p>
        role_arn: <p>The ARN of the role that grants permission to AWS IoT Events to perform its operations.</p>
        evaluation_method: <p>Information about the order in which events are evaluated and how actions are executed. </p>

    Raises:
        capo_iot_events.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_iot_events.errors.invalid_request_exception.InvalidRequestException: <p>The request was invalid.</p>
        capo_iot_events.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is in use.</p>
        capo_iot_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
        capo_iot_events.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_iot_events.errors.throttling_exception.ThrottlingException: <p>The request could not be completed due to throttling.</p>
        capo_iot_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_events.types.update_detector_model_request.UpdateDetectorModelRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_events.types.update_detector_model_response.UpdateDetectorModelResponse"
    ]:
        import capo_iot_events._operations.iot_columbo_service.update_detector_model

        (
            output,
            http_response,
        ) = await capo_iot_events._operations.iot_columbo_service.update_detector_model.async_update_detector_model(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDetectorModel")
    )
    input_: capo_iot_events.types.update_detector_model_request.UpdateDetectorModelRequest = {
        "detector_model_name": detector_model_name,
        "detector_model_definition": detector_model_definition,
        "role_arn": role_arn,
    }
    if detector_model_description is not None:
        input_["detector_model_description"] = detector_model_description
    if evaluation_method is not None:
        input_["evaluation_method"] = evaluation_method

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