Skip to content

list_job_runs async

list_job_runs(
    application_id: ApplicationId,
    *,
    config_overrides: Optional[AsyncEMRServerlessClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
    created_at_after: Optional[Date] = None,
    created_at_before: Optional[Date] = None,
    states: Optional[JobRunStateSet] = None,
    mode: Optional[JobRunMode] = None,
) -> ListJobRunsResponse

Lists job runs based on a set of parameters.

Parameters:

  • application_id (ApplicationId) –

    The ID of the application for which to list the job run.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next set of job run results.

  • max_results (Optional[int], default: None ) –

    The maximum number of job runs that can be listed.

  • created_at_after (Optional[Date], default: None ) –

    The lower bound of the option to filter by creation date and time.

  • created_at_before (Optional[Date], default: None ) –

    The upper bound of the option to filter by creation date and time.

  • states (Optional[JobRunStateSet], default: None ) –

    An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will be grouped by the state.

  • mode (Optional[JobRunMode], default: None ) –

    The mode of the job runs to list.

Raises:

Source code in docs_src/capo_emr_serverless/_services/async_emr_serverless.py
async def list_job_runs(
    self,
    application_id: "capo_emr_serverless.types.application_id.ApplicationId",
    *,
    config_overrides: Optional[AsyncEMRServerlessClientConfig] = None,
    next_token: Optional["capo_emr_serverless.types.next_token.NextToken"] = None,
    max_results: Optional[int] = None,
    created_at_after: Optional["capo_emr_serverless.types.date.Date"] = None,
    created_at_before: Optional["capo_emr_serverless.types.date.Date"] = None,
    states: Optional[
        "capo_emr_serverless.types.job_run_state_set.JobRunStateSet"
    ] = None,
    mode: Optional["capo_emr_serverless.types.job_run_mode.JobRunMode"] = None,
) -> "capo_emr_serverless.types.list_job_runs_response.ListJobRunsResponse":
    """<p>Lists job runs based on a set of parameters.</p>

    Args:
        application_id: <p>The ID of the application for which to list the job run.</p>
        next_token: <p>The token for the next set of job run results.</p>
        max_results: <p>The maximum number of job runs that can be listed.</p>
        created_at_after: <p>The lower bound of the option to filter by creation date and time.</p>
        created_at_before: <p>The upper bound of the option to filter by creation date and time.</p>
        states: <p>An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will be grouped by the state.</p>
        mode: <p>The mode of the job runs to list.</p>

    Raises:
        capo_emr_serverless.errors.internal_server_exception.InternalServerException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_emr_serverless.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_emr_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_emr_serverless.types.list_job_runs_request.ListJobRunsRequest]",
    ) -> AsyncOperationResponse[
        "capo_emr_serverless.types.list_job_runs_response.ListJobRunsResponse"
    ]:
        import capo_emr_serverless._operations.aws_toledo_web_service.list_job_runs

        (
            output,
            http_response,
        ) = await capo_emr_serverless._operations.aws_toledo_web_service.list_job_runs.async_list_job_runs(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListJobRuns")
    )
    input_: capo_emr_serverless.types.list_job_runs_request.ListJobRunsRequest = {
        "application_id": application_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if created_at_after is not None:
        input_["created_at_after"] = created_at_after
    if created_at_before is not None:
        input_["created_at_before"] = created_at_before
    if states is not None:
        input_["states"] = states
    if mode is not None:
        input_["mode"] = mode

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output