IoT / Client / create_thing_type
create_thing_type#
- IoT.Client.create_thing_type(**kwargs)#
Creates a new thing type. If this call is made multiple times using the same thing type name and configuration, the call will succeed. If this call is made with the same thing type name but different configuration a
ResourceAlreadyExistsException
is thrown.Requires permission to access the CreateThingType action.
See also: AWS API Documentation
Request Syntax
response = client.create_thing_type( thingTypeName='string', thingTypeProperties={ 'thingTypeDescription': 'string', 'searchableAttributes': [ 'string', ], 'mqtt5Configuration': { 'propagatingAttributes': [ { 'userPropertyKey': 'string', 'thingAttribute': 'string', 'connectionAttribute': 'string' }, ] } }, tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
- Parameters:
thingTypeName (string) –
[REQUIRED]
The name of the thing type.
thingTypeProperties (dict) –
The ThingTypeProperties for the thing type to create. It contains information about the new thing type including a description, and a list of searchable thing attribute names.
thingTypeDescription (string) –
The description of the thing type.
searchableAttributes (list) –
A list of searchable thing attribute names.
(string) –
mqtt5Configuration (dict) –
The configuration to add user-defined properties to enrich MQTT 5 messages.
propagatingAttributes (list) –
An object that represents the propagating thing attributes and the connection attributes.
(dict) –
An object that represents the connection attribute, thing attribute, and the user property key.
userPropertyKey (string) –
The key of the user property key-value pair.
thingAttribute (string) –
The user-defined thing attribute that is propagating for MQTT 5 message enrichment.
connectionAttribute (string) –
The attribute associated with the connection between a device and Amazon Web Services IoT Core.
tags (list) –
Metadata which can be used to manage the thing type.
(dict) –
A set of key/value pairs that are used to manage the resource.
Key (string) – [REQUIRED]
The tag’s key.
Value (string) –
The tag’s value.
- Return type:
dict
- Returns:
Response Syntax
{ 'thingTypeName': 'string', 'thingTypeArn': 'string', 'thingTypeId': 'string' }
Response Structure
(dict) –
The output of the CreateThingType operation.
thingTypeName (string) –
The name of the thing type.
thingTypeArn (string) –
The Amazon Resource Name (ARN) of the thing type.
thingTypeId (string) –
The thing type ID.
Exceptions
IoT.Client.exceptions.InvalidRequestException
IoT.Client.exceptions.ThrottlingException
IoT.Client.exceptions.UnauthorizedException
IoT.Client.exceptions.ServiceUnavailableException
IoT.Client.exceptions.InternalFailureException
IoT.Client.exceptions.ResourceAlreadyExistsException