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 Amazon 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.
Parameters:
Raises:
-
InternalServerError
–
Indicates that an error occurred while processing the request and that the request was not completed.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_emr/_services/emr.py
| def terminate_job_flows(
self,
*,
config_overrides: Optional[EMRClientConfig] = None,
job_flow_ids: Optional["capo_emr.types.xml_string_list.XmlStringList"] = None,
) -> None:
"""<p>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 Amazon 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.</p> <p>The maximum number of clusters allowed is 10. The call to <code>TerminateJobFlows</code> 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.</p>
Args:
job_flow_ids: <p>A list of job flows to be shut down.</p>
Raises:
capo_emr.errors.internal_server_error.InternalServerError: <p>Indicates that an error occurred while processing the request and that the request was not completed.</p>
capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_emr.types.terminate_job_flows_input.TerminateJobFlowsInput]",
) -> OperationResponse[None]:
import capo_emr._operations.elastic_map_reduce.terminate_job_flows
output, http_response = (
capo_emr._operations.elastic_map_reduce.terminate_job_flows.terminate_job_flows(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TerminateJobFlows")
)
input_: capo_emr.types.terminate_job_flows_input.TerminateJobFlowsInput = {}
if job_flow_ids is not None:
input_["job_flow_ids"] = job_flow_ids
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|