setKeepJobFlowAliveWhenNoSteps method
You can use the SetKeepJobFlowAliveWhenNoSteps to configure a
cluster (job flow) to terminate after the step execution, i.e., all your
steps are executed. If you want a transient cluster that shuts down after
the last of the current executing steps are completed, you can configure
SetKeepJobFlowAliveWhenNoSteps to false. If you want a long
running cluster, configure SetKeepJobFlowAliveWhenNoSteps to
true.
For more information, see Managing Cluster Termination in the Amazon EMR Management Guide.
May throw InternalServerError.
Parameter jobFlowIds :
A list of strings that uniquely identify the clusters to protect. This
identifier is returned by RunJobFlow
and can also be obtained from DescribeJobFlows.
Parameter keepJobFlowAliveWhenNoSteps :
A Boolean that indicates whether to terminate the cluster after all steps
are executed.
Implementation
Future<void> setKeepJobFlowAliveWhenNoSteps({
required List<String> jobFlowIds,
required bool keepJobFlowAliveWhenNoSteps,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ElasticMapReduce.SetKeepJobFlowAliveWhenNoSteps'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'JobFlowIds': jobFlowIds,
'KeepJobFlowAliveWhenNoSteps': keepJobFlowAliveWhenNoSteps,
},
);
}