From f3b5e83683b7e5f47454fc59cb2ebd4789f5524a Mon Sep 17 00:00:00 2001 From: cyuamber Date: Tue, 27 Aug 2019 14:29:25 +0800 Subject: feat:optimize network topo page api Change-Id: Icd8de2b05d8a9a9ab826bf3c8cfcbc71da272af6 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../core/services/networkHttpservice.service.ts | 35 ++++++++-------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'usecaseui-portal/src/app/core') diff --git a/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts b/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts index 8af6d292..a3131bb3 100644 --- a/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts +++ b/usecaseui-portal/src/app/core/services/networkHttpservice.service.ts @@ -23,28 +23,13 @@ export class networkHttpservice { constructor(private http: HttpClient) { } - // baseUrl = "./assets/json/";//Local environment - // url={ - // "getNetworkD3Data":this.baseUrl + "netWorkD3Data.json", - // "getLogicalLinksData":this.baseUrl + "LogicalLinksData.json", - // "getPInterfacesData1":this.baseUrl + "netWorkD3Data.json", - // "getPInterfacesData2":this.baseUrl + "p_interfaces1.json", - // "createLink":this.baseUrl + "status.json", - // "querySpecificLinkInfo":this.baseUrl + "specific_link _nfo.json", - // "queryCloudUrl":this.baseUrl + "url.json", - // "createNetwrok":this.baseUrl + "status.json", - // "createPnf":this.baseUrl + "status.json", - // "createTp":this.baseUrl + "status.json", - // "createCloudLink":this.baseUrl + "status.json", - // "createCloudUrl":this.baseUrl + "status.json", - // "deleteLink":this.baseUrl + "status.json", - // }; - // baseUrl = "http://10.73.242.244:8082/uui-sotn/";//Online environment - // baseUrl = "http://172.19.44.223/api/usecaseui-server/v1/uui-sotn/";//Online environment baseUrl = baseUrl.baseUrl + "/uui-sotn/";//Online environment url = { + // The following APIs are optimizable "getNetworkD3Data": this.baseUrl + "getNetWorkResources", "getLogicalLinksData": this.baseUrl + "getLogicalLinks", + "deleteCloud": this.baseUrl + "deleteExtNetWork", + // The following APIs are not optimizable "getPInterfacesData1": this.baseUrl + "getPinterfaceByPnfName/", "getPInterfacesData2": this.baseUrl + "getPinterfaceByPnfName/", "createLink": this.baseUrl + "createLink/", @@ -57,8 +42,10 @@ export class networkHttpservice { "createCloudLink": this.baseUrl + "createLink/", "createCloudUrl": this.baseUrl + "createHostUrl/", "deleteLink": this.baseUrl + "deleteLink/", - "deleteCloud": this.baseUrl + "deleteExtNetWork" + }; + + //The following APIs function are optimizable------------------------ //d3data getNetworkD3Data() { return this.http.get(this.url["getNetworkD3Data"]); @@ -67,6 +54,12 @@ export class networkHttpservice { getLogicalLinksData() { 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)); + } + + //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"]); @@ -115,8 +108,4 @@ export class networkHttpservice { let str = paramsObj["logical-link"] + "/" + paramsObj["resource-version"]; return this.http.delete((this.url["deleteLink"] + str)); } - deleteCloudLink(paramsObj) { - let str = "?extNetworkId=" + paramsObj["aaiId"] + "&resourceVersion=" + paramsObj["version"]; - return this.http.delete((this.url["deleteCloud"] + str)); - } } -- cgit 1.2.3-korg