Skip to content

get_ml_model async

get_ml_model(
    ml_model_id: EntityId,
    *,
    config_overrides: Optional[AsyncMachineLearningClientConfig] = None,
    verbose: Optional[Verbose] = None,
) -> GetMLModelOutput

Returns an MLModel that includes detailed metadata, data source information, and the current status of the MLModel.

GetMLModel provides results in normal or verbose format.

Parameters:

  • ml_model_id (EntityId) –

    The ID assigned to the MLModel at creation.

  • verbose (Optional[Verbose], default: None ) –

    Specifies whether the GetMLModel operation should return Recipe.

    If true, Recipe is returned.

    If false, Recipe is not returned.

Raises:

Source code in docs_src/capo_machine_learning/_services/async_machine_learning.py
async def get_ml_model(
    self,
    ml_model_id: "capo_machine_learning.types.entity_id.EntityId",
    *,
    config_overrides: Optional[AsyncMachineLearningClientConfig] = None,
    verbose: Optional["capo_machine_learning.types.verbose.Verbose"] = None,
) -> "capo_machine_learning.types.get_ml_model_output.GetMLModelOutput":
    """<p>Returns an <code>MLModel</code> that includes detailed metadata, data source information, and the current status of the <code>MLModel</code>.</p> <p> <code>GetMLModel</code> provides results in normal or verbose format. </p>

    Args:
        ml_model_id: <p>The ID assigned to the <code>MLModel</code> at creation.</p>
        verbose: <p>Specifies whether the <code>GetMLModel</code> operation should return <code>Recipe</code>.</p> <p>If true, <code>Recipe</code> is returned.</p> <p>If false, <code>Recipe</code> is not returned.</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.get_ml_model_input.GetMLModelInput]",
    ) -> AsyncOperationResponse[
        "capo_machine_learning.types.get_ml_model_output.GetMLModelOutput"
    ]:
        import capo_machine_learning._operations.amazon_ml_20141212.get_ml_model

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetMLModel")
    )
    input_: capo_machine_learning.types.get_ml_model_input.GetMLModelInput = {
        "ml_model_id": ml_model_id
    }
    if verbose is not None:
        input_["verbose"] = verbose

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