Skip to content

cancel_job_run async

cancel_job_run(
    id: ResourceIdString,
    virtual_cluster_id: ResourceIdString,
    *,
    config_overrides: Optional[AsyncEMRcontainersClientConfig] = 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/async_em_rcontainers.py
async 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[AsyncEMRcontainersClientConfig] = 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.
    """

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

        (
            output,
            http_response,
        ) = await capo_emr_containers._operations.aws_chicago_web_service.cancel_job_run.async_cancel_job_run(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output