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
)
nextToken
value from a previous response; otherwise null to receive the first set of results.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.
dict
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.
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