Skip to main content

asset_models

Creates, updates, deletes or gets an asset_model resource or lists asset_models in a region

Overview

Nameasset_models
TypeResource
DescriptionResource schema for AWS::IoTSiteWise::AssetModel
Idawscc.iotsitewise.asset_models

Fields

NameDatatypeDescription
asset_model_idstringThe ID of the asset model.
asset_model_typestringThe type of the asset model (ASSET_MODEL OR COMPONENT_MODEL or INTERFACE)
asset_model_external_idstringThe external ID of the asset model.
asset_model_arnstringThe ARN of the asset model, which has the following format.
asset_model_namestringA unique, friendly name for the asset model.
asset_model_descriptionstringA description for the asset model.
asset_model_propertiesarrayThe property definitions of the asset model. You can specify up to 200 properties per asset model.
asset_model_composite_modelsarrayThe composite asset models that are part of this asset model. Composite asset models are asset models that contain specific properties.
asset_model_hierarchiesarrayThe 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.
enforced_asset_model_interface_relationshipsarraya list of asset model and interface relationships
tagsarrayA list of key-value pairs that contain metadata for the asset model.
regionstringAWS region.

For more information, see AWS::IoTSiteWise::AssetModel.

Methods

NameResourceAccessible byRequired Params
create_resourceasset_modelsINSERTAssetModelName, region
delete_resourceasset_modelsDELETEIdentifier, region
update_resourceasset_modelsUPDATEIdentifier, PatchDocument, region
list_resourcesasset_models_list_onlySELECTregion
get_resourceasset_modelsSELECTIdentifier, region

SELECT examples

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,
enforced_asset_model_interface_relationships,
tags
FROM awscc.iotsitewise.asset_models
WHERE
region = '{{ region }}' AND
Identifier = '{{ asset_model_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new asset_model resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.iotsitewise.asset_models (
AssetModelName,
region
)
SELECT
'{{ asset_model_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a asset_model resource, using stack-deploy.

/*+ update */
UPDATE awscc.iotsitewise.asset_models
SET PatchDocument = string('{{ {
"AssetModelExternalId": asset_model_external_id,
"AssetModelName": asset_model_name,
"AssetModelDescription": asset_model_description,
"EnforcedAssetModelInterfaceRelationships": enforced_asset_model_interface_relationships,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ asset_model_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iotsitewise.asset_models
WHERE
Identifier = '{{ asset_model_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the asset_models resource, the following permissions are required:

iotsitewise:CreateAssetModel,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:DescribeAssetModel,
iotsitewise:UpdateAssetModel,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:UpdateAssetModelCompositeModel,
iotsitewise:DescribeAssetModelCompositeModel,
iotsitewise:CreateAssetModelCompositeModel,
iotsitewise:PutAssetModelInterfaceRelationship,
iotsitewise:DescribeAssetModelInterfaceRelationship