Menu
AWS IoT
Developer Guide

UpdateThingGroupsForThing

UpdateThingGroupsForThing

Updates the groups to which the thing belongs.

https

Request syntax:

PUT /thing-groups/updateThingGroupsForThing Content-type: application/json { "thingName": "string", "thingGroupsToAdd": [ "string" ], "thingGroupsToRemove": [ "string" ] }

Request Body Parameters:

Name

Type

Req?

Description

thingName

ThingName

no

The thing whose group memberships will be updated.

thingGroupsToAdd

ThingGroupList

no

The groups to which the thing will be added.

thingGroupsToRemove

ThingGroupList

no

The groups from which the thing will be removed.

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

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-groups-for-thing \ [--thing-name <value>] \ [--thing-groups-to-add <value>] \ [--thing-groups-to-remove <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "thingName": "string", "thingGroupsToAdd": [ "string" ], "thingGroupsToRemove": [ "string" ] }

cli-input-json fields:

Name

Type

Description

thingName

string

length- max:128 min:1

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

The thing whose group memberships will be updated.

thingGroupsToAdd

list

member: ThingGroupName

The groups to which the thing will be added.

thingGroupsToRemove

list

member: ThingGroupName

The groups from which the thing will be removed.

Output:

None

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.

ThrottlingException

The rate exceeds the limit.

InternalFailureException

An unexpected error has occurred.

ResourceNotFoundException

The specified resource does not exist.