From 3d02271058d2e59a71e49afdd866462f7b6ab1c6 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Wed, 12 Aug 2020 12:28:06 +0200 Subject: Switch odlux from Biermann-RestConf to RFC8040 interface Switched rest-calls in odlux to use RFC8040 interface Issue-ID: CCSDK-2565 Signed-off-by: Aijana Schumann Change-Id: Ia59dd02bc6456bad648083146c0256f204e134d1 --- .../apps/connectApp/src/services/connectService.ts | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sdnr/wt/odlux/apps/connectApp/src') diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts index 41449e83f..2aa9e3958 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts @@ -33,9 +33,9 @@ class ConnectService { * Inserts a network elements. */ public async createNetworkElement(element: NetworkElementConnection): Promise { - const path = `/restconf/operations/data-provider:create-network-element-connection`; + const path = `/rests/operations/data-provider:create-network-element-connection`; const result = await requestRest(path, { - method: "POST", body: JSON.stringify(convertPropertyNames({ input: element }, replaceUpperCase)) + method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": element }, replaceUpperCase)) }); return result || null; } @@ -44,9 +44,9 @@ class ConnectService { * Updates a network element. */ public async updateNetworkElement(element: UpdateNetworkElement): Promise { - const path = `/restconf/operations/data-provider:update-network-element-connection`; + const path = `/rests/operations/data-provider:update-network-element-connection`; const result = await requestRest(path, { - method: "POST", body: JSON.stringify(convertPropertyNames({ input: element }, replaceUpperCase)) + method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": element }, replaceUpperCase)) }); return result || null; } @@ -58,16 +58,16 @@ class ConnectService { const query = { "id": element.id }; - const path = `/restconf/operations/data-provider:delete-network-element-connection`; + const path = `/rests/operations/data-provider:delete-network-element-connection`; const result = await requestRest(path, { - method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) + method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": query }, replaceUpperCase)) }); return result || null; } /** Mounts network element. */ public async mountNetworkElement(networkElement: NetworkElementConnection): Promise { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + networkElement.nodeId; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + networkElement.nodeId; const mountXml = [ '', `${networkElement.nodeId}`, @@ -106,7 +106,7 @@ class ConnectService { /** Unmounts a network element by its id. */ public async unmountNetworkElement(nodeId: string): Promise { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + nodeId; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + nodeId; try { const result = await requestRest(path, { @@ -126,7 +126,7 @@ class ConnectService { /** Yang capabilities of the selected network elements. */ public async infoNetworkElement(nodeId: string): Promise { - const path = 'restconf/operational/network-topology:network-topology/topology/topology-netconf/node/' + nodeId; + const path = '/rests/operational/network-topology:network-topology/topology=topology-netconf/node=' + nodeId; const topologyRequestPomise = requestRest(path, { method: "GET" }); return topologyRequestPomise && topologyRequestPomise.then(result => { @@ -138,9 +138,9 @@ class ConnectService { * Get the connection state of the network element. */ public async getNetworkElementConnectionStatus(element: string): Promise<(ConnectionStatus)[] | null> { - const path = `/restconf/operations/data-provider:read-network-element-connection-list`; + const path = `/rests/operations/data-provider:read-network-element-connection-list`; const query = { - "input": { + "data-provider:input": { "filter": [{ "property": "node-id", "filtervalue": element @@ -152,13 +152,13 @@ class ConnectService { } } const result = await requestRest>(path, { method: "POST", body: JSON.stringify(query) }); - return result && result.output && result.output.data && result.output.data.map(ne => ({ + return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ status: ne.status })) || null; } public async getWebUriExtensionForNetworkElementAsync(ne: string) { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + ne + '/yang-ext:mount/core-model:network-element'; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + ne + '/yang-ext:mount/core-model:network-element'; try { const result = await requestRest(path, { method: "GET" }); @@ -182,7 +182,7 @@ class ConnectService { let webUris: guiCutThrough[] = [] ne.forEach(nodeId => { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + nodeId + '/yang-ext:mount/core-model:network-element'; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + nodeId + '/yang-ext:mount/core-model:network-element'; // add search request to array promises.push(requestRest(path, { method: "GET" }) -- cgit 1.2.3-korg