X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=appc-config%2Fappc-flow-controller%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Fflow%2Fcontroller%2Fnode%2FInventoryInfoExtractor.java;fp=appc-config%2Fappc-flow-controller%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Fflow%2Fcontroller%2Fnode%2FInventoryInfoExtractor.java;h=631b72cc01aea521d6eab51fbf24f4d97e9e5275;hb=dc093f5f5cde53fb427712095f88bcebf225c599;hp=79a8635abc62f19008e3feaa4804c791d3e7211a;hpb=f03b15e20876902629d6a97f8b2f56049dbc7567;p=appc.git diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InventoryInfoExtractor.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InventoryInfoExtractor.java index 79a8635ab..631b72cc0 100644 --- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InventoryInfoExtractor.java +++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InventoryInfoExtractor.java @@ -3,6 +3,7 @@ * ONAP : APPC * ================================================================================ * Copyright (C) 2018 Nokia. All rights reserved. + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,13 +36,14 @@ class InventoryInfoExtractor { private static final EELFLogger log = EELFManager.getInstance().getLogger(InventoryInfoExtractor.class); - InventoryInfo getInventoryInfo(SvcLogicContext ctx, String vnfId) { + InventoryInfo getInventoryInfo(SvcLogicContext ctx, String vnfId) { String fn = "InventoryInfoExtractor.getInventoryInfo"; VnfInfo vnfInfo = new VnfInfo(); vnfInfo.setVnfId(vnfId); vnfInfo.setVnfName(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name")); vnfInfo.setVnfType(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type")); + vnfInfo.setIdentityUrl(getIdentityUrl(ctx,vnfInfo,vnfId)); String vmcount = ctx.getAttribute("tmp.vnfInfo.vm-count"); log.info(fn + "vmcount:" + vmcount); @@ -62,6 +64,7 @@ class InventoryInfoExtractor { private void processVm(SvcLogicContext ctx, VnfInfo vnfInfo, int index) { Vm vm = new Vm(); vm.setVserverId(ctx.getAttribute("tmp.vnfInfo.vm[" + index + "].vserver-id")); + vm.setVmId(ctx.getAttribute("tmp.vnfInfo.vm[" + index + "].vserver-selflink")); int vnfcCount = Integer.parseInt(ctx.getAttribute("tmp.vnfInfo.vm[" + index + "].vnfc-count")); if (vnfcCount > 0) { Vnfcslist vnfc = new Vnfcslist(); @@ -72,4 +75,24 @@ class InventoryInfoExtractor { vnfInfo.getVm().add(vm); } + + public String getIdentityUrl(SvcLogicContext ctx, VnfInfo vnfInfo, String vnfId) { + String identityUrl = ""; + for (String key : ctx.getAttributeKeySet()) { + log.debug("InventoryData " + key + "=" + ctx.getAttribute(key)); + } + String urlFromPayload= ctx.getAttribute("AICIdentity"); + log.info("Url from payload:" + urlFromPayload); + String urlFromAAI=ctx.getAttribute("tmp.vnfInfo.identity-url"); + + if(StringUtils.isNotBlank(urlFromPayload)){ + identityUrl=urlFromPayload; + }else if(StringUtils.isNotBlank(urlFromAAI)){ + identityUrl=urlFromAAI; + } + return identityUrl; + + + } + }