entities
Creates, updates, deletes, gets or lists an entities resource.
Overview
| Name | entities |
| Type | Resource |
| Id | aws.iottwinmaker.entities |
Fields
The following fields are returned by SELECT queries:
- get_entity
- list_entities
| Name | Datatype | Description |
|---|---|---|
are_all_components_returned | boolean | This flag notes whether all components are returned in the API response. The maximum number of components returned is 30. |
arn | string | The ARN of the entity. (pattern: <code>arn:((aws)|(aws-cn)|(aws-us-gov)):iottwinmaker:[a-z0-9-]+:[0-9]{12}:[/a-zA-Z0-9_-.:]+</code>) |
components | object | An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object. |
creation_date_time | string (date-time) | The date and time when the entity was created. |
description | string | The description of the entity. (pattern: <code>.*</code>) |
entity_id | string | The ID of the entity. (pattern: <code>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_-0-9.:]*[a-zA-Z0-9]+</code>) |
entity_name | string | The name of the entity. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
has_child_entities | boolean | A Boolean value that specifies whether the entity has associated child entities. |
parent_entity_id | string | The ID of the parent entity for this entity. (pattern: <code>$ROOT|^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_-0-9.:]*[a-zA-Z0-9]+</code>) |
status | object | The current status of the entity. |
sync_source | string | The syncSource of the sync job, if this entity was created by a sync job. (pattern: <code>[a-zA-Z_0-9]+</code>) |
update_date_time | string (date-time) | The date and time when the entity was last updated. |
workspace_id | string | The ID of the workspace. (pattern: <code>[a-zA-Z_0-9][a-zA-Z_-0-9]*[a-zA-Z0-9]+</code>) |
| Name | Datatype | Description |
|---|---|---|
entity_summaries | array | A list of objects that contain information about the entities. |
next_token | string | The string that specifies the next page of results. (pattern: <code>.*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_entity | select | workspace_id, entity_id, region | Retrieves information about an entity. | |
list_entities | select | workspace_id, region | Lists all entities in a workspace. | |
create_entity | insert | workspace_id, region, entityName | Creates an entity. | |
update_entity | update | workspace_id, entity_id, region | Updates an entity. | |
delete_entity | delete | workspace_id, entity_id, region | isRecursive | Deletes an entity. |
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 |
|---|---|---|
entity_id | string | The ID of the entity to delete. |
region | string | AWS region (default: us-east-1) |
workspace_id | string | The ID of the workspace that contains the entity to delete. |
isRecursive | boolean | A Boolean value that specifies whether the operation deletes child entities. |
SELECT examples
- get_entity
- list_entities
Retrieves information about an entity.
SELECT
are_all_components_returned,
arn,
components,
creation_date_time,
description,
entity_id,
entity_name,
has_child_entities,
parent_entity_id,
status,
sync_source,
update_date_time,
workspace_id
FROM aws.iottwinmaker.entities
WHERE workspace_id = '{{ workspace_id }}' -- required
AND entity_id = '{{ entity_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists all entities in a workspace.
SELECT
entity_summaries,
next_token
FROM aws.iottwinmaker.entities
WHERE workspace_id = '{{ workspace_id }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_entity
- Manifest
Creates an entity.
INSERT INTO aws.iottwinmaker.entities (
entityId,
entityName,
description,
components,
compositeComponents,
parentEntityId,
tags,
workspace_id,
region
)
SELECT
'{{ entityId }}',
'{{ entityName }}' /* required */,
'{{ description }}',
'{{ components }}',
'{{ compositeComponents }}',
'{{ parentEntityId }}',
'{{ tags }}',
'{{ workspace_id }}',
'{{ region }}'
RETURNING
arn,
creation_date_time,
entity_id,
state
;
# Description fields are for documentation purposes
- name: entities
props:
- name: workspace_id
value: "{{ workspace_id }}"
description: Required parameter for the entities resource.
- name: region
value: "{{ region }}"
description: Required parameter for the entities resource.
- name: entityId
value: "{{ entityId }}"
- name: entityName
value: "{{ entityName }}"
- name: description
value: "{{ description }}"
- name: components
value: "{{ components }}"
- name: compositeComponents
value: "{{ compositeComponents }}"
- name: parentEntityId
value: "{{ parentEntityId }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_entity
Updates an entity.
UPDATE aws.iottwinmaker.entities
SET
entityName = '{{ entityName }}',
description = '{{ description }}',
componentUpdates = '{{ componentUpdates }}',
compositeComponentUpdates = '{{ compositeComponentUpdates }}',
parentEntityUpdate = '{{ parentEntityUpdate }}'
WHERE
workspace_id = '{{ workspace_id }}' --required
AND entity_id = '{{ entity_id }}' --required
AND region = '{{ region }}' --required
RETURNING
state,
update_date_time;
DELETE examples
- delete_entity
Deletes an entity.
DELETE FROM aws.iottwinmaker.entities
WHERE workspace_id = '{{ workspace_id }}' --required
AND entity_id = '{{ entity_id }}' --required
AND region = '{{ region }}' --required
AND isRecursive = '{{ isRecursive }}'
;