From aa10e577bc882b2e7ea18c5c34831af176c40374 Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Tue, 13 Jul 2021 11:23:15 +0300 Subject: [PATCH] UI: add method to get latest telemetry to Attribute service --- ui-ngx/src/app/core/http/attribute.service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui-ngx/src/app/core/http/attribute.service.ts b/ui-ngx/src/app/core/http/attribute.service.ts index 9df035d8b4..1bed864ab1 100644 --- a/ui-ngx/src/app/core/http/attribute.service.ts +++ b/ui-ngx/src/app/core/http/attribute.service.ts @@ -135,4 +135,13 @@ export class AttributeService { return this.http.get(url, defaultHttpOptionsFromConfig(config)); } + + public getEntityTimeseriesLatest(entityId: EntityId, keys?: Array, + useStrictDataTypes = false, config?: RequestConfig): Observable { + let url = `/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/values/timeseries?useStrictDataTypes=${useStrictDataTypes}`; + if (isDefinedAndNotNull(keys) && keys.length) { + url += `&keys=${keys.join(',')}`; + } + return this.http.get(url, defaultHttpOptionsFromConfig(config)); + } }