Use data sources - AWS IoT SiteWise

Use data sources

Manage your data streams using the AWS IoT SiteWise console or AWS CLI.

Console

Use the AWS IoT SiteWise console to manage your data streams.

To manage data streams (console)
  1. Navigate to the AWS IoT SiteWise console.

  2. In the navigation pane, choose Data streams.

  3. (Optional) To add or update tags, select the data stream to edit, then choose Manage tags.

    On the Edit tags page, choose Add tag. In the Key field, type the name of the tag to use.

    Choose Save.

  4. (Optional) In the Data stream table, you can filter data streams in the following ways.

    • In the first dropdown menu, select Alias prefix or Asset ID.

      • Alias prefix – The alias prefix of the data stream. You might choose this option if your target data streams have an alias prefix.

      • Asset ID – The ID of the asset in which the asset property was created. You might choose this option if your target data streams are associated with an asset property.

    • In the second dropdown menu, select All data streams, Associated data streams, or Disassociated data streams.

      • All data streams – Data streams that are associated with or not associated with an asset property.

      • Associated data streams – Data streams that are associated with an asset property.

      • Disassociated data streams – Data streams that aren't associated with an asset property.

  5. Select the data streams that you're managing. AWS IoT SiteWise displays the data streams that you chose in a graph at the bottom of the page. If you select more than 10, the graph will display only the first 10.

  6. (Optional) Configure the graph in the following ways.

    1. For Aggregation function, select one of the following.

      • Data point count – The total number of data points for the given variables over the current time interval.

      • Average – The mean of the given variables' values over the current time interval.

      • Sum – The sum of the given variables' values over the current time interval.

      • Minimum – The minimum of the given variables' values over the current time interval.

      • Maximum – The maximum of the given variables' values over the current time interval.

      For more information, see Use aggregation functions in formula expressions.

    2. For Time ranges, select one of the following.

      • Last 1 hour – The graph displays aggregated data over the last hour.

      • Last 2 hours – The graph displays aggregated data over the last two hours.

      • Last 3 hours – The graph displays aggregated data over the last three hours.

      • Last 4 hours – The graph displays aggregated data over the last four hours.

    3. For Time interval, select one of the following.

      • 1 minute – Aggregates data every minute over the specified time range.

      • 1 hour – Aggregates data every hour over the specified time range.

  7. Choose Manage data streams.

  8. In the Update data stream associations section, in the Measurement name column, do one of the following.

    • If the data stream is associated with a measurement, delete the association by choosing the close icon.

    • If the data stream isn't associated with a measurement, choose Choose measurement.

  9. In the Choose a measurement table, navigate to the target asset, and then choose the measurement that you're associating.

  10. (Optional) In the Update asset property aliases section, enter a unique alias for each measurement.

  11. Choose Update.

The Status column can display one of the following values.

  • Pending – You're updating the data stream association or asset property alias.

  • Submit – Your change to the association or asset property alias is saved.

  • Error – AWS IoT SiteWise couldn't process your request to update the data stream association or the alias for the measurement.

  • Success – You successfully updated the data stream association or the alias for the measurement.

AWS CLI

Use the following API operations to manage your data streams. The code examples use the AWS CLI.

AssociateTimeSeriesToAssetProperty

To associate a data stream with an asset property, run the following command.

Important

The specified asset property must not be currently associated with any data stream.

  • Replace data-stream-alias with the alias of the data stream that you're associating.

  • Replace asset-ID with the ID of the asset in which the asset property was created.

  • Replace property-ID with the ID of the asset property.

aws iotsitewise associate-time-series-to-asset-property \ --alias data-stream-alias \ --assetId asset-ID \ --propertyId property-ID

DisassociateTimeSeriesFromAssetProperty

To disassociate a data stream from an asset property, run the following command.

  • Replace data-stream-alias with the alias of the data stream that you're disassociating.

  • Replace asset-ID with the ID of the asset in which the asset property was created.

  • Replace property-ID with the ID of the asset property.

aws iotsitewise disassociate-time-series-from-asset-property \ --alias data-stream-alias \ --assetId asset-ID \ --propertyId property-ID

DeleteTimeSeries

To delete a data stream, run the following command.

Replace data-stream-alias with the alias of the data stream that you're deleting.

aws iotsitewise delete-time-series --alias data-stream-alias

To identify a data stream, do one of the following:

  • If the data stream isn't associated with an asset property, specify the alias of the data stream.

  • If the data stream is associated with an asset property, specify one of the following:

    • The alias of the data stream.

    • The assetId and propertyId that identifies the asset property.

DescribeTimeSeries

Use the DescribeTimeSeries API operation to verify if you successfully associated or disassociated a data stream.

To retrieve information about a data stream, run the following command.

aws iotsitewise describe-time-series --alias data-stream-alias

To identify a data stream, do one of the following:

  • If the data stream isn't associated with an asset property, specify the alias of the data stream.

  • If the data stream is associated with an asset property, specify one of the following:

    • The alias of the data stream.

    • The assetId and propertyId that identifies the asset property.

ListTimeSeries

Use the ListTimeSeries API operation to verify if you successfully deleted a data stream.

To retrieve a paginated list of data streams, run the following command.

aws iotsitewise list-time-series