list_things

IoT.Client.list_things(**kwargs)

Lists your things. Use the attributeName and attributeValue parameters to filter your things. For example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute Color with the value Red . For more information, see List Things from the Amazon Web Services IoT Core Developer Guide .

Requires permission to access the ListThings action.

Note

You will not be charged for calling this API if an Access denied error is returned. You will also not be charged if no attributes or pagination token was provided in request and no pagination token and no results were returned.

See also: AWS API Documentation

Request Syntax

response = client.list_things(
    nextToken='string',
    maxResults=123,
    attributeName='string',
    attributeValue='string',
    thingTypeName='string',
    usePrefixAttributeValue=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 in this operation.
  • attributeName (string) -- The attribute name used to search for things.
  • attributeValue (string) -- The attribute value used to search for things.
  • thingTypeName (string) -- The name of the thing type used to search for things.
  • usePrefixAttributeValue (boolean) --

    When true , the action returns the thing resources with attribute values that start with the attributeValue provided.

    When false , or not present, the action returns only the thing resources with attribute values that match the entire attributeValue provided.

Return type

dict

Returns

Response Syntax

{
    'things': [
        {
            'thingName': 'string',
            'thingTypeName': 'string',
            'thingArn': 'string',
            'attributes': {
                'string': 'string'
            },
            'version': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    The output from the ListThings operation.

    • things (list) --

      The things.

      • (dict) --

        The properties of the thing, including thing name, thing type name, and a list of thing attributes.

        • thingName (string) --

          The name of the thing.

        • thingTypeName (string) --

          The name of the thing type, if the thing has been associated with a type.

        • thingArn (string) --

          The thing ARN.

        • attributes (dict) --

          A list of thing attributes which are name-value pairs.

          • (string) --
            • (string) --
        • version (integer) --

          The version of the thing record in the registry.

    • 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.ThrottlingException
  • IoT.Client.exceptions.UnauthorizedException
  • IoT.Client.exceptions.ServiceUnavailableException
  • IoT.Client.exceptions.InternalFailureException