CmdID / aws / aws iot-data
aws iot-data update-thing-shadow
Updates the shadow for the specified thing. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To update a thing shadow
The following update-thing-shadow example modifies the current state of the device shadow for the specified thing and saves it to the file output.txt.
aws iot-data update-thing-shadow "output.txt" --cli-binary-format raw-in-base64-out --thing-name MyRPi --payload '{"state":{"reported":{"moisture":"okay"}}}'Identify--cli-binary-formatThe formatting style to be used for binary blobs.--thing-nameThe name of the thing.--payloadThe state information, in JSON format.This command produces no output. The response payload is saved to output.txt.
Contents of output.txt:
{
"state": {
"reported": {
"moisture": "okay"
}
},
"metadata": {
"reported": {
"moisture": {
"timestamp": 1560270036
}
}
},
"version": 2,
"timestamp": 1560270036
}
For more information, see Device Shadow Service Data Flow in the AWS IoT Developers Guide.
Options
--payloadThe state information, in JSON format.--shadow-nameThe name of the shadow.--thing-nameThe name of the thing.