Menu
AWS IoT
Developer Guide

UpdateThingGroup

Update a thing group.

Request syntax:

PATCH /thing-groups/thingGroupName Content-type: application/json { "thingGroupProperties": { "thingGroupDescription": "string", "attributePayload": { "attributes": { "string": "string" }, "merge": "boolean" } }, "expectedVersion": "long" }

URI Request Parameters:

Name

Type

Req?

Description

thingGroupName

ThingGroupName

yes

The thing group to update.

Request Body Parameters:

Name

Type

Req?

Description

thingGroupProperties

ThingGroupProperties

yes

The thing group properties.

expectedVersion

OptionalVersion

no

The expected version of the thing group. If this does not match the version of the thing group being updated, the update will fail.

Response syntax:

Content-type: application/json { "version": "long" }

Response Body Parameters:

Name

Type

Req?

Description

version

Version

no

The version of the updated thing group.

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

VersionConflictException

An exception thrown when the version of a thing passed to a command is different than the version specified with the --version parameter.

HTTP response code: 409

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

CLI

Synopsis:

aws iot update-thing-group \ --thing-group-name <value> \ --thing-group-properties <value> \ [--expected-version <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "thingGroupName": "string", "thingGroupProperties": { "thingGroupDescription": "string", "attributePayload": { "attributes": { "string": "string" }, "merge": "boolean" } }, "expectedVersion": "long" }

cli-input-json fields:

Name

Type

Description

thingGroupName

string

length max:128 min:1

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

The thing group to update.

thingGroupProperties

ThingGroupProperties

The thing group properties.

thingGroupDescription

string

length max:2028

pattern: [\\p{Graph} ]*

The thing group description.

attributePayload

AttributePayload

The thing group attributes in JSON format.

attributes

map

key: AttributeName

value: AttributeValue

A JSON string containing up to three key-value pair in JSON format. For example:

\"attributes\":{\"string1\":\"string2\"}

AttributeName

string

length max:128

pattern: [a-zA-Z0-9_.,@/:#-]+

AttributeValue

string

length max:800

pattern: [a-zA-Z0-9_.,@/:#-]*

merge

boolean

Specifies whether the list of attributes provided in the AttributePayload is merged with the attributes stored in the registry, instead of overwriting them.

To remove an attribute, call UpdateThing with an empty attribute value.

Note

The merge attribute is only valid when calling UpdateThing.

expectedVersion

long

java class: java.lang.Long

The expected version of the thing group. If this does not match the version of the thing group being updated, the update will fail.

Output:

{ "version": "long" }

cli output fields:

Name

Type

Description

version

long

The version of the updated thing group.

On this page: