Skip to content

update_job_status async

update_job_status(
    account_id: AccountId,
    job_id: JobId,
    requested_job_status: RequestedJobStatus,
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
    status_update_reason: Optional[JobStatusUpdateReason] = None,
) -> UpdateJobStatusResult

Updates the status for the specified job. Use this operation to confirm that you want to run a job or to cancel an existing job. For more information, see S3 Batch Operations in the Amazon S3 User Guide.

Permissions

To use the UpdateJobStatus operation, you must have permission to perform the s3:UpdateJobStatus action.

Related actions include:

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID associated with the S3 Batch Operations job.

  • job_id (JobId) –

    The ID of the job whose status you want to update.

  • requested_job_status (RequestedJobStatus) –

    The status that you want to move the specified job to.

  • status_update_reason (Optional[JobStatusUpdateReason], default: None ) –

    A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length.

Raises:

Source code in docs_src/capo_s3_control/_services/async_s3_control.py
async def update_job_status(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    job_id: "capo_s3_control.types.job_id.JobId",
    requested_job_status: "capo_s3_control.types.requested_job_status.RequestedJobStatus",
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
    status_update_reason: Optional[
        "capo_s3_control.types.job_status_update_reason.JobStatusUpdateReason"
    ] = None,
) -> "capo_s3_control.types.update_job_status_result.UpdateJobStatusResult":
    """<p>Updates the status for the specified job. Use this operation to confirm that you want to run a job or to cancel an existing job. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html">S3 Batch Operations</a> in the <i>Amazon S3 User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <p>To use the <code>UpdateJobStatus</code> operation, you must have permission to perform the <code>s3:UpdateJobStatus</code> action.</p> </dd> </dl> <p>Related actions include:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> </p> </li> </ul>

    Args:
        account_id: <p>The Amazon Web Services account ID associated with the S3 Batch Operations job.</p>
        job_id: <p>The ID of the job whose status you want to update.</p>
        requested_job_status: <p>The status that you want to move the specified job to.</p>
        status_update_reason: <p>A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length.</p>

    Raises:
        capo_s3_control.errors.bad_request_exception.BadRequestException: <p></p>
        capo_s3_control.errors.internal_service_exception.InternalServiceException: <p></p>
        capo_s3_control.errors.job_status_exception.JobStatusException: <p></p>
        capo_s3_control.errors.not_found_exception.NotFoundException: <p></p>
        capo_s3_control.errors.too_many_requests_exception.TooManyRequestsException: <p></p>
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3_control.types.update_job_status_request.UpdateJobStatusRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3_control.types.update_job_status_result.UpdateJobStatusResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.update_job_status

        (
            output,
            http_response,
        ) = await capo_s3_control._operations.awss3_control_service_v20180820.update_job_status.async_update_job_status(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateJobStatus")
    )
    input_: capo_s3_control.types.update_job_status_request.UpdateJobStatusRequest = {
        "account_id": account_id,
        "job_id": job_id,
        "requested_job_status": requested_job_status,
    }
    if status_update_reason is not None:
        input_["status_update_reason"] = status_update_reason

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