Delete asset models, component models, and interfaces in Amazon IoT SiteWise
You can use the Amazon IoT SiteWise console or API to delete an asset model, component model, or interface.
Before you can delete an asset model, you must first delete all assets that were created from the asset model. Before you can delete an interface, you must first unlink it from all asset models that implement it.
When you delete an asset model or interface, its status is DELETING
until the changes
propagate. For more information, see Asset and model states. After the asset model or interface is deleted, you can't query that
asset model or interface. If you do, the API returns an HTTP 404 response.
Topics
Delete an asset model, component model, or interface (console)
You can use the Amazon IoT SiteWise console to delete an asset model, component model, or interface.
Topics
To delete an asset model, component model, or interface (console)
Navigate to the Amazon IoT SiteWise console
. In the navigation pane, choose Models.
-
Choose the asset model, component model, or interface to delete.
-
If deleting an asset model and it 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 Delete an asset (console).
-
On the model's page, choose Delete.
-
In the Delete model dialog box, do the following:
-
Enter
Delete
to confirm deletion. -
Choose Delete.
-
Delete an asset model, component model, or interface (Amazon CLI)
You can use the Amazon Command Line Interface (Amazon CLI) to delete an asset model, component model, or interface.
Use the DeleteAssetModel operation to delete an asset model, component model, or interface. Specify the following parameter:
-
assetModelId
– The ID of the asset. This is the actual ID in UUID format, or theexternalId:myExternalId
if it has one. For more information, see Reference objects with external IDs in the Amazon IoT SiteWise User Guide.
To delete an asset model (Amazon CLI)
-
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.
-
If the previous command returns any assets from the model, delete each asset. For more information, see Delete an asset (Amazon CLI).
-
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
Important
To avoid deleting an asset model that was concurrently updated since the last read operation, you must define a conditional delete request. See Optimistic locking for asset model writes.