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 ++++++++++------------ 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'usecaseui-portal/src/app/core/services') 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) { -- cgit 1.2.3-korg