asset_models
Creates, updates, deletes or gets an asset_model
resource or lists asset_models
in a region
Overview
Name | asset_models |
Type | Resource |
Description | Resource schema for AWS::IoTSiteWise::AssetModel |
Id | aws.iotsitewise.asset_models |
Fields
Name | Datatype | Description |
---|---|---|
asset_model_id | string | The ID of the asset model. |
asset_model_type | string | The type of the asset model (ASSET_MODEL OR COMPONENT_MODEL) |
asset_model_external_id | string | The external ID of the asset model. |
asset_model_arn | string | The ARN of the asset model, which has the following format. |
asset_model_name | string | A unique, friendly name for the asset model. |
asset_model_description | string | A description for the asset model. |
asset_model_properties | array | The property definitions of the asset model. You can specify up to 200 properties per asset model. |
asset_model_composite_models | array | The composite asset models that are part of this asset model. Composite asset models are asset models that contain specific properties. |
asset_model_hierarchies | array | The hierarchy definitions of the asset model. Each hierarchy specifies an asset model whose assets can be children of any other assets created from this asset model. You can specify up to 10 hierarchies per asset model. |
tags | array | A list of key-value pairs that contain metadata for the asset model. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AssetModelName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all asset_models
in a region.
SELECT
region,
asset_model_id,
asset_model_type,
asset_model_external_id,
asset_model_arn,
asset_model_name,
asset_model_description,
asset_model_properties,
asset_model_composite_models,
asset_model_hierarchies,
tags
FROM aws.iotsitewise.asset_models
WHERE region = 'us-east-1';
Gets all properties from an individual asset_model
.
SELECT
region,
asset_model_id,
asset_model_type,
asset_model_external_id,
asset_model_arn,
asset_model_name,
asset_model_description,
asset_model_properties,
asset_model_composite_models,
asset_model_hierarchies,
tags
FROM aws.iotsitewise.asset_models
WHERE region = 'us-east-1' AND data__Identifier = '<AssetModelId>';
INSERT
example
Use the following StackQL query and manifest file to create a new asset_model
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iotsitewise.asset_models (
AssetModelName,
region
)
SELECT
'{{ AssetModelName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iotsitewise.asset_models (
AssetModelType,
AssetModelExternalId,
AssetModelName,
AssetModelDescription,
AssetModelProperties,
AssetModelCompositeModels,
AssetModelHierarchies,
Tags,
region
)
SELECT
'{{ AssetModelType }}',
'{{ AssetModelExternalId }}',
'{{ AssetModelName }}',
'{{ AssetModelDescription }}',
'{{ AssetModelProperties }}',
'{{ AssetModelCompositeModels }}',
'{{ AssetModelHierarchies }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: asset_model
props:
- name: AssetModelType
value: '{{ AssetModelType }}'
- name: AssetModelExternalId
value: '{{ AssetModelExternalId }}'
- name: AssetModelName
value: '{{ AssetModelName }}'
- name: AssetModelDescription
value: '{{ AssetModelDescription }}'
- name: AssetModelProperties
value:
- LogicalId: '{{ LogicalId }}'
Id: '{{ Id }}'
ExternalId: '{{ ExternalId }}'
Name: '{{ Name }}'
DataType: '{{ DataType }}'
DataTypeSpec: '{{ DataTypeSpec }}'
Unit: '{{ Unit }}'
Type:
TypeName: '{{ TypeName }}'
Attribute:
DefaultValue: '{{ DefaultValue }}'
Transform:
Expression: '{{ Expression }}'
Variables:
- Name: '{{ Name }}'
Value:
PropertyLogicalId: '{{ PropertyLogicalId }}'
PropertyId: '{{ PropertyId }}'
PropertyExternalId: '{{ PropertyExternalId }}'
PropertyPath:
- Name: '{{ Name }}'
HierarchyLogicalId: '{{ HierarchyLogicalId }}'
HierarchyId: '{{ HierarchyId }}'
HierarchyExternalId: '{{ HierarchyExternalId }}'
Metric:
Expression: '{{ Expression }}'
Variables:
- null
Window:
Tumbling:
Interval: '{{ Interval }}'
Offset: '{{ Offset }}'
- name: AssetModelCompositeModels
value:
- Id: '{{ Id }}'
ExternalId: '{{ ExternalId }}'
ComposedAssetModelId: '{{ ComposedAssetModelId }}'
ParentAssetModelCompositeModelExternalId: '{{ ParentAssetModelCompositeModelExternalId }}'
Path:
- '{{ Path[0] }}'
Description: '{{ Description }}'
Name: '{{ Name }}'
Type: '{{ Type }}'
CompositeModelProperties:
- null
- name: AssetModelHierarchies
value:
- Id: '{{ Id }}'
ExternalId: '{{ ExternalId }}'
LogicalId: '{{ LogicalId }}'
Name: '{{ Name }}'
ChildAssetModelId: '{{ ChildAssetModelId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.iotsitewise.asset_models
WHERE data__Identifier = '<AssetModelId>'
AND region = 'us-east-1';
Permissions
To operate on the asset_models
resource, the following permissions are required:
Create
iotsitewise:CreateAssetModel,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:DescribeAssetModel,
iotsitewise:UpdateAssetModel,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:UpdateAssetModelCompositeModel,
iotsitewise:DescribeAssetModelCompositeModel,
iotsitewise:CreateAssetModelCompositeModel
Read
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssetModelProperties,
iotsitewise:DescribeAssetModelCompositeModel,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:ListTagsForResource
Update
iotsitewise:DescribeAssetModel,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:UntagResource,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:CreateAssetModelCompositeModel,
iotsitewise:UpdateAssetModelCompositeModel,
iotsitewise:DeleteAssetModelCompositeModel,
iotsitewise:DescribeAssetModelCompositeModel,
iotsitewise:UpdateAssetModel
Delete
iotsitewise:DescribeAssetModel,
iotsitewise:DeleteAssetModel,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels
List
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssetModels,
iotsitewise:ListTagsForResource,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels