2022/05/31 - AWS IoT SiteWise - 5 updated api methods
Changes This release adds the following new optional field to the IoT SiteWise asset resource: assetDescription.
{'assetDescription': 'string'}
Creates an asset from an existing asset model. For more information, see Creating assets in the IoT SiteWise User Guide .
See also: AWS API Documentation
Request Syntax
client.create_asset( assetName='string', assetModelId='string', clientToken='string', tags={ 'string': 'string' }, assetDescription='string' )
string
[REQUIRED]
A unique, friendly name for the asset.
string
[REQUIRED]
The ID of the asset model from which to create the asset.
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.
This field is autopopulated if not provided.
dict
A list of key-value pairs that contain metadata for the asset. For more information, see Tagging your IoT SiteWise resources in the IoT SiteWise User Guide .
(string) --
(string) --
string
A description for the asset.
dict
Response Syntax
{ 'assetId': 'string', 'assetArn': 'string', 'assetStatus': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string', 'details': [ { 'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION', 'message': 'string' }, ] } } }
Response Structure
(dict) --
assetId (string) --
The ID of the asset. This ID uniquely identifies the asset within IoT SiteWise and can be used with other IoT SiteWise APIs.
assetArn (string) --
The ARN of the asset, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
assetStatus (dict) --
The status of the asset, which contains a state (CREATING after successfully calling this operation) and any error message.
state (string) --
The current status of the asset.
error (dict) --
Contains associated error information, if any.
code (string) --
The error code.
message (string) --
The error message.
details (list) --
A list of detailed errors.
(dict) --
Contains detailed error information.
code (string) --
The error code.
message (string) --
The error message.
{'assetDescription': 'string'}
Retrieves information about an asset.
See also: AWS API Documentation
Request Syntax
client.describe_asset( assetId='string' )
string
[REQUIRED]
The ID of the asset.
dict
Response Syntax
{ 'assetId': 'string', 'assetArn': 'string', 'assetName': 'string', 'assetModelId': 'string', 'assetProperties': [ { 'id': 'string', 'name': 'string', 'alias': 'string', 'notification': { 'topic': 'string', 'state': 'ENABLED'|'DISABLED' }, 'dataType': 'STRING'|'INTEGER'|'DOUBLE'|'BOOLEAN'|'STRUCT', 'dataTypeSpec': 'string', 'unit': 'string' }, ], 'assetHierarchies': [ { 'id': 'string', 'name': 'string' }, ], 'assetCompositeModels': [ { 'name': 'string', 'description': 'string', 'type': 'string', 'properties': [ { 'id': 'string', 'name': 'string', 'alias': 'string', 'notification': { 'topic': 'string', 'state': 'ENABLED'|'DISABLED' }, 'dataType': 'STRING'|'INTEGER'|'DOUBLE'|'BOOLEAN'|'STRUCT', 'dataTypeSpec': 'string', 'unit': 'string' }, ] }, ], 'assetCreationDate': datetime(2015, 1, 1), 'assetLastUpdateDate': datetime(2015, 1, 1), 'assetStatus': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string', 'details': [ { 'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION', 'message': 'string' }, ] } }, 'assetDescription': 'string' }
Response Structure
(dict) --
assetId (string) --
The ID of the asset.
assetArn (string) --
The ARN of the asset, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
assetName (string) --
The name of the asset.
assetModelId (string) --
The ID of the asset model that was used to create the asset.
assetProperties (list) --
The list of asset properties for the asset.
This object doesn't include properties that you define in composite models. You can find composite model properties in the assetCompositeModels object.
(dict) --
Contains asset property information.
id (string) --
The ID of the asset property.
name (string) --
The name of the property.
alias (string) --
The alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature ). For more information, see Mapping industrial data streams to asset properties in the IoT SiteWise User Guide .
notification (dict) --
The asset property's notification topic and state. For more information, see UpdateAssetProperty .
topic (string) --
The MQTT topic to which IoT SiteWise publishes property value update notifications.
state (string) --
The current notification state.
dataType (string) --
The data type of the asset property.
dataTypeSpec (string) --
The data type of the structure for this property. This parameter exists on properties that have the STRUCT data type.
unit (string) --
The unit (such as Newtons or RPM ) of the asset property.
assetHierarchies (list) --
A list of asset hierarchies that each contain a hierarchyId . A hierarchy specifies allowed parent/child asset relationships.
(dict) --
Describes an asset hierarchy that contains a hierarchy's name and ID.
id (string) --
The ID of the hierarchy. This ID is a hierarchyId .
name (string) --
The hierarchy name provided in the CreateAssetModel or UpdateAssetModel API operation.
assetCompositeModels (list) --
The composite models for the asset.
(dict) --
Contains information about a composite model in an asset. This object contains the asset's properties that you define in the composite model.
name (string) --
The name of the composite model.
description (string) --
The description of the composite model.
type (string) --
The type of the composite model. For alarm composite models, this type is AWS/ALARM .
properties (list) --
The asset properties that this composite model defines.
(dict) --
Contains asset property information.
id (string) --
The ID of the asset property.
name (string) --
The name of the property.
alias (string) --
The alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature ). For more information, see Mapping industrial data streams to asset properties in the IoT SiteWise User Guide .
notification (dict) --
The asset property's notification topic and state. For more information, see UpdateAssetProperty .
topic (string) --
The MQTT topic to which IoT SiteWise publishes property value update notifications.
state (string) --
The current notification state.
dataType (string) --
The data type of the asset property.
dataTypeSpec (string) --
The data type of the structure for this property. This parameter exists on properties that have the STRUCT data type.
unit (string) --
The unit (such as Newtons or RPM ) of the asset property.
assetCreationDate (datetime) --
The date the asset was created, in Unix epoch time.
assetLastUpdateDate (datetime) --
The date the asset was last updated, in Unix epoch time.
assetStatus (dict) --
The current status of the asset, which contains a state and any error message.
state (string) --
The current status of the asset.
error (dict) --
Contains associated error information, if any.
code (string) --
The error code.
message (string) --
The error message.
details (list) --
A list of detailed errors.
(dict) --
Contains detailed error information.
code (string) --
The error code.
message (string) --
The error message.
assetDescription (string) --
A description for the asset.
{'assetSummaries': {'description': 'string'}}
Retrieves a paginated list of asset summaries.
You can use this operation to do the following:
List assets based on a specific asset model.
List top-level assets.
You can't use this operation to list all assets. To retrieve summaries for all of your assets, use ListAssetModels to get all of your asset model IDs. Then, use ListAssets to get all assets for each asset model.
See also: AWS API Documentation
Request Syntax
client.list_assets( nextToken='string', maxResults=123, assetModelId='string', filter='ALL'|'TOP_LEVEL' )
string
The token to be used for the next set of paginated results.
integer
The maximum number of results to return for each paginated request.
Default: 50
string
The ID of the asset model by which to filter the list of assets. This parameter is required if you choose ALL for filter .
string
The filter for the requested list of assets. Choose one of the following options:
ALL – The list includes all assets for a given asset model ID. The assetModelId parameter is required if you filter by ALL .
TOP_LEVEL – The list includes only top-level assets in the asset hierarchy tree.
Default: ALL
dict
Response Syntax
{ 'assetSummaries': [ { 'id': 'string', 'arn': 'string', 'name': 'string', 'assetModelId': 'string', 'creationDate': datetime(2015, 1, 1), 'lastUpdateDate': datetime(2015, 1, 1), 'status': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string', 'details': [ { 'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION', 'message': 'string' }, ] } }, 'hierarchies': [ { 'id': 'string', 'name': 'string' }, ], 'description': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
assetSummaries (list) --
A list that summarizes each asset.
(dict) --
Contains a summary of an asset.
id (string) --
The ID of the asset.
arn (string) --
The ARN of the asset, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
name (string) --
The name of the asset.
assetModelId (string) --
The ID of the asset model used to create this asset.
creationDate (datetime) --
The date the asset was created, in Unix epoch time.
lastUpdateDate (datetime) --
The date the asset was last updated, in Unix epoch time.
status (dict) --
The current status of the asset.
state (string) --
The current status of the asset.
error (dict) --
Contains associated error information, if any.
code (string) --
The error code.
message (string) --
The error message.
details (list) --
A list of detailed errors.
(dict) --
Contains detailed error information.
code (string) --
The error code.
message (string) --
The error message.
hierarchies (list) --
A list of asset hierarchies that each contain a hierarchyId . A hierarchy specifies allowed parent/child asset relationships.
(dict) --
Describes an asset hierarchy that contains a hierarchy's name and ID.
id (string) --
The ID of the hierarchy. This ID is a hierarchyId .
name (string) --
The hierarchy name provided in the CreateAssetModel or UpdateAssetModel API operation.
description (string) --
A description for the asset.
nextToken (string) --
The token for the next set of results, or null if there are no additional results.
{'assetSummaries': {'description': 'string'}}
Retrieves a paginated list of associated assets.
You can use this operation to do the following:
List child assets associated to a parent asset by a hierarchy that you specify.
List an asset's parent asset.
See also: AWS API Documentation
Request Syntax
client.list_associated_assets( assetId='string', hierarchyId='string', traversalDirection='PARENT'|'CHILD', nextToken='string', maxResults=123 )
string
[REQUIRED]
The ID of the asset to query.
string
The ID of the hierarchy by which child assets are associated to the asset. To find a hierarchy ID, use the DescribeAsset or DescribeAssetModel operations. This parameter is required if you choose CHILD for traversalDirection .
For more information, see Asset hierarchies in the IoT SiteWise User Guide .
string
The direction to list associated assets. Choose one of the following options:
CHILD – The list includes all child assets associated to the asset. The hierarchyId parameter is required if you choose CHILD .
PARENT – The list includes the asset's parent asset.
Default: CHILD
string
The token to be used for the next set of paginated results.
integer
The maximum number of results to return for each paginated request.
Default: 50
dict
Response Syntax
{ 'assetSummaries': [ { 'id': 'string', 'arn': 'string', 'name': 'string', 'assetModelId': 'string', 'creationDate': datetime(2015, 1, 1), 'lastUpdateDate': datetime(2015, 1, 1), 'status': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string', 'details': [ { 'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION', 'message': 'string' }, ] } }, 'hierarchies': [ { 'id': 'string', 'name': 'string' }, ], 'description': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
assetSummaries (list) --
A list that summarizes the associated assets.
(dict) --
Contains a summary of an associated asset.
id (string) --
The ID of the asset.
arn (string) --
The ARN of the asset, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
name (string) --
The name of the asset.
assetModelId (string) --
The ID of the asset model used to create the asset.
creationDate (datetime) --
The date the asset was created, in Unix epoch time.
lastUpdateDate (datetime) --
The date the asset was last updated, in Unix epoch time.
status (dict) --
The current status of the asset.
state (string) --
The current status of the asset.
error (dict) --
Contains associated error information, if any.
code (string) --
The error code.
message (string) --
The error message.
details (list) --
A list of detailed errors.
(dict) --
Contains detailed error information.
code (string) --
The error code.
message (string) --
The error message.
hierarchies (list) --
A list of asset hierarchies that each contain a hierarchyId . A hierarchy specifies allowed parent/child asset relationships.
(dict) --
Describes an asset hierarchy that contains a hierarchy's name and ID.
id (string) --
The ID of the hierarchy. This ID is a hierarchyId .
name (string) --
The hierarchy name provided in the CreateAssetModel or UpdateAssetModel API operation.
description (string) --
A description for the asset.
nextToken (string) --
The token for the next set of results, or null if there are no additional results.
{'assetDescription': 'string'}
Updates an asset's name. For more information, see Updating assets and models in the IoT SiteWise User Guide .
See also: AWS API Documentation
Request Syntax
client.update_asset( assetId='string', assetName='string', clientToken='string', assetDescription='string' )
string
[REQUIRED]
The ID of the asset to update.
string
[REQUIRED]
A unique, friendly name for the asset.
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.
This field is autopopulated if not provided.
string
A description for the asset.
dict
Response Syntax
{ 'assetStatus': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string', 'details': [ { 'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION', 'message': 'string' }, ] } } }
Response Structure
(dict) --
assetStatus (dict) --
The status of the asset, which contains a state (UPDATING after successfully calling this operation) and any error message.
state (string) --
The current status of the asset.
error (dict) --
Contains associated error information, if any.
code (string) --
The error code.
message (string) --
The error message.
details (list) --
A list of detailed errors.
(dict) --
Contains detailed error information.
code (string) --
The error code.
message (string) --
The error message.