IoT.Client.
update_thing
(**kwargs)¶Updates the data for a thing.
Requires permission to access the UpdateThing action.
See also: AWS API Documentation
Request Syntax
response = client.update_thing(
thingName='string',
thingTypeName='string',
attributePayload={
'attributes': {
'string': 'string'
},
'merge': True|False
},
expectedVersion=123,
removeThingType=True|False
)
[REQUIRED]
The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
A list of thing attributes, a JSON string containing name-value pairs. For example:
{\"attributes\":{\"name1\":\"value2\"}}
This data is used to add new attributes or update existing attributes.
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
Specifies whether the list of attributes provided in the AttributePayload
is merged with the attributes stored in the registry, instead of overwriting them.
To remove an attribute, call UpdateThing
with an empty attribute value.
Note
The merge
attribute is only valid when calling UpdateThing
or UpdateThingGroup
.
UpdateThing
request is rejected with a VersionConflictException
.dict
Response Syntax
{}
Response Structure
(dict) --
The output from the UpdateThing operation.
Exceptions
IoT.Client.exceptions.InvalidRequestException
IoT.Client.exceptions.VersionConflictException
IoT.Client.exceptions.ThrottlingException
IoT.Client.exceptions.UnauthorizedException
IoT.Client.exceptions.ServiceUnavailableException
IoT.Client.exceptions.InternalFailureException
IoT.Client.exceptions.ResourceNotFoundException