diff options
author | decheng zhang <decheng.zhang@huawei.com> | 2022-05-10 17:17:27 -0400 |
---|---|---|
committer | decheng zhang <decheng.zhang@huawei.com> | 2022-05-10 17:17:48 -0400 |
commit | 3afade76f0fbd9abc4b58329f8cb4502b4af96b7 (patch) | |
tree | f2788c9491409fd01e446c8f7ba53e887ca822b1 | |
parent | 88f8e9fd821a9e098ace0317deec1e31187c0b03 (diff) |
fix: UUI backend restful api endpoints, remove multiple matching
Issue-ID: REQ-1103
Signed-off-by: decheng zhang <decheng.zhang@huawei.com>
Change-Id: I6b9a259548aafa96d67f200377652e23e8125ce6
4 files changed, 44 insertions, 8 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java b/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java index 36c67b8a..026d1e76 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java @@ -138,8 +138,8 @@ public class SotnController { return sotnService.serviceInstanceInfo(customerId, serviceType, serviceId); } - @GetMapping(value = {"/getPnfInfo", "/getPnfInfo/{pnfName}"}) - public String getPnfInfo(@PathVariable(required = false) String pnfName){ + @GetMapping(value = {"/getPnfInfo"}) + public String getPnfInfo(String pnfName){ return sotnService.getPnfInfo(pnfName); } @@ -151,21 +151,26 @@ public class SotnController { return sotnService.getAllottedResources(customerId, serviceType,serviceId); } - @GetMapping(value = {"/getConnectivityInfo", "/getConnectivityInfo/{connectivityId}"}) - public String getConnectivityInfo(@PathVariable(required = false) String connectivityId){ + @GetMapping(value = {"/getConnectivityInfo"}) + public String getConnectivityInfo( String connectivityId){ return sotnService.getConnectivityInfo(connectivityId); } - @GetMapping(value = {"/getVpnBindingInfo", "/getVpnBindingInfo/{vpnId}"}) - public String getVpnBindingInfo(@PathVariable(required = false) String vpnId){ + @GetMapping(value = {"/getVpnBindingInfo"}) + public String getVpnBindingInfo( String vpnId){ return sotnService.getVpnBindingInfo(vpnId); } - @GetMapping(value = {"/getNetworkRouteInfo", "/getNetworkRouteInfo/{routeId}"}) - public String getNetworkRouteInfo(@PathVariable(required = false) String routeId){ + @GetMapping(value = {"/getNetworkRouteInfo"}) + public String getNetworkRouteInfo(String routeId){ return sotnService.getNetworkRouteInfo(routeId); } + @GetMapping(value = {"/getUniInfo"}) + public String getUniInfo(String Id){ + return sotnService.getUniInfo(Id); + } + @GetMapping(value = {"/getPinterfaceByVpnId/{vpnId:.+}"}) public String getPinterfaceByVpnId(@PathVariable(value="vpnId") String vpnId){ return sotnService.getPinterfaceByVpnId(vpnId); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java index b491552c..d6c53ef4 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java @@ -345,6 +345,15 @@ public interface AAIService { Call<ResponseBody> getNetworkRouteInfo(@Query("route-id") String routeId); @Headers({ + "X-TransactionId: 9999", + "X-FromAppId: MSO", + "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", + "Accept: application/json" + }) + @GET("/aai/v24/network/unis") + Call<ResponseBody> getUniInfo(@Query("uni-id") String uniId); + + @Headers({ "X-TransactionId: 7777", "X-FromAppId: uui", "Authorization: Basic QUFJOkFBSQ==", diff --git a/server/src/main/java/org/onap/usecaseui/server/service/sotn/SOTNService.java b/server/src/main/java/org/onap/usecaseui/server/service/sotn/SOTNService.java index a7fe6eba..ea2fe00f 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/sotn/SOTNService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/sotn/SOTNService.java @@ -61,6 +61,8 @@ public interface SOTNService { public String getNetworkRouteInfo(String routeId); + public String getUniInfo(String id); + public String getPinterfaceByVpnId(String vpnId); public String deleteExtNetwork(String networkId,String resourceVersion); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/sotn/impl/SOTNServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/sotn/impl/SOTNServiceImpl.java index f688836b..90e95b0b 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/sotn/impl/SOTNServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/sotn/impl/SOTNServiceImpl.java @@ -440,6 +440,26 @@ public class SOTNServiceImpl implements SOTNService{ return result; } + @Override + public String getUniInfo(String id){ + String result=""; + try { + logger.info("aai getUniInfo is starting!"); + Response<ResponseBody> response = this.aaiService.getUniInfo(id).execute(); + logger.info("aai getUniInfo has finished!"); + if (response.isSuccessful()) { + result=new String(response.body().bytes()); + } else { + logger.info(String.format("Can not get getUniInfo[code=%s, message=%s]", response.code(), response.message())); + result= CommonConstant.CONSTANT_FAILED; + } + } catch (IOException e) { + logger.error("getUniInfo occur exception:"+e); + result= CommonConstant.CONSTANT_FAILED; + } + return result; + } + @Override public String getPinterfaceByVpnId(String vpnId) { String result=""; |