Configuring the Amazon IoT SiteWise Publisher component - 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 (PDF).

Configuring the Amazon IoT SiteWise Publisher component

After you create an Amazon IoT SiteWise Edge gateway and install the software, set up the Publisher component so your SiteWise Edge gateway can export data to the Amazon Cloud. For more information, see Amazon IoT SiteWise Publisher in the Amazon IoT Greengrass Version 2 Developer Guide.

Console
  1. Navigate to the Amazon IoT SiteWise console.

  2. In the navigation pane, choose Edge gateways.

  3. Select the SiteWise Edge gateway for which you want to configure the publisher.

  4. In the Publisher configuration section, choose Edit

  5. For Publishing order, choose one of the following:

    • Publish oldest data first – The SiteWise Edge gateway publishes the oldest data to the cloud first by default.

    • Publish newest data first – The SiteWise Edge gateway publishes the newest data to the cloud first.

  6. (Optional) If you don't want the SiteWise Edge gateway to compress your data, unselect Activate compression when uploading data.

  7. (Optional) If you don't want to publish old data, choose Exclude expired data and do the following:

    1. For Cutoff period, enter a value and choose a unit. The cutoff period must be between five minutes and seven days. For example, if the cutoff period is three days, data that's older than three days isn't published to the cloud.

  8. (Optional) To set custom settings about how data is handled on your local device, choose Local storage settings and do the following:

    1. For Retention period, enter a number and choose a unit. The retention period must be between one minute and 30 days, and greater than or equal to the rotation period. For example, if the retention period is 14 days, the SiteWise Edge gateway deletes any data at the edge that's older than the specified cutoff period after it's stored for 14 days.

    2. For Rotation period, enter a number and choose a unit. The rotation period must be greater than one minute, and equal to, or less than, the retention period. For example, say the rotation period is two days, the SiteWise Edge gateway batches up and saves data that is older than the cutoff period to a single file. The SiteWise Edge gateway transfers a batch of data to the following local directory once every two days: /greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/exports.

    3. For Storage capacity, enter a value that is greater than or equal to 1. If the storage capacity is 2 GB, the SiteWise Edge gateway starts deleting data when more than 2 GB of data is stored locally.

  9. Choose Save.

Amazon CLI

You can use the UpdateGatewayCapabilityConfiguration API to configure the publisher. Set the capabilityNamespace parameter to iotsitewise:publisher:2.

The publisher provides the following configuration parameters that you can customize:

SiteWisePublisherConfiguration
publishingOrder

The order in which data is published to the cloud. The value of this parameter can be one of the following:

  • TIME_ORDER (Publish oldest data first) – The earliest data is published to the cloud first, by default.

  • RECENT_DATA (Publish newest data first) – The newest data is published to the cloud first.

dropPolicy

(Optional) A policy that controls what data is published to the cloud.

cutoffAge

Data that is earlier than the cutoff period isn't published to the cloud. The cutoff age must be between five minutes and seven days.

You can use m, h, and d when you specify a cutoff age. Note that m represents minutes, h represents hours, and d represents days.

exportPolicy

(Optional) A policy that manages data storage at the edge. This policy applies to data that is earlier than the cutoff age.

retentionPeriod

Your SiteWise Edge gateway deletes any data at the edge that is earlier than the cutoff period from the local storage after it's stored for the specified retention period. The retention period must be between one minute and 30 days, and greater than or equal to the rotation period.

You can use m, h, and d when you specify a retention period. Note that m represents minutes, h represents hours, and d represents days.

rotationPeriod

The time interval over which to batch up and save data that is earlier than the cutoff period to a single file. The SiteWise Edge gateway transfers one batch of data to the following local directory at the end of each rotation period: /greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/exports. The rotation period must be greater than one minute, and equal to or less than the retention period.

You can use m, h, and d when you specify a rotation period. Note that m represents minutes, h represents hours, and d represents days.

exportSizeLimitGB

The maximum allowed size of data stored locally, in GB. If this quota is breached, the SiteWise Edge gateway starts deleting the earliest data until the size of data stored locally is equal to or less than the quota. The value of this parameter must be greater than or equal to 1.

Example publisher configuration:

The publisher namespace: iotsitewise:publisher:2

{ "SiteWisePublisherConfiguration": { "publishingOrder": "TIME_ORDER", "dropPolicy": { "cutoffAge": "7d", "exportPolicy": { "retentionPeriod": "7d", "rotationPeriod": "6h", "exportLocation": "/greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/exports", "exportSizeLimitGB": 10 } } } }