Aggregates for an asset property (API)
You can use the Amazon IoT SiteWise API to get aggregates for an asset property.
Use the GetAssetPropertyAggregates operation to query aggregates of an asset property.
To identify an asset property, specify one of the following:
-
The
assetId
andpropertyId
of the asset property that data is sent to. -
The
propertyAlias
, which is a data stream alias (for example,/company/windfarm/3/turbine/7/temperature
). To use this option, you must first set your asset property's alias. To set property aliases, see Mapping industrial data streams to asset properties.
You must also pass the following required parameters:
-
aggregateTypes
– The list of aggregates to retrieve. You can specify any ofAVERAGE
,COUNT
,MAXIMUM
,MINIMUM
,STANDARD_DEVIATION
, andSUM
. -
resolution
– The time interval for which to retrieve the metric:1m
(1 minute),1h
(1 hour), or1d
(1 day). -
startDate
– The exclusive start of the range from which to query historical data, expressed in seconds in Unix epoch time. -
endDate
– The inclusive end of the range from which to query historical data, expressed in seconds in Unix epoch time.
You can also pass any of the following parameters to refine your results:
-
maxResults
– The maximum number of results to return in one request. Defaults to20
results. -
nextToken
– A pagination token returned from a previous call of this operation. -
timeOrdering
– The ordering to apply to the returned values:ASCENDING
orDESCENDING
. -
qualities
– The quality to filter results by:GOOD
,BAD
, orUNCERTAIN
.
Note
The GetAssetPropertyAggregates operation returns a TQV with a different format than other operations
described in this section. The value
structure contains a field for each of the
aggregateTypes
in the request. The timestamp
contains the time that the aggregation
occurred, in seconds in Unix epoch time.