Fix for multistep vnf level actions 53/67553/3
authorGeorge, Lina (lg941u) <lg941u@att.com>
Wed, 19 Sep 2018 02:24:49 +0000 (22:24 -0400)
committerTakamune Cho <tc012c@att.com>
Wed, 19 Sep 2018 20:18:17 +0000 (20:18 +0000)
Issue-ID: APPC-1197
Change-Id: I12e7107d88e9d1ca21f0d90500292c31a00260d6
Signed-off-by: George, Lina (lg941u) <lg941u@att.com>
appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java
appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/node/AAIResourceNode.java

index b10abc4..76336c1 100644 (file)
@@ -774,7 +774,7 @@ public class AaiService {
         cloudOwner = cloudOwner.replaceAll("'", "");
         cloudRegionId = cloudRegionId.replaceAll("'", "");
         log.debug("cloudOwner" +cloudOwner +"," +"cloudRegionId"+ cloudRegionId);
-        String resourceKey = "cloud-region.cloud-owner = '" + cloudOwner +
+        String resourceKey = "depth = '" + 0 + "' AND cloud-region.cloud-owner = '" + cloudOwner +
                 "' AND cloud-region.cloud-region-id = '" + cloudRegionId + "'";
         String queryPrefix ="urlInfo";
         String resourceType = "cloud-region";
index cc3e804..853565f 100644 (file)
@@ -79,6 +79,24 @@ public class AAIResourceNode implements SvcLogicJavaPlugin {
             AaiService aai = getAaiService();
             aai.getGenericVnfInfo(inParams, ctx);
 
+            String cloudOwnerValue=ctx.getAttribute(responsePrefix + "vm[0].cloud-owner");
+            String cloudRegionValue=ctx.getAttribute(responsePrefix + "vm[0].cloud-region-id");
+
+            log.debug("Cloud Owner" + cloudOwnerValue);
+            log.debug("CloudRegionId" + cloudOwnerValue);
+            SvcLogicContext cloudCtx = new SvcLogicContext();
+            Map<String, String> paramsCloud = new HashMap<String, String>();
+            paramsCloud.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
+                    inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
+
+            if(StringUtils.isNotBlank(cloudOwnerValue)&&StringUtils.isNotBlank(cloudRegionValue)) {
+
+                paramsCloud.put("cloudOwner", cloudOwnerValue);
+                paramsCloud.put("cloudRegionId", cloudRegionValue);
+
+                aai.getIdentityUrl(paramsCloud, ctx);
+            }
+
             ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
                 AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
             log.info("getVnfInfo Successful ");
@@ -142,7 +160,7 @@ public class AAIResourceNode implements SvcLogicJavaPlugin {
                 vserverMap.put(PARAM_VSERVER_NAME, vmServerCtx.getAttribute(responsePrefix + "vm.vserver-name"));
                 vserverMap.put("vf-module-id", vmServerCtx.getAttribute(responsePrefix + "vm.vf-module-id"));
                 vserverMap.put(PARAM_VSERVER_SELFLINK, vmServerCtx.getAttribute(responsePrefix + "vm.vserver-selflink"));
-                
+
                 log.info("VSERVER-LINK VALUE:" + vmServerCtx.getAttribute(responsePrefix + "vm.vserver-selflink"));
 
                 // as Per 17.07 requirements we are supporting only one VNFC per VM.