Delete a SageMaker HyperPod cluster.
Parameters:
-
cluster_name
(Optional[ClusterNameOrArn], default:
None
)
–
The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster to delete.
Raises:
-
ConflictException
–
There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.
-
ResourceNotFound
–
Resource being access is not found.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
| async def delete_cluster(
self,
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
cluster_name: Optional[
"capo_sagemaker.types.cluster_name_or_arn.ClusterNameOrArn"
] = None,
) -> "capo_sagemaker.types.delete_cluster_response.DeleteClusterResponse":
"""<p>Delete a SageMaker HyperPod cluster.</p>
Args:
cluster_name: <p>The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster to delete.</p>
Raises:
capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sagemaker.types.delete_cluster_request.DeleteClusterRequest]",
) -> AsyncOperationResponse[
"capo_sagemaker.types.delete_cluster_response.DeleteClusterResponse"
]:
import capo_sagemaker._operations.sage_maker.delete_cluster
(
output,
http_response,
) = await capo_sagemaker._operations.sage_maker.delete_cluster.async_delete_cluster(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteCluster")
)
input_: capo_sagemaker.types.delete_cluster_request.DeleteClusterRequest = {}
if cluster_name is not None:
input_["cluster_name"] = cluster_name
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|