Terminates the ML compute instance. Before terminating the instance, SageMaker AI disconnects the ML storage volume from it. SageMaker AI preserves the ML storage volume. SageMaker AI stops charging you for the ML compute instance when you call StopNotebookInstance.
To access data on the ML storage volume for a notebook instance that has been terminated, call the StartNotebookInstance API. StartNotebookInstance launches another ML compute instance, configures it, and attaches the preserved ML storage volume so you can continue your work.
Parameters:
Raises:
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
| async def stop_notebook_instance(
self,
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
notebook_instance_name: Optional[
"capo_sagemaker.types.notebook_instance_name.NotebookInstanceName"
] = None,
) -> None:
"""<p>Terminates the ML compute instance. Before terminating the instance, SageMaker AI disconnects the ML storage volume from it. SageMaker AI preserves the ML storage volume. SageMaker AI stops charging you for the ML compute instance when you call <code>StopNotebookInstance</code>.</p> <p>To access data on the ML storage volume for a notebook instance that has been terminated, call the <code>StartNotebookInstance</code> API. <code>StartNotebookInstance</code> launches another ML compute instance, configures it, and attaches the preserved ML storage volume so you can continue your work. </p>
Args:
notebook_instance_name: <p>The name of the notebook instance to terminate.</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.stop_notebook_instance_input.StopNotebookInstanceInput]",
) -> AsyncOperationResponse[None]:
import capo_sagemaker._operations.sage_maker.stop_notebook_instance
(
output,
http_response,
) = await capo_sagemaker._operations.sage_maker.stop_notebook_instance.async_stop_notebook_instance(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopNotebookInstance")
)
input_: capo_sagemaker.types.stop_notebook_instance_input.StopNotebookInstanceInput = {}
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
|