Managing data streams (Amazon CLI) - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Managing data streams (Amazon CLI)

You can use the following API operations to manage your data streams. The code examples use the Amazon 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

You can 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

You can 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