Skip to content

batch_update_task async

batch_update_task(
    tasks: BatchUpdateTaskItems,
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> BatchUpdateTaskResponse

Updates multiple tasks in a single request. This is a batch version of the UpdateTask API.

The result of updating each task 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:

  • client_token (Optional[ClientToken], default: None ) –

    The unique token which the server uses to recognize retries of the same request.

  • tasks (BatchUpdateTaskItems) –

    The list of tasks to update. You can specify up to 100 tasks per request.

Raises:

Examples:

Update multiple tasks in a single request

>>> await client.batch_update_task(tasks=[{'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-1234567890abcdef1234567890abcdef', 'stepId': 'step-1234567890abcdef1234567890abcdef', 'taskId': 'task-1234567890abcdef1234567890abcdef-0', 'targetRunStatus': 'FAILED'}, {'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-1234567890abcdef1234567890abcdef', 'stepId': 'step-1234567890abcdef1234567890abcdef', 'taskId': 'task-1234567890abcdef1234567890abcdef-1', 'targetRunStatus': 'FAILED'}])
Source code in docs_src/capo_deadline/_services/async_deadline.py
async def batch_update_task(
    self,
    tasks: "capo_deadline.types.batch_update_task_items.BatchUpdateTaskItems",
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    client_token: Optional["capo_deadline.types.client_token.ClientToken"] = None,
) -> "capo_deadline.types.batch_update_task_response.BatchUpdateTaskResponse":
    """<p>Updates multiple tasks in a single request. This is a batch version of the <code>UpdateTask</code> API.</p> <p>The result of updating each task 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:
        client_token: <p>The unique token which the server uses to recognize retries of the same request.</p>
        tasks: <p>The list of tasks to update. You can specify up to 100 tasks 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:
        Update multiple tasks in a single request

        >>> await client.batch_update_task(tasks=[{'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-1234567890abcdef1234567890abcdef', 'stepId': 'step-1234567890abcdef1234567890abcdef', 'taskId': 'task-1234567890abcdef1234567890abcdef-0', 'targetRunStatus': 'FAILED'}, {'farmId': 'farm-1234567890abcdef1234567890abcdef', 'queueId': 'queue-1234567890abcdef1234567890abcdef', 'jobId': 'job-1234567890abcdef1234567890abcdef', 'stepId': 'step-1234567890abcdef1234567890abcdef', 'taskId': 'task-1234567890abcdef1234567890abcdef-1', 'targetRunStatus': 'FAILED'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_deadline.types.batch_update_task_request.BatchUpdateTaskRequest]",
    ) -> AsyncOperationResponse[
        "capo_deadline.types.batch_update_task_response.BatchUpdateTaskResponse"
    ]:
        import capo_deadline._operations.deadline.batch_update_task

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchUpdateTask")
    )
    input_: capo_deadline.types.batch_update_task_request.BatchUpdateTaskRequest = {
        "tasks": tasks
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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