aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java5
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java2
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java3
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java22
4 files changed, 32 insertions, 0 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java
index f580a9fc..64d5f591 100644
--- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java
@@ -248,4 +248,9 @@ public class PackageDistributionController {
public String scaleNetworkServiceInstance(HttpServletRequest request,@RequestParam String ns_instance_id){
return packageDistributionService.scaleNetworkServiceInstance(request,ns_instance_id);
}
+
+ @RequestMapping(value = {"/uui-lcm/VnfInfo/{vnfinstid}"}, method = RequestMethod.POST , produces = "application/json")
+ public String getVnfInfoById(@PathVariable String vnfinstid){
+ return packageDistributionService.getVnfInfoById(vnfinstid);
+ }
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java
index cd490381..2c89dadd 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java
@@ -95,4 +95,6 @@ public interface PackageDistributionService {
String healNetworkServiceInstance(HttpServletRequest request,String networkServiceInstanceId);
String scaleNetworkServiceInstance(HttpServletRequest request,String networkServiceInstanceId);
+
+ String getVnfInfoById(String vnfinstid);
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java
index 9495477f..fdc11b57 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java
@@ -117,4 +117,7 @@ public interface VfcService {
@DELETE("/api/nsd/v1/pnf_descriptors/{pnfdInfoId}")
Call<ResponseBody> deletePnfdPackage(@Path("pnfdInfoId") String pnfdInfoId);
+
+ @GET("/api/nslcm/v1/ns/vnfs/{vnfinstid}")
+ Call<ResponseBody> getVnfInfoById(@Path("vnfinstid") String vnfinstid);
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
index c4c6a20b..25598f09 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
@@ -737,4 +737,26 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
}
return result;
}
+
+ @Override
+ public String getVnfInfoById(String vnfinstid) {
+
+ String result="";
+ try {
+ logger.info("vfc getVnfInfoById is starting!");
+ Response<ResponseBody> response = this.vfcService.getVnfInfoById(vnfinstid).execute();
+ logger.info("vfc getVnfInfoById has finished!");
+ if (response.isSuccessful()) {
+ result=new String(response.body().bytes());
+ } else {
+ logger.info(String.format("Can not get getVnfInfoById[code=%s, message=%s]", response.code(), response.message()));
+ result=Constant.CONSTANT_FAILED;;
+ }
+ } catch (IOException e) {
+ logger.error("getVnfInfoById occur exception:"+e);
+ result=Constant.CONSTANT_FAILED;;
+ }
+ return result;
+
+ }
}