IoTSiteWise / Client / list_assets
list_assets#
- IoTSiteWise.Client.list_assets(**kwargs)#
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
response = client.list_assets( nextToken='string', maxResults=123, assetModelId='string', filter='ALL'|'TOP_LEVEL' )
- Parameters:
nextToken (string) – The token to be used for the next set of paginated results.
maxResults (integer) –
The maximum number of results to return for each paginated request.
Default: 50
assetModelId (string) – The ID of the asset model by which to filter the list of assets. This parameter is required if you choose
ALL
forfilter
.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. TheassetModelId
parameter is required if you filter byALL
.TOP_LEVEL
– The list includes only top-level assets in the asset hierarchy tree.
Default:
ALL
- Return type:
dict
- Returns:
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.
Exceptions
IoTSiteWise.Client.exceptions.InvalidRequestException
IoTSiteWise.Client.exceptions.InternalFailureException
IoTSiteWise.Client.exceptions.ResourceNotFoundException
IoTSiteWise.Client.exceptions.ThrottlingException