asset_property_aggregates
Creates, updates, deletes, gets or lists an asset_property_aggregates resource.
Overview
| Name | asset_property_aggregates |
| Type | Resource |
| Id | aws.iotsitewise.asset_property_aggregates |
Fields
The following fields are returned by SELECT queries:
- get_asset_property_aggregates
- batch_get_asset_property_aggregates
| Name | Datatype | Description |
|---|---|---|
quality | string | The quality of the aggregated data. (GOOD, BAD, UNCERTAIN) |
timestamp | string (date-time) | The date the aggregating computations occurred, in Unix epoch time. |
value | object | The value of the aggregates. |
| Name | Datatype | Description |
|---|---|---|
error_entries | array | A list of the errors (if any) associated with the batch request. Each error entry contains the entryId of the entry that failed. |
next_token | string | The token for the next set of results, or null if there are no additional results. (pattern: <code>[A-Za-z0-9+/=]+</code>) |
skipped_entries | array | A list of entries that were not processed by this batch request. because these entries had been completely processed by previous paginated requests. Each skipped entry contains the entryId of the entry that skipped. |
success_entries | array | A list of entries that were processed successfully by this batch request. Each success entry contains the entryId of the entry that succeeded and the latest query result. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_asset_property_aggregates | select | aggregateTypes, resolution, startDate, endDate, region | assetId, propertyId, propertyAlias, qualities, timeOrdering, nextToken, maxResults | Gets aggregated values for an asset property. For more information, see Querying aggregates in the IoT SiteWise User Guide. To identify an asset property, you must specify one of the following: The assetId and propertyId of an asset property. A propertyAlias, which is a data stream alias (for example, /company/windfarm/3/turbine/7/temperature). To define an asset property's alias, see UpdateAssetProperty. |
batch_get_asset_property_aggregates | select | region | Gets aggregated values (for example, average, minimum, and maximum) for one or more asset properties. For more information, see Querying aggregates in the IoT SiteWise User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
aggregateTypes | array | The data aggregating function. |
endDate | string (date-time) | The inclusive end of the range from which to query historical data, expressed in seconds in Unix epoch time. |
region | string | AWS region (default: us-east-1) |
resolution | string | The time interval over which to aggregate data. |
startDate | string (date-time) | The exclusive start of the range from which to query historical data, expressed in seconds in Unix epoch time. |
assetId | string | The ID of the asset, in UUID format. |
maxResults | integer | The maximum number of results to return for each paginated request. A result set is returned in the two cases, whichever occurs first. The size of the result set is equal to 1 MB. The number of data points in the result set is equal to the value of maxResults. The maximum value of maxResults is 2500. |
nextToken | string | The token to be used for the next set of paginated results. |
propertyAlias | string | The alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see Mapping industrial data streams to asset properties in the IoT SiteWise User Guide. |
propertyId | string | The ID of the asset property, in UUID format. |
qualities | array | The quality by which to filter asset data. |
timeOrdering | string | The chronological sorting order of the requested information. Default: ASCENDING |
SELECT examples
- get_asset_property_aggregates
- batch_get_asset_property_aggregates
Gets aggregated values for an asset property. For more information, see Querying aggregates in the IoT SiteWise User Guide. To identify an asset property, you must specify one of the following: The assetId and propertyId of an asset property. A propertyAlias, which is a data stream alias (for example, /company/windfarm/3/turbine/7/temperature). To define an asset property's alias, see UpdateAssetProperty.
SELECT
quality,
timestamp,
value
FROM aws.iotsitewise.asset_property_aggregates
WHERE aggregateTypes = '{{ aggregateTypes }}' -- required
AND resolution = '{{ resolution }}' -- required
AND startDate = '{{ startDate }}' -- required
AND endDate = '{{ endDate }}' -- required
AND region = '{{ region }}' -- required
AND assetId = '{{ assetId }}'
AND propertyId = '{{ propertyId }}'
AND propertyAlias = '{{ propertyAlias }}'
AND qualities = '{{ qualities }}'
AND timeOrdering = '{{ timeOrdering }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
Gets aggregated values (for example, average, minimum, and maximum) for one or more asset properties. For more information, see Querying aggregates in the IoT SiteWise User Guide.
SELECT
error_entries,
next_token,
skipped_entries,
success_entries
FROM aws.iotsitewise.asset_property_aggregates
WHERE region = '{{ region }}' -- required
;