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

preguntada hace un año217 visualizaciones
3 Respuestas
0

parent group !

respondido hace un año
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
EXPERTO
Greg_B
respondido hace un año
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
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas