thing_types
Creates, updates, deletes, gets or lists a thing_types resource.
Overview
| Name | thing_types |
| Type | Resource |
| Id | aws.iot.thing_types |
Fields
The following fields are returned by SELECT queries:
- describe_thing_type
- list_thing_types
| Name | Datatype | Description |
|---|---|---|
thing_type_arn | string | The thing type ARN. |
thing_type_id | string | The thing type ID. |
thing_type_metadata | object | The ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when it was deprecated. |
thing_type_name | string | The name of the thing type. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
thing_type_properties | object | The ThingTypeProperties contains information about the thing type including: a thing type description, and a list of searchable thing attribute names. |
| Name | Datatype | Description |
|---|---|---|
thing_type_arn | string | The thing type ARN. |
thing_type_metadata | object | The ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when it was deprecated. |
thing_type_name | string | The name of the thing type. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
thing_type_properties | object | The ThingTypeProperties contains information about the thing type including: a thing type description, and a list of searchable thing attribute names. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_thing_type | select | thing_type_name, region | Gets information about the specified thing type. Requires permission to access the DescribeThingType action. | |
list_thing_types | select | region | nextToken, maxResults, thingTypeName | Lists the existing thing types. Requires permission to access the ListThingTypes action. |
create_thing_type | insert | thing_type_name, region | 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. | |
update_thing_type | update | thing_type_name, region | Updates a thing type. | |
delete_thing_type | delete | thing_type_name, region | Deletes the specified thing type. You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type. Requires permission to access the DeleteThingType action. | |
deprecate_thing_type | exec | thing_type_name, region | Deprecates a thing type. You can not associate new things with deprecated thing type. Requires permission to access the DeprecateThingType action. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
thing_type_name | string | The name of the thing type to deprecate. |
maxResults | integer | The maximum number of results to return in this operation. |
nextToken | string | To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results. |
thingTypeName | string | The name of the thing type. |
SELECT examples
- describe_thing_type
- list_thing_types
Gets information about the specified thing type. Requires permission to access the DescribeThingType action.
SELECT
thing_type_arn,
thing_type_id,
thing_type_metadata,
thing_type_name,
thing_type_properties
FROM aws.iot.thing_types
WHERE thing_type_name = '{{ thing_type_name }}' -- required
AND region = '{{ region }}' -- required
;
Lists the existing thing types. Requires permission to access the ListThingTypes action.
SELECT
thing_type_arn,
thing_type_metadata,
thing_type_name,
thing_type_properties
FROM aws.iot.thing_types
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND thingTypeName = '{{ thingTypeName }}'
;
INSERT examples
- create_thing_type
- Manifest
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.
INSERT INTO aws.iot.thing_types (
thingTypeProperties,
tags,
thing_type_name,
region
)
SELECT
'{{ thingTypeProperties }}',
'{{ tags }}',
'{{ thing_type_name }}',
'{{ region }}'
RETURNING
thing_type_arn,
thing_type_id,
thing_type_name
;
# Description fields are for documentation purposes
- name: thing_types
props:
- name: thing_type_name
value: "{{ thing_type_name }}"
description: Required parameter for the thing_types resource.
- name: region
value: "{{ region }}"
description: Required parameter for the thing_types resource.
- name: thingTypeProperties
description: |
The ThingTypeProperties contains information about the thing type including: a thing type description, and a list of searchable thing attribute names.
value:
thingTypeDescription: "{{ thingTypeDescription }}"
searchableAttributes:
- "{{ searchableAttributes }}"
mqtt5Configuration:
propagatingAttributes:
- userPropertyKey: "{{ userPropertyKey }}"
thingAttribute: "{{ thingAttribute }}"
connectionAttribute: "{{ connectionAttribute }}"
- name: tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_thing_type
Updates a thing type.
UPDATE aws.iot.thing_types
SET
thingTypeProperties = '{{ thingTypeProperties }}'
WHERE
thing_type_name = '{{ thing_type_name }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_thing_type
Deletes the specified thing type. You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type. Requires permission to access the DeleteThingType action.
DELETE FROM aws.iot.thing_types
WHERE thing_type_name = '{{ thing_type_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- deprecate_thing_type
Deprecates a thing type. You can not associate new things with deprecated thing type. Requires permission to access the DeprecateThingType action.
EXEC aws.iot.thing_types.deprecate_thing_type
@thing_type_name='{{ thing_type_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"undoDeprecate": {{ undoDeprecate }}
}'
;