Skip to content

cancel_job_run

cancel_job_run(
    id: ResourceIdString,
    virtual_cluster_id: ResourceIdString,
    *,
    config_overrides: Optional[EMRcontainersClientConfig] = None,
) -> CancelJobRunResponse

Cancels a job run. A job run is a unit of work, such as a Spark jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR on EKS.

Parameters:

  • id (ResourceIdString) –

    The ID of the job run to cancel.

  • virtual_cluster_id (ResourceIdString) –

    The ID of the virtual cluster for which the job run will be canceled.

Raises:

Source code in docs_src/capo_emr_containers/_services/em_rcontainers.py
def cancel_job_run(
    self,
    id: "capo_emr_containers.types.resource_id_string.ResourceIdString",
    virtual_cluster_id: "capo_emr_containers.types.resource_id_string.ResourceIdString",
    *,
    config_overrides: Optional[EMRcontainersClientConfig] = None,
) -> "capo_emr_containers.types.cancel_job_run_response.CancelJobRunResponse":
    """<p>Cancels a job run. A job run is a unit of work, such as a Spark jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR on EKS.</p>

    Args:
        id: <p>The ID of the job run to cancel.</p>
        virtual_cluster_id: <p>The ID of the virtual cluster for which the job run will be canceled.</p>

    Raises:
        capo_emr_containers.errors.internal_server_exception.InternalServerException: <p>This is an internal server exception.</p>
        capo_emr_containers.errors.validation_exception.ValidationException: <p>There are invalid parameters in the client request.</p>
        capo_emr_containers.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_emr_containers.types.cancel_job_run_request.CancelJobRunRequest]",
    ) -> OperationResponse[
        "capo_emr_containers.types.cancel_job_run_response.CancelJobRunResponse"
    ]:
        import capo_emr_containers._operations.aws_chicago_web_service.cancel_job_run

        output, http_response = (
            capo_emr_containers._operations.aws_chicago_web_service.cancel_job_run.cancel_job_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelJobRun")
    )
    input_: capo_emr_containers.types.cancel_job_run_request.CancelJobRunRequest = {
        "id": id,
        "virtual_cluster_id": virtual_cluster_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output