Deleting assets and models - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Deleting assets and models

You can delete your assets and models from Amazon IoT SiteWise when you're done with them. The delete operations are asynchronous and take time to propagate through Amazon IoT SiteWise.

Deleting assets

You can use the Amazon IoT SiteWise console or API to delete an asset.

Before you can delete an asset, you must first disassociate its child assets and disassociate it from its parent asset. For more information, see Associating and disassociating assets. If you use the Amazon Command Line Interface (Amazon CLI), you can use the ListAssociatedAssets operation to list an asset's children.

When you delete an asset, its status is DELETING until the changes propagate. For more information, see Asset and model states. After the asset is deleted, you can't query that asset. If you do, the API returns an HTTP 404 response.

Important

Amazon IoT SiteWise deletes all property data for deleted assets.

Deleting an asset (console)

You can use the Amazon IoT SiteWise console to delete an asset.

To delete an asset (console)
  1. Navigate to the Amazon IoT SiteWise console.

  2. In the navigation pane, choose Assets.

  3. Choose the asset to delete.

    Tip

    You can choose the arrow icon to expand an asset hierarchy to find your asset.

  4. If the asset has any Associated assets, delete each asset. You can choose an asset's name to navigate to its page, where you can delete it.

  5. On the asset's page, choose Delete.

  6. In the Delete asset dialog box, do the following:

    1. Enter Delete to confirm deletion.

    2. Choose Delete.

Deleting an asset (Amazon CLI)

You can use the Amazon Command Line Interface (Amazon CLI) to delete an asset.

Use the DeleteAsset operation to delete an asset. Specify the following parameter:

  • assetId – The ID of the asset. This is the actual ID in UUID format, or the externalId:myExternalId if it has one. For more information, see Referencing objects with external IDs in the Amazon IoT SiteWise User Guide.

To delete an asset (Amazon CLI)
  1. Run the following command to list the asset's hierarchies. Replace asset-id with the ID or the external ID of the asset:

    aws iotsitewise describe-asset --asset-id asset-id

    The operation returns a response that contains the asset's details. The response contains an assetHierarchies list that has the following structure:

    { ... "assetHierarchies": [ { "id": "String", "name": "String" } ], ... }

    For more information, see the DescribeAsset operation.

  2. For each hierarchy, run the following command to list the asset's children that are associated with that hierarchy. Replace asset-id with the ID or external ID of the asset and hierarchy-id with the ID or external ID of the hierarchy.

    aws iotsitewise list-associated-assets \ --asset-id asset-id \ --hierarchy-id hierarchy-id

    For more information, see the ListAssociatedAssets operation.

  3. Run the following command to delete each associated asset and then to delete the asset. Replace asset-id with the ID or external ID of the asset.

    aws iotsitewise delete-asset --asset-id asset-id

Deleting asset models

You can use the Amazon IoT SiteWise console or API to delete an asset model.

Before you can delete an asset model, you must first delete all assets that were created from the asset model.

When you delete an asset model, its status is DELETING until the changes propagate. For more information, see Asset and model states. After the asset model is deleted, you can't query that asset model. If you do, the API returns an HTTP 404 response.

Deleting an asset model (console)

You can use the Amazon IoT SiteWise console to delete an asset model.

Topics
    To delete an asset model (console)
    1. Navigate to the Amazon IoT SiteWise console.

    2. In the navigation pane, choose Models.

    3. Choose the asset model to delete.

    4. If the model has any Assets, delete each asset. Choose an asset's name to navigate to its page, where you can delete it. For more information, see Deleting an asset (console).

    5. On the model's page, choose Delete.

    6. In the Delete model dialog box, do the following:

      1. Enter Delete to confirm deletion.

      2. Choose Delete.

    Deleting an asset model (Amazon CLI)

    You can use the Amazon Command Line Interface (Amazon CLI) to delete an asset model.

    Use the DeleteAssetModel operation to delete an asset model. Specify the following parameter:

    • assetModelId – The ID of the asset. This is the actual ID in UUID format, or the externalId:myExternalId if it has one. For more information, see Referencing objects with external IDs in the Amazon IoT SiteWise User Guide.

    To delete an asset model (Amazon CLI)
    1. Run the following command to list all assets created from the model. Replace asset-model-id with the ID or the external ID of the asset model.

      aws iotsitewise list-assets --asset-model-id asset-model-id

      For more information, see the ListAssets operation.

    2. If the previous command returns any assets from the model, delete each asset. For more information, see Deleting an asset (Amazon CLI).

    3. Run the following command to delete the asset model. Replace asset-model-id with the ID or external ID of the asset model.

      aws iotsitewise delete-asset-model --asset-model-id asset-model-id