update_job_execution
async
¶
update_job_execution(
job_id: JobId,
thing_name: ThingName,
status: JobExecutionStatus,
*,
config_overrides: Optional[AsyncIoTJobsDataPlaneClientConfig] = None,
status_details: Optional[DetailsMap] = None,
step_timeout_in_minutes: Optional[StepTimeoutInMinutes] = None,
expected_version: Optional[ExpectedVersion] = None,
include_job_execution_state: Optional[IncludeExecutionState] = None,
include_job_document: Optional[IncludeJobDocument] = None,
execution_number: Optional[ExecutionNumber] = None,
) -> UpdateJobExecutionResponse
Updates the status of a job execution.
Requires permission to access the UpdateJobExecution action.
Parameters:
-
job_id(JobId) –The unique identifier assigned to this job when it was created.
-
thing_name(ThingName) –The name of the thing associated with the device.
-
status(JobExecutionStatus) –The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update.
-
status_details(Optional[DetailsMap], default:None) –Optional. A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.
The maximum length of the value in the name/value pair is 1,024 characters.
-
step_timeout_in_minutes(Optional[StepTimeoutInMinutes], default:None) –Specifies the amount of time this device has to finish execution of this job. If the job execution status is not set to a terminal state before this timer expires, or before the timer is reset (by again calling
UpdateJobExecution, setting the status toIN_PROGRESS, and specifying a new timeout value in this field) the job execution status will be automatically set toTIMED_OUT. Note that setting or resetting the step timeout has no effect on the in progress timeout that may have been specified when the job was created (CreateJobusing fieldtimeoutConfig).Valid values for this parameter range from 1 to 10080 (1 minute to 7 days). A value of -1 is also valid and will cancel the current step timer (created by an earlier use of
UpdateJobExecutionRequest). -
expected_version(Optional[ExpectedVersion], default:None) –Optional. The expected current version of the job execution. Each time you update the job execution, its version is incremented. If the version of the job execution stored in Jobs does not match, the update is rejected with a VersionMismatch error, and an ErrorResponse that contains the current job execution status data is returned. (This makes it unnecessary to perform a separate DescribeJobExecution request in order to obtain the job execution status data.)
-
include_job_execution_state(Optional[IncludeExecutionState], default:None) –Optional. When included and set to true, the response contains the JobExecutionState data. The default is false.
-
include_job_document(Optional[IncludeJobDocument], default:None) –Optional. When set to true, the response contains the job document. The default is false.
-
execution_number(Optional[ExecutionNumber], default:None) –Optional. A number that identifies a particular job execution on a particular device.
Raises:
-
CertificateValidationException–The certificate is invalid.
-
InvalidRequestException–The contents of the request were invalid.
-
InvalidStateTransitionException–An update attempted to change the job execution to a state that is invalid because of the job execution's current state (for example, an attempt to change a request in state SUCCESS to state IN_PROGRESS). In this case, the body of the error message also contains the executionState field.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceUnavailableException–The service is temporarily unavailable.
-
ThrottlingException–The rate exceeds the limit.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iot_jobs_data_plane/_services/async_io_t_jobs_data_plane.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |