Menu
AWS IoT
Developer Guide

AssociateTargetsWithJob

Associates a group with a continuous job. The following criteria must be met:

  • The job must have been created with the targetSelection field set to "CONTINUOUS".

  • The job status must currently be "IN_PROGRESS".

  • The total number of targets associated with a job must not exceed 100.

Request syntax:

POST /jobs/jobId/targets Content-type: application/json { "targets": [ "string" ], "comment": "string" }

URI Request Parameters:

Name

Type

Req?

Description

jobId

JobId

yes

The unique identifier you assigned to this job when it was created.

Request Body Parameters:

Name

Type

Req?

Description

targets

JobTargets

yes

A list of thing group ARNs that define the targets of the job.

comment

Comment

no

An optional comment string describing why the job was associated with the targets.

Response syntax:

Content-type: application/json { "jobArn": "string", "jobId": "string", "description": "string" }

Response Body Parameters:

Name

Type

Req?

Description

jobArn

JobArn

no

An ARN identifying the job.

jobId

JobId

no

The unique identifier you assigned to this job when it was created.

description

JobDescription

no

A short text description of the job.

Errors:

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

LimitExceededException

The number of attached entities exceeds the limit.

HTTP response code: 410

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

CLI

Synopsis:

aws iot associate-targets-with-job \ --targets <value> \ --job-id <value> \ [--comment <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "targets": [ "string" ], "jobId": "string", "comment": "string" }

cli-input-json fields:

Name

Type

Description

targets

list

member: TargetArn

A list of thing group ARNs that define the targets of the job.

TargetArn

string

jobId

string

length max:64 min:1

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

The unique identifier you assigned to this job when it was created.

comment

string

length max:2028

pattern: [^\\p{C}]+

An optional comment string describing why the job was associated with the targets.

Output:

{ "jobArn": "string", "jobId": "string", "description": "string" }

cli output fields:

Name

Type

Description

jobArn

string

An ARN identifying the job.

jobId

string

length max:64 min:1

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

The unique identifier you assigned to this job when it was created.

description

string

length max:2028

pattern: [^\\p{C}]+

A short text description of the job.

On this page: