list_thing_groups

IoT.Client.list_thing_groups(**kwargs)

List the thing groups in your account.

Requires permission to access the ListThingGroups action.

See also: AWS API Documentation

Request Syntax

response = client.list_thing_groups(
    nextToken='string',
    maxResults=123,
    parentGroup='string',
    namePrefixFilter='string',
    recursive=True|False
)
Parameters
  • nextToken (string) -- To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.
  • maxResults (integer) -- The maximum number of results to return at one time.
  • parentGroup (string) -- A filter that limits the results to those with the specified parent group.
  • namePrefixFilter (string) -- A filter that limits the results to those with the specified name prefix.
  • recursive (boolean) -- If true, return child groups as well.
Return type

dict

Returns

Response Syntax

{
    'thingGroups': [
        {
            'groupName': 'string',
            'groupArn': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • thingGroups (list) --

      The thing groups.

      • (dict) --

        The name and ARN of a group.

        • groupName (string) --

          The group name.

        • groupArn (string) --

          The group ARN.

    • nextToken (string) --

      The token to use to get the next set of results. Will not be returned if operation has returned all results.

Exceptions

  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.InternalFailureException
  • IoT.Client.exceptions.ResourceNotFoundException
  • IoT.Client.exceptions.ThrottlingException