batchDeleteClusterNodes method

Future<BatchDeleteClusterNodesResponse> batchDeleteClusterNodes({
  1. required String clusterName,
  2. List<String>? nodeIds,
  3. List<String>? nodeLogicalIds,
})

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

May throw ResourceNotFound.

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

Parameter nodeIds : 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.

Parameter nodeLogicalIds : 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.

Implementation

Future<BatchDeleteClusterNodesResponse> batchDeleteClusterNodes({
  required String clusterName,
  List<String>? nodeIds,
  List<String>? nodeLogicalIds,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.BatchDeleteClusterNodes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterName': clusterName,
      if (nodeIds != null) 'NodeIds': nodeIds,
      if (nodeLogicalIds != null) 'NodeLogicalIds': nodeLogicalIds,
    },
  );

  return BatchDeleteClusterNodesResponse.fromJson(jsonResponse.body);
}