summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-08-12 12:28:06 +0200
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-08-12 12:29:48 +0200
commit3d02271058d2e59a71e49afdd866462f7b6ab1c6 (patch)
treebb42b3428055136a4a8f5def9c63e412390d40ef /sdnr/wt/odlux/apps/connectApp
parentcd29d2dd98b7c40bd4efb6a8705787ca35e99fe9 (diff)
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 <aijana.schumann@highstreet-technologies.com> Change-Id: Ia59dd02bc6456bad648083146c0256f204e134d1
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp')
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts28
-rw-r--r--sdnr/wt/odlux/apps/connectApp/webpack.config.js14
2 files changed, 23 insertions, 19 deletions
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<NetworkElementConnection | null> {
- const path = `/restconf/operations/data-provider:create-network-element-connection`;
+ const path = `/rests/operations/data-provider:create-network-element-connection`;
const result = await requestRest<NetworkElementConnection>(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<NetworkElementConnection | null> {
- const path = `/restconf/operations/data-provider:update-network-element-connection`;
+ const path = `/rests/operations/data-provider:update-network-element-connection`;
const result = await requestRest<NetworkElementConnection>(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<NetworkElementConnection>(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<boolean> {
- 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 = [
'<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">',
`<node-id>${networkElement.nodeId}</node-id>`,
@@ -106,7 +106,7 @@ class ConnectService {
/** Unmounts a network element by its id. */
public async unmountNetworkElement(nodeId: string): Promise<boolean> {
- 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<string>(path, {
@@ -126,7 +126,7 @@ class ConnectService {
/** Yang capabilities of the selected network elements. */
public async infoNetworkElement(nodeId: string): Promise<TopologyNode | null> {
- 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<Topology>(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<Result<ConnectionStatus>>(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<any>(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<any>(path, { method: "GET" })
diff --git a/sdnr/wt/odlux/apps/connectApp/webpack.config.js b/sdnr/wt/odlux/apps/connectApp/webpack.config.js
index b72f5da76..7b0a51714 100644
--- a/sdnr/wt/odlux/apps/connectApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/connectApp/webpack.config.js
@@ -126,23 +126,27 @@ module.exports = (env) => {
},
proxy: {
"/oauth2/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/database/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/restconf/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
+ secure: false
+ },
+ "/rests/": {
+ target: "http://10.20.6.29:48181",
secure: false
},
"/help/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/websocket": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
ws: true,
changeOrigin: true,
secure: false