AWS IoT

2021/03/31 - AWS IoT - 1 updated api methods

Changes  Added ability to prefix search on attribute value for ListThings API.

ListThings (updated) Link ΒΆ
Changes (request)
{'usePrefixAttributeValue': 'boolean'}

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 .

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

client.list_things(
    nextToken='string',
    maxResults=123,
    attributeName='string',
    attributeValue='string',
    thingTypeName='string',
    usePrefixAttributeValue=True|False
)
type nextToken

string

param nextToken

To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

type maxResults

integer

param maxResults

The maximum number of results to return in this operation.

type attributeName

string

param attributeName

The attribute name used to search for things.

type attributeValue

string

param attributeValue

The attribute value used to search for things.

type thingTypeName

string

param thingTypeName

The name of the thing type used to search for things.

type usePrefixAttributeValue

boolean

param usePrefixAttributeValue

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.

rtype

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.