deleteTimeSeries method
Deletes a time series (data stream). If you delete a time series that's associated with an asset property, the asset property still exists, but the time series will no longer be associated with this asset property.
To identify a time series, do one of the following:
-
If the time series isn't associated with an asset property, specify the
aliasof the time series. -
If the time series is associated with an asset property, specify one of
the following:
-
The
aliasof the time series. -
The
assetIdandpropertyIdthat identifies the asset property.
-
The
May throw ConflictingOperationException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter alias :
The alias that identifies the time series.
Parameter assetId :
The ID of the asset in which the asset property was created. This can be
either the actual ID in UUID format, or else externalId:
followed by the external ID, if it has one. For more information, see Referencing
objects with external IDs in the IoT SiteWise User Guide.
Parameter clientToken :
A unique case-sensitive identifier that you can provide to ensure the
idempotency of the request. Don't reuse this client token if a new
idempotent request is required.
Parameter propertyId :
The ID of the asset property. This can be either the actual ID in UUID
format, or else externalId: followed by the external ID, if
it has one. For more information, see Referencing
objects with external IDs in the IoT SiteWise User Guide.
Implementation
Future<void> deleteTimeSeries({
String? alias,
String? assetId,
String? clientToken,
String? propertyId,
}) async {
final $query = <String, List<String>>{
if (alias != null) 'alias': [alias],
if (assetId != null) 'assetId': [assetId],
if (propertyId != null) 'propertyId': [propertyId],
};
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/timeseries/delete',
queryParams: $query,
hostPrefix: 'api.',
exceptionFnMap: _exceptionFns,
);
}