X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=appc-outbound%2Fappc-aai-client%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Faai%2Fclient%2Faai%2FAaiService.java;fp=appc-outbound%2Fappc-aai-client%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Faai%2Fclient%2Faai%2FAaiService.java;h=b10abc47e0027f8a5ad5a2f40d0383e12556c85d;hb=9fec029349301e7bc54033a08270ca8707f4b9bd;hp=0f0f5a452b8668f284217ce79282d5f4877f3c21;hpb=41db847244b0ad79e1c9fe0caecddc2baae1372c;p=appc.git diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java index 0f0f5a452..b10abc47e 100644 --- a/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java +++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java @@ -149,6 +149,7 @@ public class AaiService { SvcLogicContext vmCtx = readResource(resourceKey, PARAM_VM_INFO, PARAM_VSERVER); ctx.setAttribute(prefix + "vm.prov-status", vmCtx.getAttribute("vmInfo.prov-status")); ctx.setAttribute(prefix + "vm.vserver-name", vmCtx.getAttribute("vmInfo.vserver-name")); + ctx.setAttribute(prefix + "vm.vserver-selflink", vmCtx.getAttribute("vmInfo.vserver-selflink")); String relLen = vmCtx.getAttribute("vmInfo.relationship-list.relationship_length"); int relationshipLength = 0; @@ -399,7 +400,7 @@ public class AaiService { if (SvcLogicResource.QueryStatus.SUCCESS.equals(response)) { log.info("Added VNFC SUCCESSFULLY " + vnfcName); } else if (SvcLogicResource.QueryStatus.FAILURE.equals(response)) { - throw new AaiServiceInternalException("VNFC Add failed for for vnfc_name " + vnfcName); + throw new AaiServiceInternalException("VNFC Add failed for vnfc_name " + vnfcName); } } @@ -760,4 +761,26 @@ public class AaiService { log.info("End - getModelVersionInfo"); } + + public void getIdentityUrl(Map params, SvcLogicContext ctx) throws Exception{ + log.info("Recieved getIdentityUrl call with params : "+params); + String prefix = params.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX); + prefix = StringUtils.isNotBlank(prefix) ? (prefix + ".") : ""; + + String cloudOwner = params.get("cloudOwner"); + String cloudRegionId = params.get("cloudRegionId"); + // per comment from git review, we need to sanitize the two parameters + // to avoid security issues + cloudOwner = cloudOwner.replaceAll("'", ""); + cloudRegionId = cloudRegionId.replaceAll("'", ""); + log.debug("cloudOwner" +cloudOwner +"," +"cloudRegionId"+ cloudRegionId); + String resourceKey = "cloud-region.cloud-owner = '" + cloudOwner + + "' AND cloud-region.cloud-region-id = '" + cloudRegionId + "'"; + String queryPrefix ="urlInfo"; + String resourceType = "cloud-region"; + SvcLogicContext urlCtx = readResource(resourceKey, queryPrefix, resourceType); + log.info("IdentityUrl: "+urlCtx.getAttribute("urlInfo.identity-url")); + ctx.setAttribute(prefix+"cloud-region.identity-url", urlCtx.getAttribute("urlInfo.identity-url")); + + } }