CreateJobTemplate - AWS IoT

CreateJobTemplate

Creates a job template.

Requires permission to access the CreateJobTemplate action.

Request Syntax

PUT /job-templates/jobTemplateId HTTP/1.1 Content-type: application/json { "abortConfig": { "criteriaList": [ { "action": "string", "failureType": "string", "minNumberOfExecutedThings": number, "thresholdPercentage": number } ] }, "description": "string", "document": "string", "documentSource": "string", "jobArn": "string", "jobExecutionsRolloutConfig": { "exponentialRate": { "baseRatePerMinute": number, "incrementFactor": number, "rateIncreaseCriteria": { "numberOfNotifiedThings": number, "numberOfSucceededThings": number } }, "maximumPerMinute": number }, "presignedUrlConfig": { "expiresInSec": number, "roleArn": "string" }, "tags": [ { "Key": "string", "Value": "string" } ], "timeoutConfig": { "inProgressTimeoutInMinutes": number } }

URI Request Parameters

The request uses the following URI parameters.

jobTemplateId

A unique identifier for the job template. We recommend using a UUID. Alpha-numeric characters, "-", and "_" are valid for use here.

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_-]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

abortConfig

The criteria that determine when and how a job abort takes place.

Type: AbortConfig object

Required: No

description

A description of the job document.

Type: String

Length Constraints: Maximum length of 2028.

Pattern: [^\p{C}]+

Required: Yes

document

The job document. Required if you don't specify a value for documentSource.

Type: String

Length Constraints: Maximum length of 32768.

Required: No

documentSource

An S3 link to the job document to use in the template. Required if you don't specify a value for document.

Note

If the job document resides in an S3 bucket, you must use a placeholder link when specifying the document.

The placeholder link is of the following form:

${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}

where bucket is your bucket name and key is the object in the bucket to which you are linking.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1350.

Required: No

jobArn

The ARN of the job to use as the basis for the job template.

Type: String

Required: No

jobExecutionsRolloutConfig

Allows you to create a staged rollout of a job.

Type: JobExecutionsRolloutConfig object

Required: No

presignedUrlConfig

Configuration for pre-signed S3 URLs.

Type: PresignedUrlConfig object

Required: No

tags

Metadata that can be used to manage the job template.

Type: Array of Tag objects

Required: No

timeoutConfig

Specifies the amount of time each device has to finish its execution of the job. A 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 timer expires, it will be automatically set to TIMED_OUT.

Type: TimeoutConfig object

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "jobTemplateArn": "string", "jobTemplateId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

jobTemplateArn

The ARN of the job template.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: ^arn:[!-~]+$

jobTemplateId

The unique identifier of the job template.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_-]+

Errors

ConflictException

A resource with the same name already exists.

HTTP Status Code: 409

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

LimitExceededException

A limit has been exceeded.

HTTP Status Code: 410

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

ThrottlingException

The rate exceeds the limit.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: