aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
diff options
context:
space:
mode:
authorsai-neetha <sai-neetha.phulmali@highstreet-technologies.com>2023-03-20 08:05:47 +0100
committerhighstreetherbert <herbert.eiselt@highstreet-technologies.com>2023-03-29 19:06:25 +0200
commit15e2d3a29b0d1a304965e34f114a911e5a7abdb3 (patch)
tree711ef5616aceb115a1081cccd152eeae0e87bc79 /sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
parentac5e2dc8f1ee4d5549f7260374e8164d52b07f55 (diff)
Odlux Update
Add eslint and custom icons update Issue-ID: CCSDK-3871 Signed-off-by: sai-neetha <sai-neetha.phulmali@highstreet-technologies.com> Change-Id: If6b676128cc9cff0437a5dc54f85eaafd3b8c586 Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts')
-rw-r--r--sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts71
1 files changed, 35 insertions, 36 deletions
diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
index 70a8771b7..ef013f1cb 100644
--- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
+++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
@@ -15,13 +15,12 @@
* the License.
* ============LICENSE_END==========================================================================
*/
-import { requestRest } from '../../../../framework/src/services/restService';
import { Result } from '../../../../framework/src/models/elasticSearch';
+import { requestRest } from '../../../../framework/src/services/restService';
import { convertPropertyNames, replaceUpperCase } from '../../../../framework/src/utilities/yangHelper';
import { LtpIds } from '../models/availableLtps';
import { DeviceListType } from '../models/deviceListType';
-import { Topology, TopologyNode } from '../models/topologyNetconf';
/**
* Represents a web api accessor service for Network elements actions.
@@ -34,26 +33,26 @@ class PerformanceService {
public async getDistinctLtpsFromDatabase(networkElement: string, selectedTimePeriod: string): Promise<LtpIds[] | null> {
let path;
const query = {
- "filter": [{
- "property": "node-name",
- "filtervalue": networkElement
+ 'filter': [{
+ 'property': 'node-name',
+ 'filtervalue': networkElement,
}],
- "sortorder": [],
- "pagination": {
- "size": 20,
- "page": 1
- }
- }
+ 'sortorder': [],
+ 'pagination': {
+ 'size': 20,
+ 'page': 1,
+ },
+ };
- if (selectedTimePeriod === "15min") {
+ if (selectedTimePeriod === '15min') {
path = '/rests/operations/data-provider:read-pmdata-15m-ltp-list';
} else {
path = '/rests/operations/data-provider:read-pmdata-24h-ltp-list';
}
- const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) });
- return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ key: ne })) || null;
+ const result = await requestRest<Result<string>>(path, { method: 'POST', body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) });
+ return result && result['data-provider:output'] && result['data-provider:output'].data && result['data-provider:output'].data.map(ne => ({ key: ne })) || null;
}
@@ -64,19 +63,19 @@ class PerformanceService {
public async getDeviceListfromPerf15minHistory(): Promise<(DeviceListType)[] | null> {
const path = '/rests/operations/data-provider:read-pmdata-15m-device-list';
const query = {
- "data-provider:input": {
- "filter": [],
- "sortorder": [],
- "pagination": {
- "size": 20,
- "page": 1
- }
- }
+ 'data-provider:input': {
+ 'filter': [],
+ 'sortorder': [],
+ 'pagination': {
+ 'size': 20,
+ 'page': 1,
+ },
+ },
};
- const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(query) });
- return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({
- nodeId: ne
+ const result = await requestRest<Result<string>>(path, { method: 'POST', body: JSON.stringify(query) });
+ return result && result['data-provider:output'] && result['data-provider:output'].data && result['data-provider:output'].data.map(ne => ({
+ nodeId: ne,
})) || null;
}
@@ -86,19 +85,19 @@ class PerformanceService {
public async getDeviceListfromPerf24hHistory(): Promise<(DeviceListType)[] | null> {
const path = '/rests/operations/data-provider:read-pmdata-24h-device-list';
const query = {
- "data-provider:input": {
- "filter": [],
- "sortorder": [],
- "pagination": {
- "size": 20,
- "page": 1
- }
- }
+ 'data-provider:input': {
+ 'filter': [],
+ 'sortorder': [],
+ 'pagination': {
+ 'size': 20,
+ 'page': 1,
+ },
+ },
};
- const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(query) });
- return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({
- nodeId: ne
+ const result = await requestRest<Result<string>>(path, { method: 'POST', body: JSON.stringify(query) });
+ return result && result['data-provider:output'] && result['data-provider:output'].data && result['data-provider:output'].data.map(ne => ({
+ nodeId: ne,
})) || null;
}
}