Create a dataset with Amazon IoT SiteWise data (Amazon CLI) - Amazon IoT Analytics
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 (PDF).

Create a dataset with Amazon IoT SiteWise data (Amazon CLI)

Run the following Amazon CLI commands to get started querying your Amazon IoT SiteWise data.

The examples shown here use the Amazon Command Line Interface (Amazon CLI). For more information on the Amazon CLI, see the Amazon Command Line Interface User Guide. For more information about the CLI commands available for Amazon IoT Analytics, see iotanalytics in the Amazon Command Line Interface Reference.

To create a dataset
  1. Run the following create-dataset command to create a dataset.

    aws iotanalytics create-dataset --cli-input-json file://my_dataset.json

    Where the my_dataset.json file contains the following content.

    { "datasetName": "my_dataset", "actions": [ { "actionName":"my_action", "queryAction": { "sqlQuery": "SELECT * FROM my_iotsitewise_datastore.asset_metadata LIMIT 5" } } ] }

    For more information about supported SQL functionality in Amazon IoT Analytics, see SQL expressions in Amazon IoT Analytics. Or, see Tutorial: Query Amazon IoT SiteWise data in Amazon IoT Analytics for examples of statistical queries that can provide insight to your data.

  2. Run the following create-dataset-content command to create your dataset content by running your query.

    aws iotanalytics create-dataset-content --dataset-name my_dataset