IoTJobsDataPlane **************** Client ====== class IoTJobsDataPlane.Client A low-level client representing AWS IoT Jobs Data Plane IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to and executed on one or more devices connected to Amazon Web Services IoT Core. For example, you can define a job that instructs a set of devices to download and install application or firmware updates, reboot, rotate certificates, or perform remote troubleshooting operations. Find the endpoint address for actions in the IoT jobs data plane by running this CLI command: "aws iot describe-endpoint --endpoint-type iot:Jobs" The service name used by Amazon Web Services Signature Version 4 to sign requests is: *iot-jobs-data*. To create a job, you make a job document which is a description of the remote operations to be performed, and you specify a list of targets that should perform the operations. The targets can be individual things, thing groups or both. IoT Jobs sends a message to inform the targets that a job is available. The target starts the execution of the job by downloading the job document, performing the operations it specifies, and reporting its progress to Amazon Web Services IoT Core. The Jobs service provides commands to track the progress of a job on a specific target and for all the targets of the job import boto3 client = boto3.client('iot-jobs-data') These are the available methods: * can_paginate * close * describe_job_execution * get_paginator * get_pending_job_executions * get_waiter * start_command_execution * start_next_pending_job_execution * update_job_execution IoTJobsDataPlane / Client / get_paginator get_paginator ************* IoTJobsDataPlane.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. IoTJobsDataPlane / Client / can_paginate can_paginate ************ IoTJobsDataPlane.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. IoTJobsDataPlane / Client / describe_job_execution describe_job_execution ********************** IoTJobsDataPlane.Client.describe_job_execution(**kwargs) Gets details of a job execution. Requires permission to access the DescribeJobExecution action. See also: AWS API Documentation **Request Syntax** response = client.describe_job_execution( jobId='string', thingName='string', includeJobDocument=True|False, executionNumber=123 ) Parameters: * **jobId** (*string*) -- **[REQUIRED]** The unique identifier assigned to this job when it was created. * **thingName** (*string*) -- **[REQUIRED]** The thing name associated with the device the job execution is running on. * **includeJobDocument** (*boolean*) -- Optional. Unless set to false, the response contains the job document. The default is true. * **executionNumber** (*integer*) -- Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned. Return type: dict Returns: **Response Syntax** { 'execution': { 'jobId': 'string', 'thingName': 'string', 'status': 'QUEUED'|'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'REJECTED'|'REMOVED'|'CANCELED', 'statusDetails': { 'string': 'string' }, 'queuedAt': 123, 'startedAt': 123, 'lastUpdatedAt': 123, 'approximateSecondsBeforeTimedOut': 123, 'versionNumber': 123, 'executionNumber': 123, 'jobDocument': 'string' } } **Response Structure** * *(dict) --* * **execution** *(dict) --* Contains data about a job execution. * **jobId** *(string) --* The unique identifier you assigned to this job when it was created. * **thingName** *(string) --* The name of the thing that is executing the job. * **status** *(string) --* The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "TIMED_OUT", "REJECTED", or "REMOVED". * **statusDetails** *(dict) --* A collection of name/value pairs that describe the status of the job execution. The maximum length of the value in the name/value pair is 1,024 characters. * *(string) --* * *(string) --* * **queuedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was enqueued. * **startedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was started. * **lastUpdatedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was last updated. * **approximateSecondsBeforeTimedOut** *(integer) --* The estimated number of seconds that remain before the job execution status will be changed to "TIMED_OUT". The actual job execution timeout can occur up to 60 seconds later than the estimated duration. * **versionNumber** *(integer) --* The version of the job execution. Job execution versions are incremented each time they are updated by a device. * **executionNumber** *(integer) --* A number that identifies a particular job execution on a particular device. It can be used later in commands that return or update job execution information. * **jobDocument** *(string) --* The content of the job document. **Exceptions** * "IoTJobsDataPlane.Client.exceptions.InvalidRequestException" * "IoTJobsDataPlane.Client.exceptions.ResourceNotFoundException" * "IoTJobsDataPlane.Client.exceptions.ThrottlingException" * "IoTJobsDataPlane.Client.exceptions.ServiceUnavailableException" * "IoTJobsDataPlane.Client.exceptions.CertificateValidationExcepti on" * "IoTJobsDataPlane.Client.exceptions.TerminalStateException" IoTJobsDataPlane / Client / start_command_execution start_command_execution *********************** IoTJobsDataPlane.Client.start_command_execution(**kwargs) Using the command created with the "CreateCommand" API, start a command execution on a specific device. See also: AWS API Documentation **Request Syntax** response = client.start_command_execution( targetArn='string', commandArn='string', parameters={ 'string': { 'S': 'string', 'B': True|False, 'I': 123, 'L': 123, 'D': 123.0, 'BIN': b'bytes', 'UL': 'string' } }, executionTimeoutSeconds=123, clientToken='string' ) Parameters: * **targetArn** (*string*) -- **[REQUIRED]** The Amazon Resource Number (ARN) of the device where the command execution is occurring. * **commandArn** (*string*) -- **[REQUIRED]** The Amazon Resource Number (ARN) of the command. For example, "arn:aws:iot:::command/" * **parameters** (*dict*) -- A list of parameters that are required by the "StartCommandExecution" API when performing the command on a device. * *(string) --* * *(dict) --* The list of values used to describe a specific command parameter. * **S** *(string) --* An attribute of type String. For example: ""S": "Hello"" * **B** *(boolean) --* An attribute of type Boolean. For example: ""BOOL": true" * **I** *(integer) --* An attribute of type Integer (Thirty-Two Bits). * **L** *(integer) --* An attribute of type Long. * **D** *(float) --* An attribute of type Double (Sixty-Four Bits). * **BIN** *(bytes) --* An attribute of type Binary. * **UL** *(string) --* An attribute of type Unsigned Long. * **executionTimeoutSeconds** (*integer*) -- Specifies the amount of time in second the device has to finish the command execution. A timer is started as soon as the command execution is created. If the command execution status is not set to another terminal state before the timer expires, it will automatically update to "TIMED_OUT". * **clientToken** (*string*) -- The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you retry the request using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request. This field is autopopulated if not provided. Return type: dict Returns: **Response Syntax** { 'executionId': 'string' } **Response Structure** * *(dict) --* * **executionId** *(string) --* A unique identifier for the command execution. **Exceptions** * "IoTJobsDataPlane.Client.exceptions.ValidationException" * "IoTJobsDataPlane.Client.exceptions.ResourceNotFoundException" * "IoTJobsDataPlane.Client.exceptions.ConflictException" * "IoTJobsDataPlane.Client.exceptions.ThrottlingException" * "IoTJobsDataPlane.Client.exceptions.ServiceQuotaExceededExceptio n" * "IoTJobsDataPlane.Client.exceptions.InternalServerException" IoTJobsDataPlane / Client / get_waiter get_waiter ********** IoTJobsDataPlane.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" IoTJobsDataPlane / Client / close close ***** IoTJobsDataPlane.Client.close() Closes underlying endpoint connections. IoTJobsDataPlane / Client / get_pending_job_executions get_pending_job_executions ************************** IoTJobsDataPlane.Client.get_pending_job_executions(**kwargs) Gets the list of all jobs for a thing that are not in a terminal status. Requires permission to access the GetPendingJobExecutions action. See also: AWS API Documentation **Request Syntax** response = client.get_pending_job_executions( thingName='string' ) Parameters: **thingName** (*string*) -- **[REQUIRED]** The name of the thing that is executing the job. Return type: dict Returns: **Response Syntax** { 'inProgressJobs': [ { 'jobId': 'string', 'queuedAt': 123, 'startedAt': 123, 'lastUpdatedAt': 123, 'versionNumber': 123, 'executionNumber': 123 }, ], 'queuedJobs': [ { 'jobId': 'string', 'queuedAt': 123, 'startedAt': 123, 'lastUpdatedAt': 123, 'versionNumber': 123, 'executionNumber': 123 }, ] } **Response Structure** * *(dict) --* * **inProgressJobs** *(list) --* A list of JobExecutionSummary objects with status IN_PROGRESS. * *(dict) --* Contains a subset of information about a job execution. * **jobId** *(string) --* The unique identifier you assigned to this job when it was created. * **queuedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was enqueued. * **startedAt** *(integer) --* The time, in seconds since the epoch, when the job execution started. * **lastUpdatedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was last updated. * **versionNumber** *(integer) --* The version of the job execution. Job execution versions are incremented each time IoT Jobs receives an update from a device. * **executionNumber** *(integer) --* A number that identifies a particular job execution on a particular device. * **queuedJobs** *(list) --* A list of JobExecutionSummary objects with status QUEUED. * *(dict) --* Contains a subset of information about a job execution. * **jobId** *(string) --* The unique identifier you assigned to this job when it was created. * **queuedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was enqueued. * **startedAt** *(integer) --* The time, in seconds since the epoch, when the job execution started. * **lastUpdatedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was last updated. * **versionNumber** *(integer) --* The version of the job execution. Job execution versions are incremented each time IoT Jobs receives an update from a device. * **executionNumber** *(integer) --* A number that identifies a particular job execution on a particular device. **Exceptions** * "IoTJobsDataPlane.Client.exceptions.InvalidRequestException" * "IoTJobsDataPlane.Client.exceptions.ResourceNotFoundException" * "IoTJobsDataPlane.Client.exceptions.ThrottlingException" * "IoTJobsDataPlane.Client.exceptions.ServiceUnavailableException" * "IoTJobsDataPlane.Client.exceptions.CertificateValidationExcepti on" IoTJobsDataPlane / Client / update_job_execution update_job_execution ******************** IoTJobsDataPlane.Client.update_job_execution(**kwargs) Updates the status of a job execution. Requires permission to access the UpdateJobExecution action. See also: AWS API Documentation **Request Syntax** response = client.update_job_execution( jobId='string', thingName='string', status='QUEUED'|'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'REJECTED'|'REMOVED'|'CANCELED', statusDetails={ 'string': 'string' }, stepTimeoutInMinutes=123, expectedVersion=123, includeJobExecutionState=True|False, includeJobDocument=True|False, executionNumber=123 ) Parameters: * **jobId** (*string*) -- **[REQUIRED]** The unique identifier assigned to this job when it was created. * **thingName** (*string*) -- **[REQUIRED]** The name of the thing associated with the device. * **status** (*string*) -- **[REQUIRED]** The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update. * **statusDetails** (*dict*) -- 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. * *(string) --* * *(string) --* * **stepTimeoutInMinutes** (*integer*) -- 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 to "IN_PROGRESS", and specifying a new timeout value in this field) the job execution status will be automatically set to "TIMED_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 ( "CreateJob" using field "timeoutConfig"). 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"). * **expectedVersion** (*integer*) -- 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.) * **includeJobExecutionState** (*boolean*) -- Optional. When included and set to true, the response contains the JobExecutionState data. The default is false. * **includeJobDocument** (*boolean*) -- Optional. When set to true, the response contains the job document. The default is false. * **executionNumber** (*integer*) -- Optional. A number that identifies a particular job execution on a particular device. Return type: dict Returns: **Response Syntax** { 'executionState': { 'status': 'QUEUED'|'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'REJECTED'|'REMOVED'|'CANCELED', 'statusDetails': { 'string': 'string' }, 'versionNumber': 123 }, 'jobDocument': 'string' } **Response Structure** * *(dict) --* * **executionState** *(dict) --* A JobExecutionState object. * **status** *(string) --* The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "TIMED_OUT", "REJECTED", or "REMOVED". * **statusDetails** *(dict) --* A collection of name/value pairs that describe the status of the job execution. The maximum length of the value in the name/value pair is 1,024 characters. * *(string) --* * *(string) --* * **versionNumber** *(integer) --* The version of the job execution. Job execution versions are incremented each time they are updated by a device. * **jobDocument** *(string) --* The contents of the Job Documents. **Exceptions** * "IoTJobsDataPlane.Client.exceptions.InvalidRequestException" * "IoTJobsDataPlane.Client.exceptions.ResourceNotFoundException" * "IoTJobsDataPlane.Client.exceptions.ThrottlingException" * "IoTJobsDataPlane.Client.exceptions.ServiceUnavailableException" * "IoTJobsDataPlane.Client.exceptions.CertificateValidationExcepti on" * "IoTJobsDataPlane.Client.exceptions.InvalidStateTransitionExcept ion" IoTJobsDataPlane / Client / start_next_pending_job_execution start_next_pending_job_execution ******************************** IoTJobsDataPlane.Client.start_next_pending_job_execution(**kwargs) Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing. Requires permission to access the StartNextPendingJobExecution action. See also: AWS API Documentation **Request Syntax** response = client.start_next_pending_job_execution( thingName='string', statusDetails={ 'string': 'string' }, stepTimeoutInMinutes=123 ) Parameters: * **thingName** (*string*) -- **[REQUIRED]** The name of the thing associated with the device. * **statusDetails** (*dict*) -- 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. * *(string) --* * *(string) --* * **stepTimeoutInMinutes** (*integer*) -- 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 calling "UpdateJobExecution", setting the status to "IN_PROGRESS", and specifying a new timeout value in field "stepTimeoutInMinutes") the job execution status will be automatically set to "TIMED_OUT". Note that setting the step timeout has no effect on the in progress timeout that may have been specified when the job was created ( "CreateJob" using field "timeoutConfig"). Valid values for this parameter range from 1 to 10080 (1 minute to 7 days). Return type: dict Returns: **Response Syntax** { 'execution': { 'jobId': 'string', 'thingName': 'string', 'status': 'QUEUED'|'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'REJECTED'|'REMOVED'|'CANCELED', 'statusDetails': { 'string': 'string' }, 'queuedAt': 123, 'startedAt': 123, 'lastUpdatedAt': 123, 'approximateSecondsBeforeTimedOut': 123, 'versionNumber': 123, 'executionNumber': 123, 'jobDocument': 'string' } } **Response Structure** * *(dict) --* * **execution** *(dict) --* A JobExecution object. * **jobId** *(string) --* The unique identifier you assigned to this job when it was created. * **thingName** *(string) --* The name of the thing that is executing the job. * **status** *(string) --* The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "TIMED_OUT", "REJECTED", or "REMOVED". * **statusDetails** *(dict) --* A collection of name/value pairs that describe the status of the job execution. The maximum length of the value in the name/value pair is 1,024 characters. * *(string) --* * *(string) --* * **queuedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was enqueued. * **startedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was started. * **lastUpdatedAt** *(integer) --* The time, in seconds since the epoch, when the job execution was last updated. * **approximateSecondsBeforeTimedOut** *(integer) --* The estimated number of seconds that remain before the job execution status will be changed to "TIMED_OUT". The actual job execution timeout can occur up to 60 seconds later than the estimated duration. * **versionNumber** *(integer) --* The version of the job execution. Job execution versions are incremented each time they are updated by a device. * **executionNumber** *(integer) --* A number that identifies a particular job execution on a particular device. It can be used later in commands that return or update job execution information. * **jobDocument** *(string) --* The content of the job document. **Exceptions** * "IoTJobsDataPlane.Client.exceptions.InvalidRequestException" * "IoTJobsDataPlane.Client.exceptions.ResourceNotFoundException" * "IoTJobsDataPlane.Client.exceptions.ThrottlingException" * "IoTJobsDataPlane.Client.exceptions.ServiceUnavailableException" * "IoTJobsDataPlane.Client.exceptions.CertificateValidationExcepti on"