Skip to content

batch_delete_cluster_nodes async

batch_delete_cluster_nodes(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    cluster_name: Optional[ClusterNameOrArn] = None,
    node_ids: Optional[ClusterNodeIds] = None,
    node_logical_ids: Optional[ClusterNodeLogicalIdList] = None,
) -> BatchDeleteClusterNodesResponse

Deletes specific nodes within a SageMaker HyperPod cluster. BatchDeleteClusterNodes accepts a cluster name and a list of node IDs.

Parameters:

  • cluster_name (Optional[ClusterNameOrArn], default: None ) –

    The name of the SageMaker HyperPod cluster from which to delete the specified nodes.

  • node_ids (Optional[ClusterNodeIds], default: None ) –

    A list of node IDs to be deleted from the specified cluster.

    • For SageMaker HyperPod clusters using the Slurm workload manager, you cannot remove instances that are configured as Slurm controller nodes.

    • If you need to delete more than 99 instances, contact Support for assistance.

  • node_logical_ids (Optional[ClusterNodeLogicalIdList], default: None ) –

    A list of NodeLogicalIds identifying the nodes to be deleted. You can specify up to 50 NodeLogicalIds. You must specify either NodeLogicalIds, InstanceIds, or both, with a combined maximum of 50 identifiers.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def batch_delete_cluster_nodes(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    cluster_name: Optional[
        "capo_sagemaker.types.cluster_name_or_arn.ClusterNameOrArn"
    ] = None,
    node_ids: Optional[
        "capo_sagemaker.types.cluster_node_ids.ClusterNodeIds"
    ] = None,
    node_logical_ids: Optional[
        "capo_sagemaker.types.cluster_node_logical_id_list.ClusterNodeLogicalIdList"
    ] = None,
) -> "capo_sagemaker.types.batch_delete_cluster_nodes_response.BatchDeleteClusterNodesResponse":
    """<p>Deletes specific nodes within a SageMaker HyperPod cluster. <code>BatchDeleteClusterNodes</code> accepts a cluster name and a list of node IDs.</p> <important> <ul> <li> <p>To safeguard your work, back up your data to Amazon S3 or an FSx for Lustre file system before invoking the API on a worker node group. This will help prevent any potential data loss from the instance root volume. For more information about backup, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate-cli-command.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software-backup">Use the backup script provided by SageMaker HyperPod</a>. </p> </li> <li> <p>If you want to invoke this API on an existing cluster, you'll first need to patch the cluster by running the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateClusterSoftware.html">UpdateClusterSoftware API</a>. For more information about patching a cluster, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate-cli-command.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software">Update the SageMaker HyperPod platform software of a cluster</a>.</p> </li> </ul> </important>

    Args:
        cluster_name: <p>The name of the SageMaker HyperPod cluster from which to delete the specified nodes.</p>
        node_ids: <p>A list of node IDs to be deleted from the specified cluster.</p> <note> <ul> <li> <p>For SageMaker HyperPod clusters using the Slurm workload manager, you cannot remove instances that are configured as Slurm controller nodes.</p> </li> <li> <p>If you need to delete more than 99 instances, contact <a href="http://aws.amazon.com/contact-us/">Support</a> for assistance.</p> </li> </ul> </note>
        node_logical_ids: <p>A list of <code>NodeLogicalIds</code> identifying the nodes to be deleted. You can specify up to 50 <code>NodeLogicalIds</code>. You must specify either <code>NodeLogicalIds</code>, <code>InstanceIds</code>, or both, with a combined maximum of 50 identifiers.</p>

    Raises:
        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.batch_delete_cluster_nodes_request.BatchDeleteClusterNodesRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.batch_delete_cluster_nodes_response.BatchDeleteClusterNodesResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.batch_delete_cluster_nodes

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchDeleteClusterNodes")
    )
    input_: capo_sagemaker.types.batch_delete_cluster_nodes_request.BatchDeleteClusterNodesRequest = {}
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if node_ids is not None:
        input_["node_ids"] = node_ids
    if node_logical_ids is not None:
        input_["node_logical_ids"] = node_logical_ids

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