getAssetPropertyValue method
Gets an asset property's current value. For more information, see Querying current values in the IoT SiteWise User Guide.
To identify an asset property, you must specify one of the following:
-
The
assetIdandpropertyIdof 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.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
Parameter assetId :
The ID of the asset, in UUID format.
Parameter 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 IoT SiteWise
User Guide.
Parameter propertyId :
The ID of the asset property, in UUID format.
Implementation
Future<GetAssetPropertyValueResponse> getAssetPropertyValue({
String? assetId,
String? propertyAlias,
String? propertyId,
}) async {
final $query = <String, List<String>>{
if (assetId != null) 'assetId': [assetId],
if (propertyAlias != null) 'propertyAlias': [propertyAlias],
if (propertyId != null) 'propertyId': [propertyId],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/properties/latest',
queryParams: $query,
hostPrefix: 'data.',
exceptionFnMap: _exceptionFns,
);
return GetAssetPropertyValueResponse.fromJson(response);
}