Skip to content

GetAssetPropertyAggregates

Source: src/AWS/IoTSiteWise/GetAssetPropertyAggregates.ts

Runtime binding for iotsitewise:GetAssetPropertyAggregates — read pre-computed aggregates (AVERAGE, MINIMUM, MAXIMUM, SUM, COUNT, STANDARD_DEVIATION) of one property of the bound asset over a time range at a fixed resolution from a deployed Lambda or Task.

Provide the GetAssetPropertyAggregatesHttp implementation layer on the Function effect, bind the asset in the init phase, then call the returned client at runtime.

// init
const getAggregates = yield* AWS.IoTSiteWise.GetAssetPropertyAggregates(asset);
// runtime
const now = yield* Effect.sync(() => new Date());
const { aggregatedValues } = yield* getAggregates({
propertyId,
aggregateTypes: ["AVERAGE"],
resolution: "1h",
startDate: new Date(now.getTime() - 86_400_000),
endDate: now,
});
// on the Function effect:
// .pipe(Effect.provide(AWS.IoTSiteWise.GetAssetPropertyAggregatesHttp))