Class TelemetryHistoryService
Connects to a server to retrieve telemetry history.
Implements
Namespace: Unity.DigitalTwins.Live.Sdk.Services.Implementations
Assembly: solution.dll
Syntax
public sealed class TelemetryHistoryService : ITelemetryHistoryService, IDisposable
Constructors
TelemetryHistoryService(EnvironmentSettings, IServiceHttpClientWrapper, IMessagingClientWrapper, ISignalBus)
Creates an instance of DeviceService'TelemetryHistoryService'.
Declaration
public TelemetryHistoryService(EnvironmentSettings environmentSettings, IServiceHttpClientWrapper serviceHttpClientWrapper, IMessagingClientWrapper messagingClientWrapper, ISignalBus signalBus)
Parameters
Type | Name | Description |
---|---|---|
EnvironmentSettings | environmentSettings | The EnvironmentSettings instance. |
IServiceHttpClientWrapper | serviceHttpClientWrapper |
|
IMessagingClientWrapper | messagingClientWrapper |
|
ISignalBus | signalBus | The ISignalBus implementation. |
Methods
Dispose()
Clean-up code that releases resources.
Declaration
public void Dispose()
GetHistoryAsync(IEnumerable<String>, String, DateTimeOffset, DateTimeOffset, Int32)
Retrieves a list of TelemetryHistory objects asynchronously.
Declaration
public async Task<IEnumerable<TelemetryHistory>> GetHistoryAsync(IEnumerable<string> deviceIds, string telemetryKey, DateTimeOffset startTime, DateTimeOffset endTime, int stepResolutionInSeconds)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | deviceIds | The list of targeted device IDs. |
String | telemetryKey | The key value of the targeted telemetry. |
DateTimeOffset | startTime | The start time of the telemetry. |
DateTimeOffset | endTime | The end time of the telemetry. |
Int32 | stepResolutionInSeconds | The intervals between each telemetry in seconds. |
Returns
Type | Description |
---|---|
Task<IEnumerable<TelemetryHistory>> |
GetTelemetryHistoryAsync(IEnumerable<String>, String, DateTimeOffset, DateTimeOffset, Int32)
Retrieves a list of resources containing details for requested telemetry histories.
Declaration
public async Task<Optional<IEnumerable<DeviceTelemetriesResource>>> GetTelemetryHistoryAsync(IEnumerable<string> deviceIds, string telemetryKey, DateTimeOffset startTime, DateTimeOffset endTime, int stepResolutionInSeconds)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | deviceIds | The ID of the devices to query for telemetry history. |
String | telemetryKey | The ID for the type of telemetry you want to retrieve. |
DateTimeOffset | startTime | The earliest timestamp you want to include in the results. |
DateTimeOffset | endTime | The latest timestamp you want to include in the results. |
Int32 | stepResolutionInSeconds | How frequently you want to poll the telemetry history plot. |
Returns
Type | Description |
---|---|
Task<Optional<IEnumerable<DeviceTelemetriesResource>>> | Returns a list of objects containing device telemetries that fit the provided parameters if successful. |
SubscribeToDeviceTelemetriesAsync(IEnumerable<String>)
Subscribes to multiple device telemetries.
Declaration
public async Task SubscribeToDeviceTelemetriesAsync(IEnumerable<string> deviceIds)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | deviceIds | The list of targeted device IDs. |
Returns
Type | Description |
---|---|
Task |
UnsubscribeFromDeviceTelemetriesAsync(IEnumerable<String>)
Unsubscribes from multiple device telemetries.
Declaration
public async Task UnsubscribeFromDeviceTelemetriesAsync(IEnumerable<string> deviceIds)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | deviceIds | The list of targeted device IDs. |
Returns
Type | Description |
---|---|
Task |