

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 更新物件
<a name="update-thing"></a>

您可以使用 **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"
}
```

如需詳細資訊，請參閱《 AWS CLI 命令參考》中的 [update-thing](https://docs.aws.amazon.com//cli/latest/reference/iot/update-thing.html)。