Skip to main content

entities

Creates, updates, deletes, gets or lists an entities resource.

Overview​

Nameentities
TypeResource
Idaws.iottwinmaker.entities

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
are_all_components_returnedbooleanThis flag notes whether all components are returned in the API response. The maximum number of components returned is 30.
arnstringThe 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>)
componentsobjectAn object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.
creation_date_timestring (date-time)The date and time when the entity was created.
descriptionstringThe description of the entity. (pattern: <code>.*</code>)
entity_idstringThe 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_namestringThe name of the entity. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
has_child_entitiesbooleanA Boolean value that specifies whether the entity has associated child entities.
parent_entity_idstringThe 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>)
statusobjectThe current status of the entity.
sync_sourcestringThe syncSource of the sync job, if this entity was created by a sync job. (pattern: <code>[a-zA-Z_0-9]+</code>)
update_date_timestring (date-time)The date and time when the entity was last updated.
workspace_idstringThe ID of the workspace. (pattern: <code>[a-zA-Z_0-9][a-zA-Z_-0-9]*[a-zA-Z0-9]+</code>)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_entityselectworkspace_id, entity_id, regionRetrieves information about an entity.
list_entitiesselectworkspace_id, regionLists all entities in a workspace.
create_entityinsertworkspace_id, region, entityNameCreates an entity.
update_entityupdateworkspace_id, entity_id, regionUpdates an entity.
delete_entitydeleteworkspace_id, entity_id, regionisRecursiveDeletes 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.

NameDatatypeDescription
entity_idstringThe ID of the entity to delete.
regionstringAWS region (default: us-east-1)
workspace_idstringThe ID of the workspace that contains the entity to delete.
isRecursivebooleanA Boolean value that specifies whether the operation deletes child entities.

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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​

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 }}'
;