things
Creates, updates, deletes, gets or lists a things resource.
Overview
| Name | things |
| Type | Resource |
| Id | aws.iotthingsgraph.things |
Fields
The following fields are returned by SELECT queries:
- search_things
| Name | Datatype | Description |
|---|---|---|
thing_arn | string | The ARN of the thing. |
thing_name | string | The name of the thing. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
search_things | select | region | 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. | |
associate_entity_to_thing | update | region, thingName, entityId | 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. | |
dissociate_entity_from_thing | exec | region, thingName, entityType | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- search_things
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
- associate_entity_to_thing
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
- dissociate_entity_from_thing
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 }}"
}'
;