Bugfix: Unable to delete a VFModule 55/25355/1
authorOfir Sonsino <os0695@att.com>
Sun, 3 Dec 2017 15:18:04 +0000 (17:18 +0200)
committerOfir Sonsino <os0695@att.com>
Sun, 3 Dec 2017 15:18:04 +0000 (17:18 +0200)
Change-Id: I7f580977861ce479b332ff2bb2b16542f832eff6
Issue-ID: VID-95
Signed-off-by: Ofir Sonsino <os0695@att.com>
vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java
vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java

index 9a064b0..451b19d 100755 (executable)
@@ -405,7 +405,7 @@ public class MsoController extends RestrictedBaseController {
 \r
         MsoBusinessLogic mbl = new MsoBusinessLogic();\r
 \r
-        MsoResponseWrapper w = mbl.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId);\r
+        MsoResponseWrapper w = mbl.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId, vfModuleId);\r
 \r
         // always return OK, the MSO status code is embedded in the body\r
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));\r
index cd6003a..f6847e4 100644 (file)
@@ -153,7 +153,7 @@ public class MsoBusinessLogic {
         return msoClientInterface.deleteVnf(requestDetails, vnf_endpoint);
     }
 
-    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception{
+    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception{
         String methodName = "deleteVfModule";
         logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
 
@@ -164,8 +164,9 @@ public class MsoBusinessLogic {
             throw exception;
         }
 
-        String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        String delete_vf_endpoint = svc_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+        String vf__modules_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId).replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+        String delete_vf_endpoint = vf__modules_endpoint + '/' + vfModuleId;
 
         return msoClientInterface.deleteVfModule(requestDetails, delete_vf_endpoint);
     }