Skip to content

batch_get_job async

batch_get_job(
    identifiers: BatchGetJobIdentifiers,
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
) -> BatchGetJobResponse

Retrieves multiple jobs in a single request. This is a batch version of the GetJob API.

The result of getting each job is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.

Parameters:

  • identifiers (BatchGetJobIdentifiers) –

    The list of job identifiers to retrieve. You can specify up to 100 identifiers per request.

Raises:

Examples:

Get multiple jobs in a single request

>>> await client.batch_get_job(identifiers=[{'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-1234567890abcdef1234567890abcdef'}, {'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-234567890abcdef1234567890abcdef1'}])
Source code in docs_src/capo_deadline/_services/async_deadline.py
async def batch_get_job(
    self,
    identifiers: "capo_deadline.types.batch_get_job_identifiers.BatchGetJobIdentifiers",
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
) -> "capo_deadline.types.batch_get_job_response.BatchGetJobResponse":
    """<p>Retrieves multiple jobs in a single request. This is a batch version of the <code>GetJob</code> API.</p> <p>The result of getting each job is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.</p>

    Args:
        identifiers: <p>The list of job identifiers to retrieve. You can specify up to 100 identifiers per request.</p>

    Raises:
        capo_deadline.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_deadline.errors.internal_server_error_exception.InternalServerErrorException: <p>Deadline Cloud can't process your request right now. Try again later.</p>
        capo_deadline.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota.</p>
        capo_deadline.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_deadline.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get multiple jobs in a single request

        >>> await client.batch_get_job(identifiers=[{'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-1234567890abcdef1234567890abcdef'}, {'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-234567890abcdef1234567890abcdef1'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_deadline.types.batch_get_job_request.BatchGetJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_deadline.types.batch_get_job_response.BatchGetJobResponse"
    ]:
        import capo_deadline._operations.deadline.batch_get_job

        (
            output,
            http_response,
        ) = await capo_deadline._operations.deadline.batch_get_job.async_batch_get_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_deadline.types.batch_get_job_response.BatchGetJobResponse",
    ) -> dict[str, Any]:
        import capo_deadline.types.batch_get_job_response

        return capo_deadline.types.batch_get_job_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("BatchGetJob", redact_output=_redact_output),
    )
    input_: capo_deadline.types.batch_get_job_request.BatchGetJobRequest = {
        "identifiers": identifiers
    }

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