Skip to content

put_external_model

put_external_model(
    model_endpoint: sageMakerEndpointIdentifier,
    model_source: ModelSource,
    invoke_model_endpoint_role_arn: string,
    input_configuration: ModelInputConfiguration,
    output_configuration: ModelOutputConfiguration,
    model_endpoint_status: ModelEndpointStatus,
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    tags: Optional[tagList] = None,
) -> PutExternalModelResult

Creates or updates an Amazon SageMaker model endpoint. You can also use this action to update the configuration of the model endpoint, including the IAM role and/or the mapped variables.

Parameters:

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • ConflictException –

    An exception indicating there was a conflict during a delete operation.

  • InternalServerException –

    An exception indicating an internal server error.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

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

Source code in docs_src/capo_frauddetector/_services/fraud_detector.py
def put_external_model(
    self,
    model_endpoint: "capo_frauddetector.types.sage_maker_endpoint_identifier.sageMakerEndpointIdentifier",
    model_source: "capo_frauddetector.types.model_source.ModelSource",
    invoke_model_endpoint_role_arn: "capo_frauddetector.types.string.string",
    input_configuration: "capo_frauddetector.types.model_input_configuration.ModelInputConfiguration",
    output_configuration: "capo_frauddetector.types.model_output_configuration.ModelOutputConfiguration",
    model_endpoint_status: "capo_frauddetector.types.model_endpoint_status.ModelEndpointStatus",
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    tags: Optional["capo_frauddetector.types.tag_list.tagList"] = None,
) -> "capo_frauddetector.types.put_external_model_result.PutExternalModelResult":
    """<p>Creates or updates an Amazon SageMaker model endpoint. You can also use this action to update the configuration of the model endpoint, including the IAM role and/or the mapped variables. </p>

    Args:
        model_endpoint: <p>The model endpoints name.</p>
        model_source: <p>The source of the model.</p>
        invoke_model_endpoint_role_arn: <p>The IAM role used to invoke the model endpoint.</p>
        input_configuration: <p>The model endpoint input configuration.</p>
        output_configuration: <p>The model endpoint output configuration.</p>
        model_endpoint_status: <p>The model endpoint’s status in Amazon Fraud Detector.</p>
        tags: <p>A collection of key and value pairs.</p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.conflict_exception.ConflictException: <p>An exception indicating there was a conflict during a delete operation.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_frauddetector.types.put_external_model_request.PutExternalModelRequest]",
    ) -> OperationResponse[
        "capo_frauddetector.types.put_external_model_result.PutExternalModelResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.put_external_model

        output, http_response = (
            capo_frauddetector._operations.aws_hawks_nest_service_facade.put_external_model.put_external_model(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutExternalModel")
    )
    input_: capo_frauddetector.types.put_external_model_request.PutExternalModelRequest = {
        "model_endpoint": model_endpoint,
        "model_source": model_source,
        "invoke_model_endpoint_role_arn": invoke_model_endpoint_role_arn,
        "input_configuration": input_configuration,
        "output_configuration": output_configuration,
        "model_endpoint_status": model_endpoint_status,
    }
    if tags is not None:
        input_["tags"] = tags

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