

# Asset and model states
<a name="asset-and-model-states"></a>

When you create, update, or delete an asset, an asset model, or a component model, the changes take time to propagate. AWS IoT SiteWise resolves these operations asynchronously and updates the status of each resource. Each asset, asset model, and component model has a status field that contains the state of the resource and any error message, if applicable. The state can be one of the following values:
+ `ACTIVE` – The resource is active. This is the only state in which you can query and interact with assets, asset models, and component models.
+ `CREATING` – The resource is being created.
+ `UPDATING` – The resource is being updated.
+ `DELETING` – The resource is being deleted.
+ `PROPAGATING` – (Asset models and component models only) The changes are propagating to all dependent resources (from asset model to assets, or from component model to asset models).
+ `FAILED` – The resource failed to validate during a create or update operation, possibly due to a circular reference in an expression. You can delete resources that are in the `FAILED` state.

Some of the create, update, and delete operations in AWS IoT SiteWise place an asset, asset model, or component model in a state other than `ACTIVE` while the operation resolves. To query or interact with a resource after you perform one of these operations, you must wait until the state changes to `ACTIVE`. Otherwise, your requests fail.

**Topics**
+ [Check the status of an asset](check-asset-status.md)
+ [Check the status of an asset or component model](check-model-status.md)

# Check the status of an asset
<a name="check-asset-status"></a>

You can use the AWS IoT SiteWise console or API to check the status of an asset.

**Topics**
+ [Check the status of an asset (console)](#check-asset-status-console)
+ [Check the status of an asset (AWS CLI)](#check-asset-status-cli)

## Check the status of an asset (console)
<a name="check-asset-status-console"></a>

Use the following procedure to check the status of an asset in the AWS IoT SiteWise console.

**To check the status of an asset (console)**

1. <a name="sitewise-open-console"></a>Navigate to the [AWS IoT SiteWise console](https://console.aws.amazon.com/iotsitewise/).

1. <a name="sitewise-choose-assets"></a>In the navigation pane, choose **Assets**.

1. Choose the asset to check.
**Tip**  <a name="sitewise-expand-asset-hierarchy"></a>
You can choose the arrow icon to expand an asset hierarchy to find your asset.

1. Find **Status** in the **Asset details** panel.  
![\[AWS IoT SiteWise Asset details panel with Status as Active.\]](http://docs.aws.amazon.com/iot-sitewise/latest/userguide/images/sitewise-view-asset-status-console.png)

## Check the status of an asset (AWS CLI)
<a name="check-asset-status-cli"></a>

You can use the AWS Command Line Interface (AWS CLI) to check the status of an asset.

To check the status of an asset, use the [DescribeAsset](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAsset.html) operation with the `assetId` parameter.

**To check the status of an asset (AWS CLI)**
+ Run the following command to describe the asset. Replace *asset-id* with the asset's ID or external ID. The external ID is a user-defined ID. For more information, see [Reference objects with external IDs](object-ids.md#external-id-references) in the *AWS IoT SiteWise User Guide*.

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

  The operation returns a response that contains the asset's details. The response contains an `assetStatus` object that has the following structure:

  ```
  {
      ...
      "assetStatus": {
        "state": "String",
        "error": {
           "code": "String",
           "message": "String"
        }
      }
    }
  ```

  The asset's state is in `assetStatus.state` in the JSON object.

# Check the status of an asset or component model
<a name="check-model-status"></a>

You can use the AWS IoT SiteWise console or API to check the status of an asset model or component model.

**Topics**
+ [Check the status of an asset model or component model (console)](#check-model-status-console)
+ [Check the status of an asset model or component model (AWS CLI)](#check-model-status-cli)

## Check the status of an asset model or component model (console)
<a name="check-model-status-console"></a>

Use the following procedure to check the status of an asset model or component model in the AWS IoT SiteWise console.

**Tip**  
Asset models and component models are both listed under **Models** in the navigation pane. The **Details** panel of the selected asset model or component model indicates which type it is.

**To check the status of an asset model or component model (console)**

1. <a name="sitewise-open-console"></a>Navigate to the [AWS IoT SiteWise console](https://console.aws.amazon.com/iotsitewise/).

1. <a name="sitewise-choose-models"></a>In the navigation pane, choose **Models**.

1. Choose the model to check.

1. Find **Status** in the **Details** panel.  
![\[AWS IoT SiteWise "Asset model" page screenshot with asset model status highlighted.\]](http://docs.aws.amazon.com/iot-sitewise/latest/userguide/images/sitewise-view-model-status-console.png)

## Check the status of an asset model or component model (AWS CLI)
<a name="check-model-status-cli"></a>

You can use the AWS CLI to check the status of an asset model or component model.

To check the status of an asset model or component model, use the [DescribeAssetModel](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html) operation with the `assetModelId` parameter.

**Tip**  
The AWS CLI defines component models as a type of asset model. Therefore, you use the same [DescribeAssetModel](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html) operation for both types of model. The `assetModelType` field in the response indicates whether it's an `ASSET_MODEL` or a `COMPONENT_MODEL`. 

**To check the status of an asset model or component model (AWS CLI)**
+ Run the following command to describe the model. Replace *asset-model-id* with the ID or the external ID of the asset model or component model. The external ID is a user-defined ID. For more information, see [Reference objects with external IDs](object-ids.md#external-id-references) in the *AWS IoT SiteWise User Guide*.

  ```
  aws iotsitewise describe-asset-model --asset-model-id asset-model-id
  ```

  The operation returns a response that contains the model's details. The response contains an `assetModelStatus` object that has the following structure.

  ```
  {
      ...
      "assetModelStatus": {
        "state": "String",
        "error": {
           "code": "String",
           "message": "String"
        }
      }
    }
  ```

  The model's state is in `assetModelStatus.state` in the JSON object.