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
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts
index dbe95e0..1db66c0 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts
+++ b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts
@@ -89,7 +89,8 @@
const getReferencedDataList = async (refPath: string, dataPath: string, modules: { [name: string]: Module }, views: ViewSpecification[]) => {
const pathParts = splitVPath(refPath, /(?:(?:([^\/\:]+):)?([^\/]+))/g); // 1 = opt: namespace / 2 = property
- let referencedModule = modules[pathParts[0][0]];
+ const defaultNS = pathParts[0][0];
+ let referencedModule = modules[defaultNS];
let dataMember: string;
let view: ViewSpecification;
@@ -121,14 +122,17 @@
throw new Error(`Server Error. Status: [${restResult.status}]\n${message || restResult.message || ''}`);
}
- let dataRaw = restResult.data[dataMember!];
+ let dataRaw = restResult.data[`${defaultNS}:${dataMember!}`];
+ if (dataRaw === undefined) {
+ dataRaw = restResult.data[dataMember!];
+ }
dataRaw = dataRaw instanceof Array
? dataRaw[0]
: dataRaw;
data = dataRaw && dataRaw[viewElement.label] || [];
const keys: string[] = data.map((entry: { [key: string]: any } )=> entry[viewElement.key!]);
- resultingDataUrls.push(...keys.map(key => `${dataUrl}/${viewElement.label.replace(/\//ig, "%2F")}/${key.replace(/\//ig, "%2F")}`));
+ resultingDataUrls.push(...keys.map(key => `${dataUrl}/${viewElement.label.replace(/\//ig, "%2F")}=${key.replace(/\//ig, "%2F")}`));
}
dataMember = viewElement.label;
} else {
@@ -149,7 +153,10 @@
const message = restResult.data && restResult.data.errors && restResult.data.errors.error && restResult.data.errors.error[0] && restResult.data.errors.error[0]["error-message"] || "";
throw new Error(`Server Error. Status: [${restResult.status}]\n${message || restResult.message || ''}`);
}
- let dataRaw = restResult.data[dataMember!];
+ let dataRaw = restResult.data[`${defaultNS}:${dataMember!}`];
+ if (dataRaw === undefined) {
+ dataRaw = restResult.data[dataMember!];
+ }
dataRaw = dataRaw instanceof Array
? dataRaw[0]
: dataRaw;
@@ -227,7 +234,7 @@
export const updateViewActionAsyncCreator = (vPath: string) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key
const { configuration: { deviceDescription: { nodeId, modules, views } }, framework: { navigationState } } = getState();
- let dataPath = `/restconf/config/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`;
+ let dataPath = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`;
let inputViewSpecification: ViewSpecification | undefined = undefined;
let outputViewSpecification: ViewSpecification | undefined = undefined;
@@ -302,7 +309,11 @@
}
extractList = true;
} else {
- dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`;
+ // normal case
+ dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`;
+
+ // in case of the root element the required namespace will be added later,
+ // while extracting the data
dataMember = namespace === defaultNS
? viewElement.label
: `${namespace}:${viewElement.label}`;
@@ -352,7 +363,11 @@
const message = restResult.data.errors && restResult.data.errors.error && restResult.data.errors.error[0] && restResult.data.errors.error[0]["error-message"] || "";
throw new Error(`Server Error. Status: [${restResult.status}]\n${message}`);
} else {
- data = restResult.data[dataMember!]; // extract dataMember
+ // https://tools.ietf.org/html/rfc7951#section-4 the root element may countain a namesapce or not !
+ data = restResult.data[`${defaultNS}:${dataMember!}`];
+ if (data === undefined) {
+ data = restResult.data[dataMember!]; // extract dataMember w/o namespace
+ }
}
// extract the first element list[key]
@@ -405,7 +420,7 @@
export const updateDataActionAsyncCreator = (vPath: string, data: any) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key
const { configuration: { deviceDescription: { nodeId, views } } } = getState();
- let dataPath = `/restconf/config/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`;
+ let dataPath = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`;
let viewSpecification: ViewSpecification = views[0];
let viewElement: ViewElement;
let dataMember: string;
@@ -445,7 +460,7 @@
}
}
- dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`;
+ dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`;
dataMember = viewElement.label;
embedList = false;
@@ -466,7 +481,7 @@
// do not extract root member (0)
if (viewSpecification && viewSpecification.id !== "0") {
- const updateResult = await restService.setConfigData(dataPath, { [dataMember!]: data }); // extractDataMember
+ const updateResult = await restService.setConfigData(dataPath, { [`${defaultNS}:${dataMember!}`]: data }); // addDataMember using defaultNS
if (updateResult.status < 200 || updateResult.status > 299) {
const message = updateResult.data && updateResult.data.errors && updateResult.data.errors.error && updateResult.data.errors.error[0] && updateResult.data.errors.error[0]["error-message"] || "";
throw new Error(`Server Error. Status: [${updateResult.status}]\n${message || updateResult.message || ''}`);
@@ -499,7 +514,7 @@
export const removeElementActionAsyncCreator = (vPath: string) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key
const { configuration: { deviceDescription: { nodeId, views } } } = getState();
- let dataPath = `/restconf/config/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`;
+ let dataPath = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`;
let viewSpecification: ViewSpecification = views[0];
let viewElement: ViewElement;
@@ -529,7 +544,7 @@
}
}
- dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`;
+ dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`;
if (viewElement && "viewId" in viewElement) {
viewSpecification = views[+viewElement.viewId];
@@ -555,7 +570,7 @@
export const executeRpcActionAsyncCreator = (vPath: string, data: any) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key
const { configuration: { deviceDescription: { nodeId, views }, viewDescription: oldViewDescription } } = getState();
- let dataPath = `/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`;
+ let dataPath = `/rests/operations/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`;
let viewSpecification: ViewSpecification = views[0];
let viewElement: ViewElement;
let dataMember: string;
@@ -595,7 +610,7 @@
// }
}
- dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`;
+ dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`;
dataMember = viewElement.label;
embedList = false;
@@ -637,8 +652,7 @@
const message = updateResult.data && updateResult.data.errors && updateResult.data.errors.error && updateResult.data.errors.error[0] && updateResult.data.errors.error[0]["error-message"] || "";
throw new Error(`Server Error. Status: [${updateResult.status}]\n${message || updateResult.message || ''}`);
}
- const viewData = { ...oldViewDescription.viewData, output: updateResult.data || null};
- dispatch(new UpdatOutputData(viewData));
+ dispatch(new UpdatOutputData(updateResult.data));
} else {
throw new Error(`There is NO RPC specified.`);
}
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts b/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts
index b260f1f..eb2c67c 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts
+++ b/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts
@@ -23,10 +23,10 @@
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;
+ const path = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}`;
+ const capabilitiesResult = await requestRest<{"network-topology:node": {"node-id": string, "netconf-node-topology:available-capabilities": { "available-capability": { "capability-origin": string, "capability": string }[] }}[] }>(path, { method: "GET" });
+ return capabilitiesResult && capabilitiesResult["network-topology:node"] && capabilitiesResult["network-topology:node"].length > 0 &&
+ capabilitiesResult["network-topology:node"][0]["netconf-node-topology:available-capabilities"]["available-capability"].map<any>(obj => convertPropertyNames(obj, replaceHyphen)) || null;
}
public async getMountedNetworkElementByMountId(nodeId: string): Promise<NetworkElementConnection | null> {
@@ -34,13 +34,13 @@
// const connectedNetworkElement = await requestRest<NetworkElementConnection>(path, { method: "GET" });
// return connectedNetworkElement || null;
- const path = "/restconf/operations/data-provider:read-network-element-connection-list";
- const body = { "input": { "filter": [{ "property": "node-id", "filtervalue": nodeId }], "sortorder": [], "pagination": { "size": 1, "page": 1 } } };
- const networkElementResult = await requestRest<{ output: { data: NetworkElementConnection[] } }>(path, { method: "POST", body: JSON.stringify(body) });
- return networkElementResult && networkElementResult.output && networkElementResult.output.data &&
- networkElementResult.output.data.map(obj => convertPropertyNames(obj, replaceHyphen))[0] || null;
+ const path = "/rests/operations/data-provider:read-network-element-connection-list";
+ const body = { "data-provider:input": { "filter": [{ "property": "node-id", "filtervalue": nodeId }], "sortorder": [], "pagination": { "size": 1, "page": 1 } } };
+ const networkElementResult = await requestRest<{ "data-provider:output": { data: NetworkElementConnection[] } }>(path, { method: "POST", body: JSON.stringify(body) });
+ return networkElementResult && networkElementResult["data-provider:output"] && networkElementResult["data-provider:output"].data &&
+ networkElementResult["data-provider:output"].data.map(obj => convertPropertyNames(obj, replaceHyphen))[0] || null;
}
-
+
/** Reads the config data by restconf path.
* @param path The restconf path to be used for read.
* @returns The data.
diff --git a/sdnr/wt/odlux/apps/configurationApp/webpack.config.js b/sdnr/wt/odlux/apps/configurationApp/webpack.config.js
index dccf349..329eb00 100644
--- a/sdnr/wt/odlux/apps/configurationApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/configurationApp/webpack.config.js
@@ -107,8 +107,11 @@
]
],
+ watchOptions: {
+ ignored: /node_modules/
+ },
+
devServer: {
- public: "http://localhost:3100",
contentBase: frameworkPath,
compress: true,
@@ -125,31 +128,39 @@
stats: {
colors: true
},
- proxy: {
- "/oauth2/": {
- target: "http://localhost:48181",
- secure: false
- },
+ proxy: {
"/yang-schema/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
+ secure: false
+ },
+ "/oauth2/": {
+ 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
+ },
+ "/tree/": {
+ target: "http://10.20.6.29:48181",
secure: false
},
"/websocket": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
ws: true,
- changeOrigin: false,
+ changeOrigin: true,
secure: false
}
}
diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts
index 41449e8..2aa9e39 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 @@
* 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 @@
* 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 @@
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 @@
/** 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 @@
/** 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 @@
* 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 @@
}
}
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 @@
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 b72f5da..7b0a517 100644
--- a/sdnr/wt/odlux/apps/connectApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/connectApp/webpack.config.js
@@ -126,23 +126,27 @@
},
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
diff --git a/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts b/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts
index ba1a248..fea500d 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts
+++ b/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts
@@ -28,9 +28,9 @@
}
-export const clearStuckAlarmAsyncAction = (dispatcher: Dispatch) => async (nodeNames: string[]) => {
- dispatcher(new AreStuckAlarmsCleared(true))
+export const clearStuckAlarmAsyncAction = (dispatch: Dispatch) => async (nodeNames: string[]) => {
+ dispatch(new AreStuckAlarmsCleared(true))
const result = await clearStuckAlarms(nodeNames).catch(error => { console.error(error); return undefined });
- dispatcher(new AreStuckAlarmsCleared(false))
+ dispatch(new AreStuckAlarmsCleared(false))
return result;
}
\ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx b/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx
index 3b8b9b6..e131fa6 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx
+++ b/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx
@@ -30,25 +30,29 @@
const mapDispatch = (dispatcher: IDispatcher) => ({
clearStuckAlarmsAsync: clearStuckAlarmAsyncAction(dispatcher.dispatch),
reloadCurrentProblemsAction: () => dispatcher.dispatch(currentProblemsReloadAction)
-})
+});
type clearStuckAlarmsProps = Connect<typeof undefined, typeof mapDispatch> & {
- numberDevices: Number,
- mode: ClearStuckAlarmsDialogMode,
- stuckAlarms: string[]
- onClose: () => void
+ numberDevices: Number;
+ mode: ClearStuckAlarmsDialogMode;
+ stuckAlarms: string[];
+ onClose: () => void;
}
type ClearStuckAlarmsState = {
- clearAlarmsSuccessful: boolean,
- errormessage: string,
- unclearedAlarms: string[]
+ clearAlarmsSuccessful: boolean;
+ errormessage: string;
+ unclearedAlarms: string[];
}
class ClearStuckAlarmsDialogComponent extends React.Component<clearStuckAlarmsProps, ClearStuckAlarmsState>{
constructor(props: clearStuckAlarmsProps) {
super(props);
- this.state = { clearAlarmsSuccessful: true, errormessage: '', unclearedAlarms: [] }
+ this.state = {
+ clearAlarmsSuccessful: true,
+ errormessage: '',
+ unclearedAlarms: []
+ };
}
onClose = (event: React.MouseEvent) => {
@@ -62,19 +66,14 @@
event.preventDefault();
const result = await this.props.clearStuckAlarmsAsync(this.props.stuckAlarms);
- if (result) {
- if (result.output.nodenames) {
- if (result.output.nodenames.length !== this.props.stuckAlarms.length) { //show errormessage if not all devices were cleared
- const undeletedAlarm = this.props.stuckAlarms.filter(item => !result.output.nodenames.includes(item))
- const error = "The alarms of the following devices couldn't be refreshed: ";
- this.setState({ clearAlarmsSuccessful: false, errormessage: error, unclearedAlarms: undeletedAlarm })
- return;
- }
- }
- }
- else { //show errormessage if no devices were cleared
- this.setState({ clearAlarmsSuccessful: false, errormessage: "Alarms couldn't be refreshed.", unclearedAlarms: [] })
+ if (result && result["data-provider:output"].nodenames && result["data-provider:output"].nodenames.length !== this.props.stuckAlarms.length) { //show errormessage if not all devices were cleared
+ const undeletedAlarm = this.props.stuckAlarms.filter(item => !result["data-provider:output"].nodenames.includes(item));
+ const error = "The alarms of the following devices couldn't be refreshed: ";
+ this.setState({ clearAlarmsSuccessful: false, errormessage: error, unclearedAlarms: undeletedAlarm });
return;
+
+ } else { //show errormessage if no devices were cleared
+ this.setState({ clearAlarmsSuccessful: false, errormessage: "Alarms couldn't be refreshed.", unclearedAlarms: [] });
}
this.props.reloadCurrentProblemsAction();
@@ -132,5 +131,5 @@
}
}
-const ClearStuckAlarmsDialog = connect(undefined, mapDispatch)(ClearStuckAlarmsDialogComponent)
+const ClearStuckAlarmsDialog = connect(undefined, mapDispatch)(ClearStuckAlarmsDialogComponent);
export default ClearStuckAlarmsDialog;
diff --git a/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts b/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts
index e03d2b5..5b51a10 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts
+++ b/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts
@@ -67,7 +67,6 @@
alarmLogEntries: alarmLogEntriesActionHandler,
currentOpenPanel: currentOpenPanelHandler,
faultStatus: faultStatusHandler,
- stuckAlarms: stuckAlarmHandler,
listenForPartialUpdates: arePartialUpdatesActiveHandler
};
diff --git a/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts b/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts
index c657344..e4e43f1 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts
+++ b/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts
@@ -61,7 +61,5 @@
};
export type DeletedStuckAlarms = {
- output: {
nodenames: string[]
- }
}
\ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts b/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts
index d3409e0..d1236d2 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 @@
}
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 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
diff --git a/sdnr/wt/odlux/apps/faultApp/webpack.config.js b/sdnr/wt/odlux/apps/faultApp/webpack.config.js
index c91b1f4..8131c98 100644
--- a/sdnr/wt/odlux/apps/faultApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/faultApp/webpack.config.js
@@ -123,25 +123,29 @@
stats: {
colors: true
},
- proxy: {
+ 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",
+ "/websocket": {
+ target: "http://10.20.6.29:48181",
ws: true,
changeOrigin: true,
secure: false
diff --git a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
index c8b2478..728f243 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
+++ b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
@@ -55,7 +55,7 @@
}, []);
}
- this.tocNodeCollection = result && mapNodesCollection(result);
+ this.tocNodeCollection = result && mapNodesCollection(result) || null;
}
return this.tocNodeCollection || null;
}
diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts b/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts
index b6025d4..d43d298 100644
--- a/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts
+++ b/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts
@@ -36,9 +36,9 @@
}
public async getInventoryEntry(id: string): Promise<InventoryType | undefined> {
- const path = `/restconf/operations/data-provider:read-inventory-list`;
+ const path = `/rests/operations/data-provider:read-inventory-list`;
const body = {
- "input": {
+ "data-provider:input": {
"filter": [
{ property: "id", filtervalue: id },
],
diff --git a/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js b/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js
index d81797c..66c8613 100644
--- a/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js
@@ -127,33 +127,33 @@
},
proxy: {
"/oauth2/": {
- target: "http://localhost:48181",
- secure: false
- },
- "/yang-schema/": {
- 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
},
"/tree/": {
- 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: false,
+ changeOrigin: true,
secure: false
}
}
diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts
index daa6082..613b478 100644
--- a/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts
+++ b/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts
@@ -34,7 +34,7 @@
* Adds or updates one maintenence entry to the backend.
*/
public async writeMaintenenceEntry(maintenenceEntry: MaintenenceEntry): Promise<PostResponse | null> {
- const path = `/restconf/operations/data-provider:create-maintenance`;
+ const path = `/rests/operations/data-provider:create-maintenance`;
const query = {
"id": maintenenceEntry._id,
@@ -45,7 +45,7 @@
"start": convertToISODateString(maintenenceEntry.start)
};
- const result = await requestRest<PostResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) });
+ const result = await requestRest<PostResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": query }, replaceUpperCase)) });
return result || null;
}
@@ -53,7 +53,7 @@
* Deletes one maintenence entry by its mountId from the backend.
*/
public async deleteMaintenenceEntry(maintenenceEntry: MaintenenceEntry): Promise<(DeleteResponse) | null> {
- const path = `/restconf/operations/data-provider:delete-maintenance`;
+ const path = `/rests/operations/data-provider:delete-maintenance`;
const query = {
"id": maintenenceEntry._id,
@@ -63,7 +63,7 @@
"end": convertToISODateString(maintenenceEntry.end),
"start": convertToISODateString(maintenenceEntry.start)
};
- const result = await requestRest<DeleteResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) });
+ const result = await requestRest<DeleteResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": query }, replaceUpperCase)) });
return result || null;
}
}
diff --git a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js
index 33a3bed..eb6f785 100644
--- a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js
@@ -125,25 +125,29 @@
stats: {
colors: true
},
- proxy: {
+ 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",
+ "/websocket": {
+ target: "http://10.20.6.29:48181",
ws: true,
changeOrigin: true,
secure: false
diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts b/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts
index aee0866..ede6817 100644
--- a/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts
+++ b/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts
@@ -83,8 +83,8 @@
const result = await requestRest<Result<MediatorServer>>(path, { method: "POST", body: JSON.stringify({ input: data }) });
- if (result && result.output.data[0]) {
- const firstResult = result.output.data[0];
+ if (result && result["data-provider:output"].data[0]) {
+ const firstResult = result["data-provider:output"].data[0];
return {
id: firstResult.id,
diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
index 6858598..70a8771 100644
--- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
+++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts
@@ -47,13 +47,13 @@
if (selectedTimePeriod === "15min") {
- path = '/restconf/operations/data-provider:read-pmdata-15m-ltp-list';
+ path = '/rests/operations/data-provider:read-pmdata-15m-ltp-list';
} else {
- path = '/restconf/operations/data-provider:read-pmdata-24h-ltp-list';
+ path = '/rests/operations/data-provider:read-pmdata-24h-ltp-list';
}
const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) });
- return result && result.output && result.output.data && result.output.data.map(ne => ({ key: ne })) || null;
+ return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ key: ne })) || null;
}
@@ -62,9 +62,9 @@
* Gets all devices from the performanceHistory 15min backend.
*/
public async getDeviceListfromPerf15minHistory(): Promise<(DeviceListType)[] | null> {
- const path = '/restconf/operations/data-provider:read-pmdata-15m-device-list';
+ const path = '/rests/operations/data-provider:read-pmdata-15m-device-list';
const query = {
- "input": {
+ "data-provider:input": {
"filter": [],
"sortorder": [],
"pagination": {
@@ -75,7 +75,7 @@
};
const result = await requestRest<Result<string>>(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 => ({
nodeId: ne
})) || null;
}
@@ -84,9 +84,9 @@
* Gets all devices from the performanceHistory 24h backend.
*/
public async getDeviceListfromPerf24hHistory(): Promise<(DeviceListType)[] | null> {
- const path = '/restconf/operations/data-provider:read-pmdata-24h-device-list';
+ const path = '/rests/operations/data-provider:read-pmdata-24h-device-list';
const query = {
- "input": {
+ "data-provider:input": {
"filter": [],
"sortorder": [],
"pagination": {
@@ -97,7 +97,7 @@
};
const result = await requestRest<Result<string>>(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 => ({
nodeId: ne
})) || null;
}
diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js
index 6579db3..5faf69e 100644
--- a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js
@@ -126,15 +126,29 @@
},
proxy: {
"/oauth2/": {
- target: "http://10.20.6.29:28181",
+ target: "http://10.20.6.29:48181",
secure: false
},
- "/restconf": {
- target: "http://10.20.6.29:28181",
+ "/database/": {
+ target: "http://10.20.6.29:48181",
secure: false
},
- "/database": {
- target: "http://10.20.6.29:28181",
+ "/restconf/": {
+ target: "http://10.20.6.29:48181",
+ secure: false
+ },
+ "/rests/": {
+ target: "http://10.20.6.29:48181",
+ secure: false
+ },
+ "/help/": {
+ target: "http://10.20.6.29:48181",
+ secure: false
+ },
+ "/websocket": {
+ target: "http://10.20.6.29:48181",
+ ws: true,
+ changeOrigin: true,
secure: false
}
}