diff options
author | 2020-08-12 14:57:21 +0000 | |
---|---|---|
committer | 2020-08-12 14:57:21 +0000 | |
commit | 057a0db19bacdd7d963cad39be1163139e7128e2 (patch) | |
tree | 09174e29404680aaf07784695f151224bdeedcda /sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts | |
parent | 55d8703366e8e02d97e71b2e1350cb746cee8ff6 (diff) | |
parent | 3d02271058d2e59a71e49afdd866462f7b6ab1c6 (diff) |
Merge "Switch odlux from Biermann-RestConf to RFC8040 interface"
Diffstat (limited to 'sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts b/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts index d3409e095..d1236d2e7 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts @@ -16,12 +16,12 @@ * ============LICENSE_END========================================================================== */ import { requestRest } from "../../../../framework/src/services/restService"; -import { Result, PostResponse } from "../../../../framework/src/models/elasticSearch"; +import { Result, SingeResult } from "../../../../framework/src/models/elasticSearch"; import { FaultType, Faults, DeletedStuckAlarms } from "../models/fault"; export const getFaultStateFromDatabase = async (): Promise<FaultType | null> => { - const path = 'restconf/operations/data-provider:read-status'; + const path = 'rests/operations/data-provider:read-status'; const result = await requestRest<Result<Faults>>(path, { method: "POST" }); let faultType: FaultType = { @@ -32,8 +32,8 @@ export const getFaultStateFromDatabase = async (): Promise<FaultType | null> => } let faults: Faults[] | null = null; - if (result && result.output && result.output.data) { - faults = result.output.data; + if (result && result["data-provider:output"] && result["data-provider:output"].data) { + faults = result["data-provider:output"].data; faultType = { Critical: faults[0].faults.criticals, Major: faults[0].faults.majors, @@ -46,8 +46,8 @@ export const getFaultStateFromDatabase = async (): Promise<FaultType | null> => } export const clearStuckAlarms = async (nodeNames: string[]) => { - const path = 'restconf/operations/devicemanager:clear-current-fault-by-nodename' - const result = await requestRest<DeletedStuckAlarms>(path, { method: 'Post', body: JSON.stringify({ input: { nodenames: nodeNames } }) }) + const path = 'rests/operations/devicemanager:clear-current-fault-by-nodename' + const result = await requestRest<SingeResult<DeletedStuckAlarms>>(path, { method: 'Post', body: JSON.stringify({ input: { nodenames: nodeNames } }) }) return result; }
\ No newline at end of file |