diff options
2 files changed, 11 insertions, 3 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 9ed16110..732291d0 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 @@ -273,8 +273,16 @@ public class PackageDistributionController { } @RequestMapping(value = {"/uui-lcm/healNetworkServiceInstance"}, method = RequestMethod.POST , produces = "application/json") - public String healNetworkServiceInstance(HttpServletRequest request,@RequestParam String ns_instance_id){ - return packageDistributionService.healNetworkServiceInstance(request,ns_instance_id); + public String healNetworkServiceInstance(HttpServletRequest request,@RequestParam String ns_instance_id) throws ParseException{ + String result= packageDistributionService.healNetworkServiceInstance(request,ns_instance_id); + String jobId = ""; + if(UuiCommonUtil.isNotNullOrEmpty(result)){ + JSONObject jobIdObject = JSONObject.parseObject(result); + jobId = jobIdObject.getString("jobId"); + } + ServiceInstanceOperations serviceOpera = new ServiceInstanceOperations(ns_instance_id,jobId,Constant.HEALING_CODE,"0",Constant.IN_PROGRESS_CODE,DateUtils.dateToString(DateUtils.now()),null); + serviceLcmService.saveOrUpdateServiceInstanceOperation(serviceOpera); + return result; } @RequestMapping(value = {"/uui-lcm/scaleNetworkServiceInstance"}, method = RequestMethod.POST , produces = "application/json") diff --git a/server/src/test/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionControllerTest.java b/server/src/test/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionControllerTest.java index 00a133d8..cfed3cc9 100644 --- a/server/src/test/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionControllerTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionControllerTest.java @@ -315,7 +315,7 @@ public class PackageDistributionControllerTest { } @Test - public void testHealNetworkServiceInstance() throws IOException { + public void testHealNetworkServiceInstance() throws IOException, ParseException{ String ns_instance_id="1"; HttpServletRequest request = mockRequest(); controller.healNetworkServiceInstance(request,ns_instance_id); |