Skip to main content

asset_model_composite_models

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

Overview

Nameasset_model_composite_models
TypeResource
Idaws.iotsitewise.asset_model_composite_models

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
action_definitionsarrayThe available actions for a composite model on this asset model.
asset_model_composite_model_descriptionstringThe description for the composite model. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
asset_model_composite_model_external_idstringThe external ID of a composite model on this asset model. (pattern: <code>[a-zA-Z0-9_][a-zA-Z_-0-9.:]*[a-zA-Z0-9_]+</code>)
asset_model_composite_model_idstringThe ID of a composite model on this asset model. (pattern: <code>^(?!00000000-0000-0000-0000-000000000000)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
asset_model_composite_model_namestringThe unique, friendly name for the composite model. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
asset_model_composite_model_patharrayThe path to the composite model listing the parent composite models.
asset_model_composite_model_propertiesarrayThe property definitions of the composite model.
asset_model_composite_model_summariesarrayThe list of composite model summaries for the composite model.
asset_model_composite_model_typestringThe composite model type. Valid values are AWS/ALARM, CUSTOM, or AWS/L4E_ANOMALY. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
asset_model_idstringThe ID of the asset model, in UUID format. (pattern: <code>^(?!00000000-0000-0000-0000-000000000000)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
composition_detailsobjectMetadata for the composition relationship established by using composedAssetModelId in CreateAssetModelCompositeModel . For instance, an array detailing the path of the composition relationship for this composite model.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_asset_model_composite_modelselectasset_model_id, asset_model_composite_model_id, regionassetModelVersionRetrieves information about an asset model composite model (also known as an asset model component). For more information, see Custom composite models (Components) in the IoT SiteWise User Guide.
list_asset_model_composite_modelsselectasset_model_id, regionnextToken, maxResults, assetModelVersionRetrieves a paginated list of composite models associated with the asset model
create_asset_model_composite_modelinsertasset_model_id, region, assetModelCompositeModelName, assetModelCompositeModelTypeIf-Match, If-None-Match, Match-For-Version-TypeCreates a custom composite model from specified property and hierarchy definitions. There are two types of custom composite models, inline and component-model-based. Use component-model-based custom composite models to define standard, reusable components. A component-model-based custom composite model consists of a name, a description, and the ID of the component model it references. A component-model-based custom composite model has no properties of its own; its referenced component model provides its associated properties to any created assets. For more information, see Custom composite models (Components) in the IoT SiteWise User Guide. Use inline custom composite models to organize the properties of an asset model. The properties of inline custom composite models are local to the asset model where they are included and can't be used to create multiple assets. To create a component-model-based model, specify the composedAssetModelId of an existing asset model with assetModelType of COMPONENT_MODEL. To create an inline model, specify the assetModelCompositeModelProperties and don't include an composedAssetModelId.
update_asset_model_composite_modelupdateasset_model_id, asset_model_composite_model_id, region, assetModelCompositeModelNameIf-Match, If-None-Match, Match-For-Version-TypeUpdates a composite model and all of the assets that were created from the model. Each asset created from the model inherits the updated asset model's property and hierarchy definitions. For more information, see Updating assets and models in the IoT SiteWise User Guide. If you remove a property from a composite asset model, IoT SiteWise deletes all previous data for that property. You can’t change the type or data type of an existing property. To replace an existing composite asset model property with a new one with the same name, do the following: Submit an UpdateAssetModelCompositeModel request with the entire existing property removed. Submit a second UpdateAssetModelCompositeModel request that includes the new property. The new asset property will have the same name as the previous one and IoT SiteWise will generate a new unique id.
delete_asset_model_composite_modeldeleteasset_model_id, asset_model_composite_model_id, regionclientToken, If-Match, If-None-Match, Match-For-Version-TypeDeletes a composite model. This action can't be undone. You must delete all assets created from a composite model before you can delete the model. Also, you can't delete a composite model if a parent asset model exists that contains a property formula expression that depends on the asset model that you want to delete. For more information, see Deleting assets and models in the IoT SiteWise User Guide.

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
asset_model_composite_model_idstringThe ID of a composite model on this asset model.
asset_model_idstringThe ID of the asset model, in UUID format.
regionstringAWS region (default: us-east-1)
If-MatchstringThe expected current entity tag (ETag) for the asset model’s latest or active version (specified using matchForVersionType). The delete request is rejected if the tag does not match the latest or active version's current entity tag. See Optimistic locking for asset model writes in the IoT SiteWise User Guide.
If-None-MatchstringAccepts * to reject the delete request if an active version (specified using matchForVersionType as ACTIVE) already exists for the asset model.
Match-For-Version-TypestringSpecifies the asset model version type (LATEST or ACTIVE) used in conjunction with If-Match or If-None-Match headers to determine the target ETag for the delete operation.
assetModelVersionstringThe version alias that specifies the latest or active version of the asset model. The details are returned in the response. The default value is LATEST. See Asset model versions in the IoT SiteWise User Guide.
clientTokenstringA unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.
maxResultsintegerThe maximum number of results to return for each paginated request. Default: 50
nextTokenstringThe token to be used for the next set of paginated results.

SELECT examples

Retrieves information about an asset model composite model (also known as an asset model component). For more information, see Custom composite models (Components) in the IoT SiteWise User Guide.

SELECT
action_definitions,
asset_model_composite_model_description,
asset_model_composite_model_external_id,
asset_model_composite_model_id,
asset_model_composite_model_name,
asset_model_composite_model_path,
asset_model_composite_model_properties,
asset_model_composite_model_summaries,
asset_model_composite_model_type,
asset_model_id,
composition_details
FROM aws.iotsitewise.asset_model_composite_models
WHERE asset_model_id = '{{ asset_model_id }}' -- required
AND asset_model_composite_model_id = '{{ asset_model_composite_model_id }}' -- required
AND region = '{{ region }}' -- required
AND assetModelVersion = '{{ assetModelVersion }}'
;

INSERT examples

Creates a custom composite model from specified property and hierarchy definitions. There are two types of custom composite models, inline and component-model-based. Use component-model-based custom composite models to define standard, reusable components. A component-model-based custom composite model consists of a name, a description, and the ID of the component model it references. A component-model-based custom composite model has no properties of its own; its referenced component model provides its associated properties to any created assets. For more information, see Custom composite models (Components) in the IoT SiteWise User Guide. Use inline custom composite models to organize the properties of an asset model. The properties of inline custom composite models are local to the asset model where they are included and can't be used to create multiple assets. To create a component-model-based model, specify the composedAssetModelId of an existing asset model with assetModelType of COMPONENT_MODEL. To create an inline model, specify the assetModelCompositeModelProperties and don't include an composedAssetModelId.

INSERT INTO aws.iotsitewise.asset_model_composite_models (
assetModelCompositeModelExternalId,
parentAssetModelCompositeModelId,
assetModelCompositeModelId,
assetModelCompositeModelDescription,
assetModelCompositeModelName,
assetModelCompositeModelType,
clientToken,
composedAssetModelId,
assetModelCompositeModelProperties,
asset_model_id,
region,
`If-Match`,
`If-None-Match`,
`Match-For-Version-Type`
)
SELECT
'{{ assetModelCompositeModelExternalId }}',
'{{ parentAssetModelCompositeModelId }}',
'{{ assetModelCompositeModelId }}',
'{{ assetModelCompositeModelDescription }}',
'{{ assetModelCompositeModelName }}' /* required */,
'{{ assetModelCompositeModelType }}' /* required */,
'{{ clientToken }}',
'{{ composedAssetModelId }}',
'{{ assetModelCompositeModelProperties }}',
'{{ asset_model_id }}',
'{{ region }}',
'{{ If-Match }}',
'{{ If-None-Match }}',
'{{ Match-For-Version-Type }}'
RETURNING
asset_model_composite_model_id,
asset_model_composite_model_path,
asset_model_id,
asset_model_status
;

UPDATE examples

Updates a composite model and all of the assets that were created from the model. Each asset created from the model inherits the updated asset model's property and hierarchy definitions. For more information, see Updating assets and models in the IoT SiteWise User Guide. If you remove a property from a composite asset model, IoT SiteWise deletes all previous data for that property. You can’t change the type or data type of an existing property. To replace an existing composite asset model property with a new one with the same name, do the following: Submit an UpdateAssetModelCompositeModel request with the entire existing property removed. Submit a second UpdateAssetModelCompositeModel request that includes the new property. The new asset property will have the same name as the previous one and IoT SiteWise will generate a new unique id.

UPDATE aws.iotsitewise.asset_model_composite_models
SET
assetModelCompositeModelExternalId = '{{ assetModelCompositeModelExternalId }}',
assetModelCompositeModelDescription = '{{ assetModelCompositeModelDescription }}',
assetModelCompositeModelName = '{{ assetModelCompositeModelName }}',
clientToken = '{{ clientToken }}',
assetModelCompositeModelProperties = '{{ assetModelCompositeModelProperties }}'
WHERE
asset_model_id = '{{ asset_model_id }}' --required
AND asset_model_composite_model_id = '{{ asset_model_composite_model_id }}' --required
AND region = '{{ region }}' --required
AND assetModelCompositeModelName = '{{ assetModelCompositeModelName }}' --required
AND `If-Match` = '{{ If-Match}}'
AND `If-None-Match` = '{{ If-None-Match}}'
AND `Match-For-Version-Type` = '{{ Match-For-Version-Type}}'
RETURNING
asset_model_composite_model_path,
asset_model_id,
asset_model_status;

DELETE examples

Deletes a composite model. This action can't be undone. You must delete all assets created from a composite model before you can delete the model. Also, you can't delete a composite model if a parent asset model exists that contains a property formula expression that depends on the asset model that you want to delete. For more information, see Deleting assets and models in the IoT SiteWise User Guide.

DELETE FROM aws.iotsitewise.asset_model_composite_models
WHERE asset_model_id = '{{ asset_model_id }}' --required
AND asset_model_composite_model_id = '{{ asset_model_composite_model_id }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
AND `If-Match` = '{{ If-Match }}'
AND `If-None-Match` = '{{ If-None-Match }}'
AND `Match-For-Version-Type` = '{{ Match-For-Version-Type }}'
;