diff options
author | 2020-04-08 19:16:45 +0000 | |
---|---|---|
committer | 2020-04-08 19:16:45 +0000 | |
commit | e8f2d78e408d56fe8efe96ad5958256502d6e5b0 (patch) | |
tree | 7e0b2eeab764597062ad5090c40534cf0548ae7b /sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts | |
parent | 3d6132e97fa3e37b5161d7cb6fdf00fc3d4f221f (diff) | |
parent | ae2f7c1ce61c12d5f9908fb91fd98f9df5df1f14 (diff) |
Merge "switched capability request source" into frankfurt
Diffstat (limited to 'sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts b/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts index d0ed03a8d..0d28e6653 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts @@ -22,6 +22,13 @@ import { convertPropertyNames, replaceHyphen } from "../../../../framework/src/u import { NetworkElementConnection } from "../models/networkElementConnection"; class RestService { + public async getCapabilitiesByMoutId(nodeId: string): Promise<{ "capabilityOrigin": string, "capability": string }[] | null> { + const path = `/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/${nodeId}`; + const capabilitiesResult = await requestRest<{ node: { "node-id": string, "netconf-node-topology:available-capabilities": { "available-capability": { "capabilityOrigin": string, "capability": string }[] }}[] }>(path, { method: "GET" }); + return capabilitiesResult && capabilitiesResult.node && capabilitiesResult.node.length > 0 && + capabilitiesResult.node[0]["netconf-node-topology:available-capabilities"]["available-capability"].map(obj => convertPropertyNames(obj, replaceHyphen)) || null; + } + public async getMountedNetworkElementByMountId(nodeId: string): Promise<NetworkElementConnection | null> { // const path = 'restconf/operational/network-topology:network-topology/topology/topology-netconf/node/' + nodeId; // const connectedNetworkElement = await requestRest<NetworkElementConnection>(path, { method: "GET" }); |