IoT / Client / update_thing

update_thing#

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
)
Parameters:
  • thingName (string) –

    [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.

  • thingTypeName (string) – The name of the thing type.

  • attributePayload (dict) –

    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.

    • attributes (dict) –

      A JSON string containing up to three key-value pair in JSON format. For example:

      {\"attributes\":{\"string1\":\"string2\"}}

      • (string) –

        • (string) –

    • merge (boolean) –

      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.

  • expectedVersion (integer) – The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the UpdateThing request is rejected with a VersionConflictException.

  • removeThingType (boolean) – Remove a thing type association. If true, the association is removed.

Return type:

dict

Returns:

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