Skip to main content

things

Creates, updates, deletes, gets or lists a things resource.

Overview

Namethings
TypeResource
Idaws.iotthingsgraph.things

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
thing_arnstringThe ARN of the thing.
thing_namestringThe name of the thing. (pattern: <code>[a-zA-Z0-9:_-]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
search_thingsselectregionSearches for things associated with the specified entity. You can search by both device and device model. For example, if two different devices, camera1 and camera2, implement the camera device model, the user can associate thing1 to camera1 and thing2 to camera2. SearchThings(camera2) will return only thing2, but SearchThings(camera) will return both thing1 and thing2. This action searches for exact matches and doesn't perform partial text matching.
associate_entity_to_thingupdateregion, thingName, entityIdAssociates a device with a concrete thing that is in the user's registry. A thing can be associated with only one device at a time. If you associate a thing with a new device id, its previous association will be removed.
dissociate_entity_from_thingexecregion, thingName, entityTypeDissociates a device entity from a concrete thing. The action takes only the type of the entity that you need to dissociate because only one entity of a particular type can be associated with a thing.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Searches for things associated with the specified entity. You can search by both device and device model. For example, if two different devices, camera1 and camera2, implement the camera device model, the user can associate thing1 to camera1 and thing2 to camera2. SearchThings(camera2) will return only thing2, but SearchThings(camera) will return both thing1 and thing2. This action searches for exact matches and doesn't perform partial text matching.

SELECT
thing_arn,
thing_name
FROM aws.iotthingsgraph.things
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Associates a device with a concrete thing that is in the user's registry. A thing can be associated with only one device at a time. If you associate a thing with a new device id, its previous association will be removed.

UPDATE aws.iotthingsgraph.things
SET
thingName = '{{ thingName }}',
entityId = '{{ entityId }}',
namespaceVersion = {{ namespaceVersion }}
WHERE
region = '{{ region }}' --required
AND thingName = '{{ thingName }}' --required
AND entityId = '{{ entityId }}' --required;

Lifecycle Methods

Dissociates a device entity from a concrete thing. The action takes only the type of the entity that you need to dissociate because only one entity of a particular type can be associated with a thing.

EXEC aws.iotthingsgraph.things.dissociate_entity_from_thing
@region='{{ region }}' --required
@@json=
'{
"thingName": "{{ thingName }}",
"entityType": "{{ entityType }}"
}'
;