Delete asset models in AWS IoT SiteWise
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 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.
Delete an asset model (console)
You can use the AWS IoT SiteWise console to delete an asset model.
Topics
To delete an asset model (console)
Navigate to the AWS IoT SiteWise console
. In the navigation pane, choose Models.
-
Choose the asset model to delete.
-
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 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 (AWS CLI)
You can use the AWS Command Line Interface (AWS 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 theexternalId:myExternalId
if it has one. For more information, see Reference objects with external IDs in the AWS IoT SiteWise User Guide.
To delete an asset model (AWS 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 (AWS 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.