Skip to main content

thing_shadows

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

Overview​

Namething_shadows
TypeResource
Idaws.iot_data.thing_shadows

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
payloadstring (byte)The state information, in JSON format.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_thing_shadowselectthing_name, regionnameGets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide.
update_thing_shadowupdatething_name, region, payloadnameUpdates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide.
delete_thing_shadowdeletething_name, regionnameDeletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide.

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)
thing_namestringThe name of the thing.
namestringThe name of the shadow.

SELECT examples​

Gets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide.

SELECT
payload
FROM aws.iot_data.thing_shadows
WHERE thing_name = '{{ thing_name }}' -- required
AND region = '{{ region }}' -- required
AND name = '{{ name }}'
;

UPDATE examples​

Updates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide.

UPDATE aws.iot_data.thing_shadows
SET
payload = '{{ payload }}'
WHERE
thing_name = '{{ thing_name }}' --required
AND region = '{{ region }}' --required
AND payload = '{{ payload }}' --required
AND name = '{{ name}}'
RETURNING
payload;

DELETE examples​

Deletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide.

DELETE FROM aws.iot_data.thing_shadows
WHERE thing_name = '{{ thing_name }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}'
;