GetInterpolatedAssetPropertyValues - AWS IoT SiteWise

GetInterpolatedAssetPropertyValues

Get interpolated values for an asset property for a specified time interval, during a period of time. For example, you can use the this operation to return the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days.

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.

Request Syntax

GET /properties/interpolated?assetId=assetId&endTimeInSeconds=endTimeInSeconds&endTimeOffsetInNanos=endTimeOffsetInNanos&intervalInSeconds=intervalInSeconds&maxResults=maxResults&nextToken=nextToken&propertyAlias=propertyAlias&propertyId=propertyId&quality=quality&startTimeInSeconds=startTimeInSeconds&startTimeOffsetInNanos=startTimeOffsetInNanos&type=type HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

assetId

The ID of the asset.

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

endTimeInSeconds

The inclusive end of the range from which to interpolate data, expressed in seconds in Unix epoch time.

Valid Range: Minimum value of 1. Maximum value of 31556889864403199.

Required: Yes

endTimeOffsetInNanos

The nanosecond offset converted from endTimeInSeconds.

Valid Range: Minimum value of 0. Maximum value of 999999999.

intervalInSeconds

The time interval in seconds over which to interpolate data. Each interval starts when the previous one ends.

Valid Range: Minimum value of 1. Maximum value of 320000000.

Required: Yes

maxResults

The maximum number of results to return for each paginated request. If not specified, the default value is 10.

Valid Range: Minimum value of 1.

nextToken

The token to be used for the next set of paginated results.

Length Constraints: Minimum length of 1. Maximum length of 4096.

Pattern: [A-Za-z0-9+/=]+

propertyAlias

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 AWS IoT SiteWise User Guide.

Length Constraints: Minimum length of 1. Maximum length of 1000.

Pattern: [^\u0000-\u001F\u007F]+

propertyId

The ID of the asset property.

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

quality

The quality of the asset property value. You can use this parameter as a filter to choose only the asset property values that have a specific quality.

Valid Values: GOOD | BAD | UNCERTAIN

Required: Yes

startTimeInSeconds

The exclusive start of the range from which to interpolate data, expressed in seconds in Unix epoch time.

Valid Range: Minimum value of 1. Maximum value of 31556889864403199.

Required: Yes

startTimeOffsetInNanos

The nanosecond offset converted from startTimeInSeconds.

Valid Range: Minimum value of 0. Maximum value of 999999999.

type

The interpolation type.

Valid values: LINEAR_INTERPOLATION

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "interpolatedAssetPropertyValues": [ { "timestamp": { "offsetInNanos": number, "timeInSeconds": number }, "value": { "booleanValue": boolean, "doubleValue": number, "integerValue": number, "stringValue": "string" } } ], "nextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

interpolatedAssetPropertyValues

The requested interpolated values.

Type: Array of InterpolatedAssetPropertyValue objects

nextToken

The token for the next set of results, or null if there are no additional results.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 4096.

Pattern: [A-Za-z0-9+/=]+

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalFailureException

AWS IoT SiteWise can't process your request right now. Try again later.

HTTP Status Code: 500

InvalidRequestException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.

HTTP Status Code: 400

ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404

ServiceUnavailableException

The requested service is unavailable.

HTTP Status Code: 503

ThrottlingException

Your request exceeded a rate limit. For example, you might have exceeded the number of AWS IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.

For more information, see Quotas in the AWS IoT SiteWise User Guide.

HTTP Status Code: 429

Examples

Example

The following example uses the AWS Command Line Interface (AWS CLI) to retrieve the interpolated temperature values for a wind turbine every 24 hours between April 26, 2021 at midnight and May 3, 2021 at midnight in Pacific Time (PT).

Note
  • Replace <asset-ID> and <property-ID> with your asset ID and property ID.

  • The --start-time-offset-in-nanos and --end-time-offset-in-nanos parameters are optional. You can use these parameters to specify the nanosecond offsets for startTimeInSeconds and startTimeInSeconds.

Sample Request

aws iotsitewise --asset-id <asset-ID> --property-id <property-ID>--start-time-in-seconds 1619420400 --start-time-offset-in-nanos 0 --end-time-in-seconds 1620025200 --end-time-offset-in-nanos 0 --end-time-offset-in-nanos 1 --quality GOOD --interval-in-seconds 3600 --type LINEAR_INTERPOLATION

Sample Response

{ "interpolatedAssetPropertyValues": [ { "timestamp": { "timeInSeconds": 1619420400, "offsetInNanos": 0 }, "value": { "doubleValue": 30.0 } }, { "timestamp": { "timeInSeconds": 1619424000, "offsetInNanos": 0 }, "value": { "doubleValue": 41.25 } }, { "timestamp": { "timeInSeconds": 1619427600, "offsetInNanos": 0 }, "value": { "doubleValue": 35.85 } }, ... ], ... }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: