CmdID

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

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

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

3 in the AWS CLI reference
--payloadThe state information, in JSON format.
--shadow-nameThe name of the shadow.
--thing-nameThe name of the thing.