更新事物 - Amazon IoT Core
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

更新事物

您可以使用 UpdateThing 命令更新事物。此命令仅更新事物的属性。您无法更改事物的名称。要更改事物的名称,请创建一个新事物,为其指定新名称,然后删除旧事物。

$ aws iot update-thing --thing-name "MyLightBulb" --attribute-payload "{\"attributes\": {\"wattage\":\"150\", \"model\":\"456\"}}"

UpdateThing 命令不会生成任何输出。您可以使用 DescribeThing 命令查看结果:

$ aws iot describe-thing --thing-name "MyLightBulb" { "attributes": { "model": "456", "wattage": "150" }, "version": 2, "thingName": "MyLightBulb" }

有关更多信息,请参阅《 Amazon CLI 命令参考》中的 update-thing