asset_model_composite_models
Creates, updates, deletes, gets or lists an asset_model_composite_models resource.
Overview
| Name | asset_model_composite_models |
| Type | Resource |
| Id | aws.iotsitewise.asset_model_composite_models |
Fields
The following fields are returned by SELECT queries:
- describe_asset_model_composite_model
- list_asset_model_composite_models
| Name | Datatype | Description |
|---|---|---|
action_definitions | array | The available actions for a composite model on this asset model. |
asset_model_composite_model_description | string | The description for the composite model. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
asset_model_composite_model_external_id | string | The 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_id | string | The 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_name | string | The unique, friendly name for the composite model. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
asset_model_composite_model_path | array | The path to the composite model listing the parent composite models. |
asset_model_composite_model_properties | array | The property definitions of the composite model. |
asset_model_composite_model_summaries | array | The list of composite model summaries for the composite model. |
asset_model_composite_model_type | string | The composite model type. Valid values are AWS/ALARM, CUSTOM, or AWS/L4E_ANOMALY. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
asset_model_id | string | The 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_details | object | Metadata 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the composite model that this summary describes.. (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>) |
name | string | The name of the composite model that this summary describes.. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
description | string | The description of the composite model that this summary describes.. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
external_id | string | The external ID of a composite model on this asset model. For more information, see Using external IDs in the IoT SiteWise User Guide. (pattern: <code>[a-zA-Z0-9_][a-zA-Z_-0-9.:]*[a-zA-Z0-9_]+</code>) |
path | array | The path that includes all the pieces that make up the composite model. |
type_ | string | The composite model type. Valid values are AWS/ALARM, CUSTOM, or AWS/L4E_ANOMALY. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_asset_model_composite_model | select | asset_model_id, asset_model_composite_model_id, region | assetModelVersion | 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. |
list_asset_model_composite_models | select | asset_model_id, region | nextToken, maxResults, assetModelVersion | Retrieves a paginated list of composite models associated with the asset model |
create_asset_model_composite_model | insert | asset_model_id, region, assetModelCompositeModelName, assetModelCompositeModelType | If-Match, If-None-Match, Match-For-Version-Type | 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. |
update_asset_model_composite_model | update | asset_model_id, asset_model_composite_model_id, region, assetModelCompositeModelName | If-Match, If-None-Match, Match-For-Version-Type | 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. |
delete_asset_model_composite_model | delete | asset_model_id, asset_model_composite_model_id, region | clientToken, If-Match, If-None-Match, Match-For-Version-Type | 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. |
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 |
|---|---|---|
asset_model_composite_model_id | string | The ID of a composite model on this asset model. |
asset_model_id | string | The ID of the asset model, in UUID format. |
region | string | AWS region (default: us-east-1) |
If-Match | string | The 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-Match | string | Accepts * to reject the delete request if an active version (specified using matchForVersionType as ACTIVE) already exists for the asset model. |
Match-For-Version-Type | string | Specifies 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. |
assetModelVersion | string | The 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. |
clientToken | string | A 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. |
maxResults | integer | The maximum number of results to return for each paginated request. Default: 50 |
nextToken | string | The token to be used for the next set of paginated results. |
SELECT examples
- describe_asset_model_composite_model
- list_asset_model_composite_models
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 }}'
;
Retrieves a paginated list of composite models associated with the asset model
SELECT
id,
name,
description,
external_id,
path,
type_
FROM aws.iotsitewise.asset_model_composite_models
WHERE asset_model_id = '{{ asset_model_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND assetModelVersion = '{{ assetModelVersion }}'
;
INSERT examples
- create_asset_model_composite_model
- Manifest
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
;
# Description fields are for documentation purposes
- name: asset_model_composite_models
props:
- name: asset_model_id
value: "{{ asset_model_id }}"
description: Required parameter for the asset_model_composite_models resource.
- name: region
value: "{{ region }}"
description: Required parameter for the asset_model_composite_models resource.
- name: assetModelCompositeModelExternalId
value: "{{ assetModelCompositeModelExternalId }}"
- name: parentAssetModelCompositeModelId
value: "{{ parentAssetModelCompositeModelId }}"
- name: assetModelCompositeModelId
value: "{{ assetModelCompositeModelId }}"
- name: assetModelCompositeModelDescription
value: "{{ assetModelCompositeModelDescription }}"
- name: assetModelCompositeModelName
value: "{{ assetModelCompositeModelName }}"
- name: assetModelCompositeModelType
value: "{{ assetModelCompositeModelType }}"
- name: clientToken
value: "{{ clientToken }}"
- name: composedAssetModelId
value: "{{ composedAssetModelId }}"
- name: assetModelCompositeModelProperties
value:
- id: "{{ id }}"
externalId: "{{ externalId }}"
name: "{{ name }}"
dataType: "{{ dataType }}"
dataTypeSpec: "{{ dataTypeSpec }}"
unit: "{{ unit }}"
type_:
attribute:
defaultValue: "{{ defaultValue }}"
measurement:
processingConfig:
forwardingConfig:
state: "{{ state }}"
transform:
expression: "{{ expression }}"
variables:
- name: "{{ name }}"
value:
propertyId: "{{ propertyId }}"
hierarchyId: "{{ hierarchyId }}"
propertyPath: "{{ propertyPath }}"
processingConfig:
computeLocation: "{{ computeLocation }}"
forwardingConfig:
state: "{{ state }}"
metric:
expression: "{{ expression }}"
variables:
- name: "{{ name }}"
value:
propertyId: "{{ propertyId }}"
hierarchyId: "{{ hierarchyId }}"
propertyPath: "{{ propertyPath }}"
window:
tumbling:
interval: "{{ interval }}"
offset: "{{ offset }}"
processingConfig:
computeLocation: "{{ computeLocation }}"
- name: If-Match
value: "{{ If-Match }}"
description: The expected current entity tag (ETag) for the asset model’s latest or active version (specified using matchForVersionType). The create 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.
description: The expected current entity tag (ETag) for the asset model’s latest or active version (specified using matchForVersionType). The create 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.
- name: If-None-Match
value: "{{ If-None-Match }}"
description: Accepts * to reject the create request if an active version (specified using matchForVersionType as ACTIVE) already exists for the asset model.
description: Accepts * to reject the create request if an active version (specified using matchForVersionType as ACTIVE) already exists for the asset model.
- name: Match-For-Version-Type
value: "{{ Match-For-Version-Type }}"
description: Specifies 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 create operation.
description: Specifies 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 create operation.
UPDATE examples
- update_asset_model_composite_model
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
- delete_asset_model_composite_model
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 }}'
;