Browse Source

Merge pull request #4896 from ChantsovaEkaterina/improvement/attribute-service-get-latest-timeseries

UI: add method to get latest telemetry to Attribute service
pull/4901/head
Igor Kulikov 5 years ago
committed by GitHub
parent
commit
c8158621ee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ui-ngx/src/app/core/http/attribute.service.ts

9
ui-ngx/src/app/core/http/attribute.service.ts

@ -135,4 +135,13 @@ export class AttributeService {
return this.http.get<TimeseriesData>(url, defaultHttpOptionsFromConfig(config));
}
public getEntityTimeseriesLatest(entityId: EntityId, keys?: Array<string>,
useStrictDataTypes = false, config?: RequestConfig): Observable<TimeseriesData> {
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<TimeseriesData>(url, defaultHttpOptionsFromConfig(config));
}
}

Loading…
Cancel
Save