AWS IoT API question

0

Among the AWS IoT APIs, you can use the AddThingToBillingGroup API to add things to a thing group. You can add thing groups as subgroups to a thing group in AWS IoT Core. For example, you can create thing_sub_group as a subgroup of thing_group as a subgroup. Can I add child thing groups to a thing group through the AWS IoT API? If so, which API can I use? Thank you. https://docs.aws.amazon.com/iot/latest/apireference/API_AddThingToBillingGroup.html

asked a year ago210 views
3 Answers
0

parent group !

answered a year ago
0

Hi. You've mentioned both things groups and billing groups, but I'm not sure you meant to. I'm pretty sure you just mean Thing groups.

For Thing groups, the equivalent API is AddThingToThingGroup.

The UpdateThingGroup API does not let you change or add the parent group. The parent group can only be specified in CreateThingGroup.

profile pictureAWS
EXPERT
Greg_B
answered a year ago
0

Greg called it out (please upvote and accept :) ), but to highlight:

Can I add child thing groups to a thing group through the AWS IoT API? If so, which API can I use?

To add a child ThingGroup to an existing (parent) ThingGroup, use the CreateThingGroup and pass the parent as part of the call (thingGroupName is in the URI):

POST /thing-groups/thingGroupName HTTP/1.1
Content-type: application/json

{
   "parentGroupName": "PARENT_THING_GROUP_NAME_GOES_HERE",
   "tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "thingGroupProperties": { 
      "attributePayload": { 
         "attributes": { 
            "string" : "string" 
         },
         "merge": boolean
      },
      "thingGroupDescription": "string"
   }
}
AWS
Gavin_A
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions