diff options
4 files changed, 147 insertions, 0 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 c6cb032e..550e0449 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 @@ -131,6 +131,29 @@ public class SotnController { return sotnService.serviceInstanceInfo(customerId, serviceType, serviceId); } + @RequestMapping(value = {"/getPnfInfo/{pnfName}"}, method = RequestMethod.GET) + public String getPnfInfo(@PathVariable(value="pnfName") String pnfName){ + return sotnService.getPnfInfo(pnfName); + } + + @RequestMapping(value = {"/getAllottedResources"}, method = RequestMethod.GET) + public String getAllottedResources(HttpServletRequest request){ + String customerId = request.getParameter("customerId"); + String serviceType = request.getParameter("serviceType"); + String serviceId = request.getParameter("serviceId"); + return sotnService.getAllottedResources(customerId, serviceType,serviceId); + } + + @RequestMapping(value = {"/getConnectivityInfo/{connectivityId}"}, method = RequestMethod.GET) + public String getConnectivityInfo(@PathVariable(value="connectivityId") String connectivityId){ + return sotnService.getConnectivityInfo(connectivityId); + } + + @RequestMapping(value = {"/getPinterfaceByVpnId/{vpnId}"}, method = RequestMethod.GET) + public String getPinterfaceByVpnId(@PathVariable(value="vpnId") String vpnId){ + return sotnService.getPinterfaceByVpnId(vpnId); + } + @RequestMapping(value = {"/getServiceInstanceList"}, method = RequestMethod.GET) public String getServiceInstanceList(HttpServletRequest request){ String customerId = request.getParameter("customerId"); 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 7192f462..0f11f07c 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 @@ -209,4 +209,40 @@ public interface AAIService { }) @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") Call<ResponseBody> serviceInstaneInfo(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,@Query("service-instance-id") String serviceInstanceId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources") + Call<ResponseBody> getAllottedResources(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,@Path("service-instance-id") String serviceInstanceId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-network/v13/pnfs/pnf/{pnfName}") + Call<ResponseBody> getPnfInfo(@Path("pnfName") String pnfName); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-network/v13/connectivities") + Call<ResponseBody> getConnectivityInfo(@Query("connectivity-id") String connectivityId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @PUT("/api/aai-network/v13/vpn-bindings") + Call<ResponseBody> getPinterfaceByVpnId(@Query("vpn-id") String vpnId); } 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 8a876457..dcae6623 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 @@ -48,4 +48,12 @@ public interface SOTNService { public String getServiceInstances(String customerId,String serviceType); public String serviceInstanceInfo(String customerId,String serviceType,String serviceInstanceId); + + public String getPnfInfo(String pnfName); + + public String getAllottedResources(String customerId,String serviceType,String serviceId); + + public String getConnectivityInfo(String connectivityId); + + public String getPinterfaceByVpnId(String vpnId); } 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 b98e7853..e317d258 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 @@ -319,4 +319,84 @@ public class SOTNServiceImpl implements SOTNService{ throw new SOException("aai serviceInstanceInfo is not available!", e); } } + + @Override + public String getPnfInfo(String pnfName) { + String result=""; + try { + logger.info("aai getPnfInfo is starting!"); + Response<ResponseBody> response = this.aaiService.getPnfInfo(pnfName).execute(); + logger.info("aai getPnfInfo has finished!"); + if (response.isSuccessful()) { + result=new String(response.body().bytes()); + } else { + logger.info(String.format("Can not get getPnfInfo[code=%s, message=%s]", response.code(), response.message())); + result=Constant.CONSTANT_FAILED; + } + } catch (IOException e) { + logger.error("getPnfInfo occur exception:"+e); + result=Constant.CONSTANT_FAILED;; + } + return result; + } + + @Override + public String getAllottedResources(String customerId, String serviceType, String serviceId) { + String result=""; + try { + logger.info("aai getAllottedResources is starting!"); + Response<ResponseBody> response = this.aaiService.getAllottedResources(customerId, serviceType, serviceId).execute(); + logger.info("aai getAllottedResources has finished!"); + if (response.isSuccessful()) { + result=new String(response.body().bytes()); + } else { + logger.info(String.format("Can not get getAllottedResources[code=%s, message=%s]", response.code(), response.message())); + result=Constant.CONSTANT_FAILED; + } + } catch (IOException e) { + logger.error("getAllottedResources occur exception:"+e); + result=Constant.CONSTANT_FAILED;; + } + return result; + } + + @Override + public String getConnectivityInfo(String connectivityId) { + String result=""; + try { + logger.info("aai getConnectivityInfo is starting!"); + Response<ResponseBody> response = this.aaiService.getConnectivityInfo(connectivityId).execute(); + logger.info("aai getConnectivityInfo has finished!"); + if (response.isSuccessful()) { + result=new String(response.body().bytes()); + } else { + logger.info(String.format("Can not get getConnectivityInfo[code=%s, message=%s]", response.code(), response.message())); + result=Constant.CONSTANT_FAILED; + } + } catch (IOException e) { + logger.error("getConnectivityInfo occur exception:"+e); + result=Constant.CONSTANT_FAILED;; + } + return result; + } + + @Override + public String getPinterfaceByVpnId(String vpnId) { + String result=""; + try { + logger.info("aai getPinterfaceByVpnId is starting!"); + Response<ResponseBody> response = this.aaiService.getPinterfaceByVpnId(vpnId).execute(); + logger.info("aai getPinterfaceByVpnId has finished!"); + if (response.isSuccessful()) { + result=new String(response.body().bytes()); + } else { + logger.info(String.format("Can not get getPinterfaceByVpnId[code=%s, message=%s]", response.code(), response.message())); + result=Constant.CONSTANT_FAILED; + } + } catch (IOException e) { + logger.error("getPinterfaceByVpnId occur exception:"+e); + result=Constant.CONSTANT_FAILED;; + } + return result; + } } |