terminateJobFlows method
TerminateJobFlows shuts a list of clusters (job flows) down. When a job flow is shut down, any step not yet completed is canceled and the EC2 instances on which the cluster is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified when the cluster was created.
The maximum number of clusters allowed is 10. The call to
TerminateJobFlows
is asynchronous. Depending on the
configuration of the cluster, it may take up to 1-5 minutes for the
cluster to completely terminate and release allocated resources, such as
Amazon EC2 instances.
May throw InternalServerError.
Parameter jobFlowIds
:
A list of job flows to be shut down.
Implementation
Future<void> terminateJobFlows({
required List<String> jobFlowIds,
}) async {
ArgumentError.checkNotNull(jobFlowIds, 'jobFlowIds');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ElasticMapReduce.TerminateJobFlows'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'JobFlowIds': jobFlowIds,
},
);
}