* See the License for the specific language governing permissions and
* limitations under the License.
*
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
* ============LICENSE_END=========================================================
*/
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;
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);
}
}
log.info("End - getModelVersionInfo");
}
+
+ public void getIdentityUrl(Map<String, String> 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 = "depth = '" + 0 + "' AND 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"));
+
+ }
}