Skip to content

GetAssetPropertyValueHistory

Source: src/AWS/IoTSiteWise/GetAssetPropertyValueHistory.ts

Runtime binding for iotsitewise:GetAssetPropertyValueHistory — read the historical timestamp-quality-values of one property of the bound asset over a time range from a deployed Lambda or Task.

Provide the GetAssetPropertyValueHistoryHttp implementation layer on the Function effect, bind the asset in the init phase, then call the returned client at runtime. Page through large ranges with nextToken.

// init
const getHistory = yield* AWS.IoTSiteWise.GetAssetPropertyValueHistory(asset);
// runtime
const now = yield* Effect.sync(() => new Date());
const { assetPropertyValueHistory } = yield* getHistory({
propertyId,
startDate: new Date(now.getTime() - 3_600_000),
endDate: now,
timeOrdering: "DESCENDING",
});
// on the Function effect:
// .pipe(Effect.provide(AWS.IoTSiteWise.GetAssetPropertyValueHistoryHttp))