From eb2d8b5118d13398eb57ef10d68b6ec595bc1989 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Thu, 12 Sep 2019 16:45:16 +0800 Subject: feat:optimize topo api & mock json for network service page Change-Id: Icb5cbb83407c1fa8054dea197fd52292747bd821 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../core/services/networkHttpservice.service.ts | 42 ++--- .../app/mock/json/uui-sotn_getLogicalLinks.json | 117 ++++++++++++ .../mock/json/uui-sotn_getNetWorkResources.json | 198 +++++++++++++++++++++ .../mock/json/uui-sotn_getPinterfaceByPnfName.json | 17 ++ .../mock/json/uui-sotn_getSpecificLogicalLink.json | 52 ++++++ .../ccvpn-network/ccvpn-network.component.html | 2 +- .../views/ccvpn-network/ccvpn-network.component.ts | 4 +- 7 files changed, 406 insertions(+), 26 deletions(-) create mode 100644 usecaseui-portal/src/app/mock/json/uui-sotn_getLogicalLinks.json create mode 100644 usecaseui-portal/src/app/mock/json/uui-sotn_getNetWorkResources.json create mode 100644 usecaseui-portal/src/app/mock/json/uui-sotn_getPinterfaceByPnfName.json create mode 100644 usecaseui-portal/src/app/mock/json/uui-sotn_getSpecificLogicalLink.json (limited to 'usecaseui-portal') diff --git a/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts b/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts index a3131bb3..2b1c38d1 100644 --- a/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts +++ b/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts @@ -23,25 +23,24 @@ export class networkHttpservice { constructor(private http: HttpClient) { } - baseUrl = baseUrl.baseUrl + "/uui-sotn/";//Online environment + baseUrl = baseUrl.baseUrl;//Online environment url = { // The following APIs are optimizable - "getNetworkD3Data": this.baseUrl + "getNetWorkResources", - "getLogicalLinksData": this.baseUrl + "getLogicalLinks", - "deleteCloud": this.baseUrl + "deleteExtNetWork", + "getNetworkD3Data": "/uui-sotn/getNetWorkResources", + "getLogicalLinksData": "/uui-sotn/getLogicalLinks", + "deleteCloud": "/uui-sotn/deleteExtNetWork", // The following APIs are not optimizable - "getPInterfacesData1": this.baseUrl + "getPinterfaceByPnfName/", - "getPInterfacesData2": this.baseUrl + "getPinterfaceByPnfName/", - "createLink": this.baseUrl + "createLink/", - "querySpecificLinkInfo": this.baseUrl + "getSpecificLogicalLink/", - "queryCloudUrl": this.baseUrl + "getHostUrl/", - "queryExtAAIIdVersion": this.baseUrl + "getExtAaiId/", - "createNetwrok": this.baseUrl + "createTopoNetwork/", - "createPnf": this.baseUrl + "createPnf/", - "createTp": this.baseUrl + "pnf/", - "createCloudLink": this.baseUrl + "createLink/", - "createCloudUrl": this.baseUrl + "createHostUrl/", - "deleteLink": this.baseUrl + "deleteLink/", + "getPInterfacesData": "/uui-sotn/getPinterfaceByPnfName/", + "createLink": "/uui-sotn/createLink/", + "querySpecificLinkInfo": "/uui-sotn/getSpecificLogicalLink/", + "queryCloudUrl": "/uui-sotn/getHostUrl/", + "queryExtAAIIdVersion": "/uui-sotn/getExtAaiId/", + "createNetwrok": "/uui-sotn/createTopoNetwork/", + "createPnf": "/uui-sotn/createPnf/", + "createTp": "/uui-sotn/pnf/", + "createCloudLink": "/uui-sotn/createLink/", + "createCloudUrl": "/uui-sotn/createHostUrl/", + "deleteLink": "/uui-sotn/deleteLink/", }; @@ -55,17 +54,14 @@ export class networkHttpservice { return this.http.get(this.url["getLogicalLinksData"]); } deleteCloudLink(paramsObj) { - let str = "?extNetworkId=" + paramsObj["aaiId"] + "&resourceVersion=" + paramsObj["version"]; - return this.http.delete((this.url["deleteCloud"] + str)); + let params = new HttpParams({ fromObject: paramsObj }); + return this.http.delete(this.url["deleteCloud"],{params}); } //The following APIs function are not optimizable------------------------ //Query the tp data corresponding to the specified node - getPInterfacesData1(paramsObj) { - return this.http.get(this.url['getPInterfacesData1'] + paramsObj["pnfName"]); - } - getPInterfacesData2(paramsObj) { - return this.http.get(this.url["getPInterfacesData2"] + paramsObj["pnfName"]); + getPInterfacesData(paramsObj) { + return this.http.get(this.url['getPInterfacesData'] + paramsObj["pnfName"]); } //Create a connection interface createLink(paramsObj) { diff --git a/usecaseui-portal/src/app/mock/json/uui-sotn_getLogicalLinks.json b/usecaseui-portal/src/app/mock/json/uui-sotn_getLogicalLinks.json new file mode 100644 index 00000000..1b8ecff1 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/uui-sotn_getLogicalLinks.json @@ -0,0 +1,117 @@ +{ + "logical-link": [ + { + "link-name": "cross-link-1", + "in-maint": false, + "link-type": "cross-link", + "resource-version": "1536029865021", + "operational-status": "up", + "relationship-list": { + "relationship": [ + { + "related-to": "p-interface", + "relationship-label": "tosca.relationships.network.LinksTo", + "related-link": "/aai/v13/network/pnfs/pnf/pnf2000/p-interfaces/p-interface/nodeId-78.78.78.78-ltpId-1", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "pnf2000" + }, + { + "relationship-key": "p-interface.interface-name", + "relationship-value": "nodeId-78.78.78.78-ltpId-1" + } + ], + "related-to-property": [ + { + "property-key": "p-interface.prov-status" + } + ] + }, + { + "related-to": "p-interface", + "relationship-label": "tosca.relationships.network.LinksTo", + "related-link": "/aai/v13/network/pnfs/pnf/pnf1000/p-interfaces/p-interface/nodeId-79.79.79.79-ltpId-1", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "pnf1000" + }, + { + "relationship-key": "p-interface.interface-name", + "relationship-value": "nodeId-79.79.79.79-ltpId-1" + } + ], + "related-to-property": [ + { + "property-key": "p-interface.prov-status" + } + ] + } + ] + } + }, + { + "link-name": "cross-link-2", + "in-maint": false, + "link-type": "cross-link", + "resource-version": "1536029865021", + "operational-status": "up", + "relationship-list": { + "relationship": [ + { + "related-to": "p-interface", + "relationship-label": "tosca.relationships.network.LinksTo", + "related-link": "/aai/v13/network/pnfs/pnf/pnf3000/p-interfaces/p-interface/nodeId-80.80.80.80-ltpId-2", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "pnf3000" + }, + { + "relationship-key": "p-interface.interface-name", + "relationship-value": "nodeId-80.80.80.80-ltpId-2" + } + ], + "related-to-property": [ + { + "property-key": "p-interface.prov-status" + } + ] + }, + { + "related-to": "p-interface", + "relationship-label": "tosca.relationships.network.LinksTo", + "related-link": "/aai/v13/network/pnfs/pnf/pnf-cloud/p-interfaces/p-interface/cloud-tp", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "pnf-cloud" + }, + { + "relationship-key": "p-interface.interface-name", + "relationship-value": "cloud-tp" + } + ], + "related-to-property": [ + { + "property-key": "p-interface.prov-status" + } + ] + }, + { + "related-to": "ext-aai-network", + "relationship-label": "org.onap.relationships.inventory.BelongsTo", + "related-link": "/aai/v13/network/ext-aai-networks/ext-aai-network/gongjie666", + "relationship-data": [ + { + "relationship-key": "ext-aai-network.aai-id", + "relationship-value": "gongjie666" + } + ] + } + ] + } + } + ] +} diff --git a/usecaseui-portal/src/app/mock/json/uui-sotn_getNetWorkResources.json b/usecaseui-portal/src/app/mock/json/uui-sotn_getNetWorkResources.json new file mode 100644 index 00000000..faacef83 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/uui-sotn_getNetWorkResources.json @@ -0,0 +1,198 @@ +[ + { + "networkId": "1000", + "pnfs": [ + { + "pnfName": "pnf1000" + } + ], + "tps": [ + { + "interface-name": "nodeId-78.78.78.78-ltpId-5" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-4" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-1" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-3" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "2000", + "pnfs": [ + { + "pnfName": "pnf2000" + } + ], + "tps": [ + { + "interface-name": "nodeId-79.79.79.79-ltpId-5" + }, + { + "interface-name": "nodeId-79.79.79.79-ltpId-4" + }, + { + "interface-name": "nodeId-79.79.79.79-ltpId-1" + }, + { + "interface-name": "nodeId-79.79.79.79-ltpId-3" + }, + { + "interface-name": "nodeId-79.79.79.79-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "3000", + "pnfs": [ + { + "pnfName": "pnf3000" + } + ], + "tps": [ + { + "interface-name": "nodeId-80.80.80.80-ltpId-5" + }, + { + "interface-name": "nodeId-80.80.80.80-ltpId-4" + }, + { + "interface-name": "nodeId-80.80.80.80-ltpId-1" + }, + { + "interface-name": "nodeId-80.80.80.80-ltpId-3" + }, + { + "interface-name": "nodeId-80.80.80.80-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "4000", + "pnfs": [ + { + "pnfName": "pnf4000" + } + ], + "tps": [ + { + "interface-name": "nodeId-81.81.81.81-ltpId-5" + }, + { + "interface-name": "nodeId-81.81.81.81-ltpId-4" + }, + { + "interface-name": "nodeId-81.81.81.81-ltpId-1" + }, + { + "interface-name": "nodeId-81.81.81.81-ltpId-3" + }, + { + "interface-name": "nodeId-81.81.81.81-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "5000", + "pnfs": [ + { + "pnfName": "pnf5000" + } + ], + "tps": [ + { + "interface-name": "nodeId-82.82.82.82-ltpId-5" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-4" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-1" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-3" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "5000", + "pnfs": [ + { + "pnfName": "pnf5000" + } + ], + "tps": [ + { + "interface-name": "nodeId-82.82.82.82-ltpId-5" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-4" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-1" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-3" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "5000", + "pnfs": [ + { + "pnfName": "pnf5000" + } + ], + "tps": [ + { + "interface-name": "nodeId-82.82.82.82-ltpId-5" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-4" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-1" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-3" + }, + { + "interface-name": "nodeId-82.82.82.82-ltpId-2" + } + ], + "aaiId":"" + }, + { + "networkId": "cloud-network", + "pnfs": [ + { + "pnfName": "pnf-cloud" + } + ], + "tps": [ + { + "interface-name": "cloud-tp" + } + ], + "aaiId":"gongjie666" + } +] diff --git a/usecaseui-portal/src/app/mock/json/uui-sotn_getPinterfaceByPnfName.json b/usecaseui-portal/src/app/mock/json/uui-sotn_getPinterfaceByPnfName.json new file mode 100644 index 00000000..399c21b9 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/uui-sotn_getPinterfaceByPnfName.json @@ -0,0 +1,17 @@ +[ + { + "interface-name": "nodeId-78.78.78.78-ltpId-5" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-4" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-3" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-2" + }, + { + "interface-name": "nodeId-78.78.78.78-ltpId-1" + } +] diff --git a/usecaseui-portal/src/app/mock/json/uui-sotn_getSpecificLogicalLink.json b/usecaseui-portal/src/app/mock/json/uui-sotn_getSpecificLogicalLink.json new file mode 100644 index 00000000..e9911409 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/uui-sotn_getSpecificLogicalLink.json @@ -0,0 +1,52 @@ +{ + "link-name": "nodeId-79.79.79.79-ltpId-4_nodeId-78.78.78.78-ltpId-4", + "in-maint": false, + "link-type": "some type", + "speed-value": "some speed", + "resource-version": "1536212883031", + "operational-status": "up", + "relationship-list": { + "relationship": [ + { + "related-to": "p-interface", + "relationship-label": "tosca.relationships.network.LinksTo", + "related-link": "/aai/v13/network/pnfs/pnf/pnf1000/p-interfaces/p-interface/nodeId-79.79.79.79-ltpId-4", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "pnf1000" + }, + { + "relationship-key": "p-interface.interface-name", + "relationship-value": "nodeId-79.79.79.79-ltpId-4" + } + ], + "related-to-property": [ + { + "property-key": "p-interface.prov-status" + } + ] + }, + { + "related-to": "p-interface", + "relationship-label": "tosca.relationships.network.LinksTo", + "related-link": "/aai/v13/network/pnfs/pnf/pnf2000/p-interfaces/p-interface/nodeId-78.78.78.78-ltpId-4", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "pnf2000" + }, + { + "relationship-key": "p-interface.interface-name", + "relationship-value": "nodeId-78.78.78.78-ltpId-4" + } + ], + "related-to-property": [ + { + "property-key": "p-interface.prov-status" + } + ] + } + ] + } +} diff --git a/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.html b/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.html index 25687f67..fb025d96 100644 --- a/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.html +++ b/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.html @@ -145,7 +145,7 @@ - + diff --git a/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.ts b/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.ts index d02149d0..a2f9561c 100644 --- a/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.ts +++ b/usecaseui-portal/src/app/views/ccvpn-network/ccvpn-network.component.ts @@ -688,7 +688,7 @@ export class CcvpnNetworkComponent implements OnInit { let params = { pnfName: this.selectedNode1, }; - this.myhttp.getPInterfacesData1(params) + this.myhttp.getPInterfacesData(params) .subscribe((data) => { this.tpOption1 = []; for (let i = 0; i < data.length; i++) { @@ -716,7 +716,7 @@ export class CcvpnNetworkComponent implements OnInit { let params = { pnfName: this.selectedNode2, }; - this.myhttp.getPInterfacesData2(params) + this.myhttp.getPInterfacesData(params) .subscribe((data) => { this.tpOption2 = []; for (let i = 0; i < data.length; i++) { -- cgit 1.2.3-korg