From ae2f7c1ce61c12d5f9908fb91fd98f9df5df1f14 Mon Sep 17 00:00:00 2001 From: Michael Dürre Date: Wed, 8 Apr 2020 08:41:16 +0200 Subject: switched capability request source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit switched from data-provider to restconf Issue-ID: SDNC-1151 Signed-off-by: Michael Dürre Change-Id: I1d1c6d396100ccfb96a87cf02a1c1edd94c842a4 (cherry picked from commit 069d59228c389e25721a60cb993baab8f1cf636f) --- sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts') 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 { // const path = 'restconf/operational/network-topology:network-topology/topology/topology-netconf/node/' + nodeId; // const connectedNetworkElement = await requestRest(path, { method: "GET" }); -- cgit 1.2.3-korg