Skip to content

delete_model async

delete_model(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    model_name: Optional[ModelName] = None,
) -> None

Deletes a model. The DeleteModel API deletes only the model entry that was created in SageMaker when you called the CreateModel API. It does not delete model artifacts, inference code, or the IAM role that you specified when creating the model.

Parameters:

  • model_name (Optional[ModelName], default: None ) –

    The name of the model to delete.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def delete_model(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    model_name: Optional["capo_sagemaker.types.model_name.ModelName"] = None,
) -> None:
    """<p>Deletes a model. The <code>DeleteModel</code> API deletes only the model entry that was created in SageMaker when you called the <code>CreateModel</code> API. It does not delete model artifacts, inference code, or the IAM role that you specified when creating the model. </p>

    Args:
        model_name: <p>The name of the model to delete.</p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.delete_model_input.DeleteModelInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.delete_model

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteModel")
    )
    input_: capo_sagemaker.types.delete_model_input.DeleteModelInput = {}
    if model_name is not None:
        input_["model_name"] = model_name

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