Skip to content

delete_notebook_instance async

delete_notebook_instance(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    notebook_instance_name: Optional[NotebookInstanceName] = None,
) -> None

Deletes an SageMaker AI notebook instance. Before you can delete a notebook instance, you must call the StopNotebookInstance API.

When you delete a notebook instance, you lose all of your data. SageMaker AI removes the ML compute instance, and deletes the ML storage volume and the network interface associated with the notebook instance.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def delete_notebook_instance(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    notebook_instance_name: Optional[
        "capo_sagemaker.types.notebook_instance_name.NotebookInstanceName"
    ] = None,
) -> None:
    """<p> Deletes an SageMaker AI notebook instance. Before you can delete a notebook instance, you must call the <code>StopNotebookInstance</code> API. </p> <important> <p>When you delete a notebook instance, you lose all of your data. SageMaker AI removes the ML compute instance, and deletes the ML storage volume and the network interface associated with the notebook instance. </p> </important>

    Args:
        notebook_instance_name: <p>The name of the SageMaker AI notebook instance 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_notebook_instance_input.DeleteNotebookInstanceInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.delete_notebook_instance

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteNotebookInstance")
    )
    input_: capo_sagemaker.types.delete_notebook_instance_input.DeleteNotebookInstanceInput = {}
    if notebook_instance_name is not None:
        input_["notebook_instance_name"] = notebook_instance_name

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