Skip to content

create_realtime_endpoint async

create_realtime_endpoint(
    ml_model_id: EntityId,
    *,
    config_overrides: Optional[AsyncMachineLearningClientConfig] = None,
) -> CreateRealtimeEndpointOutput

Creates a real-time endpoint for the MLModel. The endpoint contains the URI of the MLModel; that is, the location to send real-time prediction requests for the specified MLModel.

Parameters:

  • ml_model_id (EntityId) –

    The ID assigned to the MLModel during creation.

Raises:

Source code in docs_src/capo_machine_learning/_services/async_machine_learning.py
async def create_realtime_endpoint(
    self,
    ml_model_id: "capo_machine_learning.types.entity_id.EntityId",
    *,
    config_overrides: Optional[AsyncMachineLearningClientConfig] = None,
) -> "capo_machine_learning.types.create_realtime_endpoint_output.CreateRealtimeEndpointOutput":
    """<p>Creates a real-time endpoint for the <code>MLModel</code>. The endpoint contains the URI of the <code>MLModel</code>; that is, the location to send real-time prediction requests for the specified <code>MLModel</code>.</p>

    Args:
        ml_model_id: <p>The ID assigned to the <code>MLModel</code> during creation.</p>

    Raises:
        capo_machine_learning.errors.internal_server_exception.InternalServerException: <p>An error on the server occurred when trying to process a request.</p>
        capo_machine_learning.errors.invalid_input_exception.InvalidInputException: <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
        capo_machine_learning.errors.resource_not_found_exception.ResourceNotFoundException: <p>A specified resource cannot be located.</p>
        capo_machine_learning.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_machine_learning.types.create_realtime_endpoint_input.CreateRealtimeEndpointInput]",
    ) -> AsyncOperationResponse[
        "capo_machine_learning.types.create_realtime_endpoint_output.CreateRealtimeEndpointOutput"
    ]:
        import capo_machine_learning._operations.amazon_ml_20141212.create_realtime_endpoint

        (
            output,
            http_response,
        ) = await capo_machine_learning._operations.amazon_ml_20141212.create_realtime_endpoint.async_create_realtime_endpoint(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRealtimeEndpoint")
    )
    input_: capo_machine_learning.types.create_realtime_endpoint_input.CreateRealtimeEndpointInput = {
        "ml_model_id": ml_model_id
    }

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