Deleting assets and models - AWS IoT SiteWise

Deleting assets and models

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

Deleting assets

You can use the AWS 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 AWS 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

AWS IoT SiteWise deletes all property data for deleted assets.

Deleting an asset (console)

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

To delete an asset (console)

  1. Navigate to the AWS 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.

    
        AWS IoT SiteWise "Assets" page screenshot with an asset hierarchy
          highlighted.
  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.

    
                AWS IoT SiteWise "Asset" page screenshot with "Associated assets"
                  highlighted.
  5. On the asset's page, choose Delete.

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

    1. Enter Delete to confirm deletion.

    2. Choose Delete.

      
                    AWS IoT SiteWise "Asset" page screenshot with "Delete" highlighted in the delete
                      confirmation dialog.

Deleting an asset (CLI)

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

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

  • assetId – The asset's ID.

To delete an asset (CLI)

  1. Run the following command to list the asset's hierarchies. Replace asset-id with the 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 of the asset and hierarchy-id with the 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 of the asset.

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

Deleting asset models

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

Before you can delete an asset model, you must first delete all assets 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 AWS IoT SiteWise console to delete an asset model.

Topics

    To delete an asset model (console)

    1. Navigate to the AWS 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).

      
                AWS IoT SiteWise "Model" page screenshot with "Assets" highlighted.
    5. On the model's page, choose Delete.

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

      1. Enter Delete to confirm deletion.

      2. Choose Delete.

        
                    AWS IoT SiteWise "Model" page screenshot with "Delete" highlighted in the delete
                      confirmation dialog.

    Deleting an asset model (CLI)

    You can use the AWS CLI to delete an asset model.

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

    • assetModelId – The asset model's ID.

    To delete an asset model (CLI)

    1. Run the following command to list all assets created from the model. Replace asset-model-id with the 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 (CLI).

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

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