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
-
Navigate to the Amazon IoT SiteWise console
. -
In the navigation pane, choose Edge gateways.
-
Select the SiteWise Edge gateway for which you want to configure the publisher.
-
In the Publisher configuration section, choose Edit
-
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.
-
-
(Optional) If you don't want the SiteWise Edge gateway to compress your data, unselect Activate compression when uploading data.
-
(Optional) If you don't want to publish old data, choose Exclude expired data and do the following:
-
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.
-
-
(Optional) To set custom settings about how data is handled on your local device, choose Local storage settings and do the following:
-
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.
-
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
. -
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.
-
-
Choose Save.
-
- Amazon CLI
You can use the UpdateGatewayCapabilityConfiguration API to configure the publisher. Set the
capabilityNamespace
parameter toiotsitewise: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
, andd
when you specify a cutoff age. Note thatm
represents minutes,h
represents hours, andd
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
, andd
when you specify a retention period. Note thatm
represents minutes,h
represents hours, andd
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
, andd
when you specify a rotation period. Note thatm
represents minutes,h
represents hours, andd
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 } } } }