IoTSiteWise / Client / list_associated_assets

list_associated_assets#

IoTSiteWise.Client.list_associated_assets(**kwargs)#

Retrieves a paginated list of associated assets.

You can use this operation to do the following:

  • CHILD - List all child assets associated to the asset.

  • PARENT - List the asset’s parent asset.

See also: AWS API Documentation

Request Syntax

response = client.list_associated_assets(
    assetId='string',
    hierarchyId='string',
    traversalDirection='PARENT'|'CHILD',
    nextToken='string',
    maxResults=123
)
Parameters:
  • assetId (string) –

    [REQUIRED]

    The ID of the asset to query. This can be either the actual ID in UUID format, or else externalId: followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the IoT SiteWise User Guide.

  • hierarchyId (string) –

    (Optional) If you don’t provide a hierarchyId, all the immediate assets in the traversalDirection will be returned.

    The ID of the hierarchy by which child assets are associated to the asset. (This can be either the actual ID in UUID format, or else externalId: followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the IoT SiteWise User Guide.)

    For more information, see Asset hierarchies in the IoT SiteWise User Guide.

  • traversalDirection (string) –

    The direction to list associated assets. Choose one of the following options:

    • CHILD – The list includes all child assets associated to the asset.

    • PARENT – The list includes the asset’s parent asset.

    Default: CHILD

  • 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

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',
                    'externalId': 'string'
                },
            ],
            'description': 'string',
            'externalId': '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, in UUID format.

        • 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.

            • externalId (string) –

              The external ID of the hierarchy, if it has one. When you update an asset hierarchy, you may assign an external ID if it doesn’t already have one. You can’t change the external ID of an asset hierarchy that already has one. For more information, see Using external IDs in the IoT SiteWise User Guide.

        • description (string) –

          A description for the asset.

        • externalId (string) –

          The external ID of the asset. For more information, see Using external IDs in the IoT SiteWise User Guide.

    • nextToken (string) –

      The token for the next set of results, or null if there are no additional results.

Exceptions