Skip to content

update_job

update_job(
    job_id: JobId,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    description: Optional[JobDescription] = None,
    presigned_url_config: Optional[PresignedUrlConfig] = None,
    job_executions_rollout_config: Optional[JobExecutionsRolloutConfig] = None,
    abort_config: Optional[AbortConfig] = None,
    timeout_config: Optional[TimeoutConfig] = None,
    namespace_id: Optional[NamespaceId] = None,
    job_executions_retry_config: Optional[JobExecutionsRetryConfig] = None,
) -> None

Updates supported fields of the specified job.

Requires permission to access the UpdateJob action.

Parameters:

  • job_id (JobId) –

    The ID of the job to be updated.

  • description (Optional[JobDescription], default: None ) –

    A short text description of the job.

  • presigned_url_config (Optional[PresignedUrlConfig], default: None ) –

    Configuration information for pre-signed S3 URLs.

  • job_executions_rollout_config (Optional[JobExecutionsRolloutConfig], default: None ) –

    Allows you to create a staged rollout of the job.

  • abort_config (Optional[AbortConfig], default: None ) –

    Allows you to create criteria to abort a job.

  • timeout_config (Optional[TimeoutConfig], default: None ) –

    Specifies the amount of time each device has to finish its execution of the job. The timer is started when the job execution status is set to IN_PROGRESS. If the job execution status is not set to another terminal state before the time expires, it will be automatically set to TIMED_OUT.

  • namespace_id (Optional[NamespaceId], default: None ) –

    The namespace used to indicate that a job is a customer-managed job.

    When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.

    $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/

    The namespaceId feature is only supported by IoT Greengrass at this time. For more information, see Setting up IoT Greengrass core devices.

  • job_executions_retry_config (Optional[JobExecutionsRetryConfig], default: None ) –

    Allows you to create the criteria to retry a job.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def update_job(
    self,
    job_id: "capo_iot.types.job_id.JobId",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    description: Optional["capo_iot.types.job_description.JobDescription"] = None,
    presigned_url_config: Optional[
        "capo_iot.types.presigned_url_config.PresignedUrlConfig"
    ] = None,
    job_executions_rollout_config: Optional[
        "capo_iot.types.job_executions_rollout_config.JobExecutionsRolloutConfig"
    ] = None,
    abort_config: Optional["capo_iot.types.abort_config.AbortConfig"] = None,
    timeout_config: Optional["capo_iot.types.timeout_config.TimeoutConfig"] = None,
    namespace_id: Optional["capo_iot.types.namespace_id.NamespaceId"] = None,
    job_executions_retry_config: Optional[
        "capo_iot.types.job_executions_retry_config.JobExecutionsRetryConfig"
    ] = None,
) -> None:
    """<p>Updates supported fields of the specified job.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdateJob</a> action.</p>

    Args:
        job_id: <p>The ID of the job to be updated.</p>
        description: <p>A short text description of the job.</p>
        presigned_url_config: <p>Configuration information for pre-signed S3 URLs.</p>
        job_executions_rollout_config: <p>Allows you to create a staged rollout of the job.</p>
        abort_config: <p>Allows you to create criteria to abort a job.</p>
        timeout_config: <p>Specifies the amount of time each device has to finish its execution of the job. The timer is started when the job execution status is set to <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the time expires, it will be automatically set to <code>TIMED_OUT</code>. </p>
        namespace_id: <p>The namespace used to indicate that a job is a customer-managed job.</p> <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p> <p> <code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code> </p> <note> <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a> </p> </note>
        job_executions_retry_config: <p>Allows you to create the criteria to retry a job.</p>

    Raises:
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.update_job_request.UpdateJobRequest]",
    ) -> OperationResponse[None]:
        import capo_iot._operations.aws_iot_service.update_job

        output, http_response = (
            capo_iot._operations.aws_iot_service.update_job.update_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateJob")
    )
    input_: capo_iot.types.update_job_request.UpdateJobRequest = {"job_id": job_id}
    if description is not None:
        input_["description"] = description
    if presigned_url_config is not None:
        input_["presigned_url_config"] = presigned_url_config
    if job_executions_rollout_config is not None:
        input_["job_executions_rollout_config"] = job_executions_rollout_config
    if abort_config is not None:
        input_["abort_config"] = abort_config
    if timeout_config is not None:
        input_["timeout_config"] = timeout_config
    if namespace_id is not None:
        input_["namespace_id"] = namespace_id
    if job_executions_retry_config is not None:
        input_["job_executions_retry_config"] = job_executions_retry_config

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output