2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.aai.client.node;
27 import com.att.eelf.configuration.EELFLogger;
28 import com.att.eelf.configuration.EELFManager;
29 import java.util.ArrayList;
30 import java.util.Collections;
31 import java.util.Comparator;
32 import java.util.HashMap;
33 import java.util.List;
35 import java.util.Map.Entry;
36 import org.apache.commons.lang3.StringUtils;
37 import org.onap.appc.aai.client.AppcAaiClientConstant;
38 import org.onap.appc.aai.client.aai.AaiService;
39 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
40 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
41 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
43 public class AAIResourceNode implements SvcLogicJavaPlugin {
45 private static final EELFLogger log = EELFManager.getInstance().getLogger(AAIResourceNode.class);
47 private static final String STR_VSERVER_ID = "].vserver-id";
48 private static final String STR_TENANT_ID = "].tenant-id";
49 private static final String STR_CLOUD_OWNER = "].cloud-owner";
50 private static final String STR_CLOUD_REGION_ID = "].cloud-region-id";
51 private static final String STR_TMP_VNF_INFO = "tmp.vnfInfo.vm[";
53 private static final String PARAM_VSERVER_ID = "vserverId";
54 private static final String PARAM_TENANT_ID = "tenantId";
55 private static final String PARAM_CLOUD_OWNER = "cloudOwner";
56 private static final String PARAM_CLOUD_REGION_ID = "cloudRegionId";
57 private static final String PARAM_VSERVER_NAME = "vserver-name";
58 private static final String PARAM_VNFC_NAME = "vnfcName";
60 private static final String ATTR_VNF_VM_COUNT = "vnf.vm-count";
62 public AaiService getAaiService() {
63 return new AaiService();
66 /* Gets VNF Info and All VServers associated with Vnf */
67 public void getVnfInfo(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
69 log.info("Received getVnfInfo call with params : " + inParams);
71 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
75 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
76 AaiService aai = getAaiService();
77 aai.getGenericVnfInfo(inParams, ctx);
79 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
80 AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
81 log.info("getVnfInfo Successful ");
82 } catch (Exception e) {
83 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
84 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
85 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
86 log.error("Failed in getVnfInfo", e);
88 throw new SvcLogicException(e.getMessage());
93 public void getAllVServersVnfcsInfo(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
95 log.info("Received getAllVServersVnfcsInfo call with params : " + inParams);
97 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
100 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
101 AaiService aai = getAaiService();
103 ArrayList<Map<String, String>> vservers = new ArrayList<>();
105 int vmWithNoVnfcsCount = 0;
106 String vmCountStr = ctx.getAttribute(responsePrefix + "vm-count");
108 if (vmCountStr == null) {
109 throw new ResourceNodeInternalException("Unable to get VServers for the VNF");
112 int vmCount = Integer.parseInt(vmCountStr);
113 for (int i = 0; i < vmCount; i++) {
115 SvcLogicContext vmServerCtx = new SvcLogicContext();
117 Map<String, String> paramsVm = new HashMap<String, String>();
118 paramsVm.put(PARAM_VSERVER_ID, ctx.getAttribute(responsePrefix + "vm[" + i + STR_VSERVER_ID));
119 paramsVm.put(PARAM_TENANT_ID, ctx.getAttribute(responsePrefix + "vm[" + i + STR_TENANT_ID));
120 paramsVm.put(PARAM_CLOUD_OWNER, ctx.getAttribute(responsePrefix + "vm[" + i + STR_CLOUD_OWNER));
121 paramsVm.put(PARAM_CLOUD_REGION_ID, ctx.getAttribute(responsePrefix + "vm[" + i + STR_CLOUD_REGION_ID));
122 paramsVm.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
123 inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
125 aai.getVMInfo(paramsVm, vmServerCtx);
127 HashMap<String, String> vserverMap = new HashMap<String, String>();
128 vserverMap.put("vserver-id", ctx.getAttribute(responsePrefix + "vm[" + i + STR_VSERVER_ID));
129 vserverMap.put("tenant-id", ctx.getAttribute(responsePrefix + "vm[" + i + STR_TENANT_ID));
130 vserverMap.put("cloud-owner", ctx.getAttribute(responsePrefix + "vm[" + i + STR_CLOUD_OWNER));
131 vserverMap.put("cloud-region-id", ctx.getAttribute(responsePrefix + "vm[" + i + STR_CLOUD_REGION_ID));
133 // Parameters returned by getVMInfo
134 vserverMap.put(PARAM_VSERVER_NAME, vmServerCtx.getAttribute(responsePrefix + "vm.vserver-name"));
135 vserverMap.put("vf-module-id", vmServerCtx.getAttribute(responsePrefix + "vm.vf-module-id"));
137 // as Per 17.07 requirements we are supporting only one VNFC per VM.
139 String vnfcName = vmServerCtx.getAttribute(responsePrefix + "vm.vnfc[0].vnfc-name");
140 vserverMap.put("vnfc-name", vnfcName);
142 String vnfcCount = vmServerCtx.getAttribute(responsePrefix + "vm.vnfc-count");
143 if (vnfcCount == null) {
147 vserverMap.put("vnfc-count", vnfcCount);
149 if (vnfcName != null) {
150 Map<String, String> paramsVnfc = new HashMap<String, String>();
151 paramsVnfc.put(PARAM_VNFC_NAME, vnfcName);
153 paramsVnfc.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
154 inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
156 SvcLogicContext vnfcCtx = new SvcLogicContext();
158 aai.getVnfcInfo(paramsVnfc, vnfcCtx);
160 vserverMap.put("vnfc-type", vnfcCtx.getAttribute(responsePrefix + "vnfc.vnfc-type"));
162 .put("vnfc-function-code", vnfcCtx.getAttribute(responsePrefix + "vnfc.vnfc-function-code"));
163 vserverMap.put("group-notation", vnfcCtx.getAttribute(responsePrefix + "vnfc.group-notation"));
164 vserverMap.put("vnfc-ipaddress-v4-oam-vip",
165 vnfcCtx.getAttribute(responsePrefix + "vnfc.ipaddress-v4-oam-vip"));
168 vmWithNoVnfcsCount++;
170 vservers.add(vserverMap);
174 Collections.sort(vservers, Comparator.comparing(o -> o.get(PARAM_VSERVER_NAME)));
176 log.info("SORTED VSERVERS " + vservers.toString());
178 populateContext(vservers, ctx, responsePrefix);
180 log.info("VMCOUNT IN GETALLVSERVERS " + vmCount);
181 log.info("VMSWITHNOVNFCSCOUNT IN GETALLVSERVERS " + vmWithNoVnfcsCount);
182 ctx.setAttribute(responsePrefix + ATTR_VNF_VM_COUNT, String.valueOf(vmCount));
183 ctx.setAttribute(responsePrefix + "vnf.vm-with-no-vnfcs-count", String.valueOf(vmWithNoVnfcsCount));
186 } catch (Exception e) {
187 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
188 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
189 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
190 log.error("Failed in getAllVServersVnfcsInfo", e);
192 throw new SvcLogicException(e.getMessage());
196 public void populateContext(List<Map<String, String>> vservers, SvcLogicContext ctx, String prefix) {
198 log.info("Populating Final Context");
201 for (Map<String, String> input : vservers) {
202 for (Entry<String, String> entry : input.entrySet()) {
204 ctx.setAttribute(prefix + "vm[" + counter + "]." + entry.getKey(), entry.getValue());
205 log.info("Populating Context Key = " + prefix + "vm[" + counter + "]." + entry.getKey() + " Value = " + entry.getValue());
210 String firstVServerName = null;
211 for (int i = 0; i < counter; i++) {
212 String vnfcName = ctx.getAttribute(prefix + "vm[" + i + "].vnfc-name");
213 log.info("VNFCNAME " + i + vnfcName);
214 if (vnfcName == null && firstVServerName == null) {
215 firstVServerName = ctx.getAttribute(prefix + "vm[" + i + "].vserver-name");
216 ctx.setAttribute("vm-name", firstVServerName);
217 log.info("Populating Context Key = " + "vm-name" + " Value = " + firstVServerName);
223 public void addVnfcs(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
225 log.info("Received addVnfcs call with params : " + inParams);
227 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
231 int vmWithNoVnfcCount = 0;
235 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
236 AaiService aai = getAaiService();
238 //no:of vnfcs from the vnfc_reference table
239 String vnfcRefLenStr = ctx.getAttribute("vnfcReference_length");
241 vnfcRefLen = trySetVnfcRefLen(vnfcRefLenStr);
243 //Vms without vnfc from A&AI
244 String vmWithNoVnfcCountStr = ctx.getAttribute(responsePrefix + "vnf.vm-with-no-vnfcs-count");
247 if (vmWithNoVnfcCountStr == null) {
248 log.info("Parameter VM without VNFCs(vmWithNoVnfcCountStr) from A&AI is Null");
250 vmWithNoVnfcCount = Integer.parseInt(vmWithNoVnfcCountStr);
253 log.info("No of VM without VNFCs(vmWithNoVnfcCount) from A&AI is " + vmWithNoVnfcCount);
255 String vmCountStr = ctx.getAttribute(responsePrefix + ATTR_VNF_VM_COUNT);
257 if (vmCountStr == null) {
258 throw new ResourceNodeInternalException("VM data from A&AI is missing");
260 vmCount = Integer.parseInt(vmCountStr);
262 if (vmCount < vnfcRefLen) {
263 throw new ResourceNodeInternalException("Vnfc and VM count mismatch");
266 log.info("VMCOUNT " + vmCount);
267 log.info("VNFCREFLEN " + vnfcRefLen);
268 if (StringUtils.isBlank(ctx.getAttribute("vnfc-type"))) {
269 aai.updateVnfStatusWithOAMAddress(inParams, ctx);
272 aai.insertVnfcs(inParams, ctx, vnfcRefLen, vmCount);
274 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
275 AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
277 log.info("addVnfcs Successful ");
278 } catch (Exception e) {
279 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
280 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
281 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
282 log.error("Failed in addVnfcs", e);
284 throw new SvcLogicException(e.getMessage());
288 private int trySetVnfcRefLen(String vnfcRefLenStr) throws ResourceNodeInternalException {
290 if (vnfcRefLenStr == null) {
291 log.info("Vnfc Reference data is missing");
292 throw new ResourceNodeInternalException("Vnfc Reference data is missing");
295 return Integer.parseInt(vnfcRefLenStr);
300 public void updateVnfAndVServerStatus(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
302 log.info("Received updateVnfAndVServerStatus call with params : " + inParams);
304 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
310 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
311 AaiService aai = getAaiService();
313 String vmCountStr = ctx.getAttribute(responsePrefix + ATTR_VNF_VM_COUNT);
315 if (vmCountStr == null) {
316 throw new ResourceNodeInternalException("VM data from A&AI is missing");
318 vmCount = Integer.parseInt(vmCountStr);
321 log.info("VMCOUNT " + vmCount);
323 aai.updateVnfStatus(inParams, ctx);
324 aai.updateVServerStatus(inParams, ctx, vmCount);
326 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
327 AppcAaiClientConstant.OUTPUT_STATUS_SUCCESS);
329 log.info("updateVnfAndVServerStatus Successful ");
330 } catch (Exception e) {
331 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
332 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
333 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
334 log.error("Failed in updateVnfAndVServerStatus", e);
336 throw new SvcLogicException(e.getMessage());
340 public void getVserverInfo(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
341 log.info("getVserverInfo()::Retrieving vm and vnfc information for vserver:" + inParams.toString());
342 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
344 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
345 AaiService aaiService = getAaiService();
346 String vServerId = inParams.get(PARAM_VSERVER_ID);
347 Map<String, String> params = setVmParams(ctx, vServerId);
348 Map<String, String> vnfcParams = new HashMap<>();
349 if (null == params) {
350 log.error("getVserverInfo()::No Vm Info found!!");
351 throw new SvcLogicException("No Vm Info in Context");
353 params.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
354 inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
355 SvcLogicContext newVmCtx = new SvcLogicContext();
356 aaiService.getVMInfo(params, newVmCtx);
358 String vnfcName = newVmCtx.getAttribute(responsePrefix + "vm.vnfc[0].vnfc-name");
359 log.info("getVnfcFunctionCodeForVserver()::vnfcName=" + vnfcName);
360 SvcLogicContext newVnfcCtx = new SvcLogicContext();
361 if (StringUtils.isNotBlank(vnfcName)) {
362 vnfcParams.put(PARAM_VNFC_NAME, vnfcName);
364 log.info("getVserverInfo()::vnfc Name is blank, not setting vnfc info !!!!");
367 getVnfcInformationForVserver(vnfcParams, newVnfcCtx, inParams, ctx, aaiService, responsePrefix);
368 } catch (Exception e) {
369 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
370 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
371 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
372 log.error("Failed in getVserverInfo", e);
376 private void getVnfcInformationForVserver(Map<String, String> vnfcParams, SvcLogicContext newVnfcCtx,
377 Map<String, String> inParams, SvcLogicContext ctx, AaiService aaiService, String responsePrefix)
379 log.info("getVnfcInformationForVserver()::vnfcParams:" + vnfcParams.toString());
380 vnfcParams.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
381 inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
383 aaiService.getVnfcInfo(vnfcParams, newVnfcCtx);
385 String vnfcType = newVnfcCtx.getAttribute(responsePrefix + "vnfc.vnfc-type");
386 String vnfcFunctionCode = newVnfcCtx.getAttribute(responsePrefix + "vnfc.vnfc-function-code");
387 String vnfcGroupNotation = newVnfcCtx.getAttribute(responsePrefix + "vnfc.group-notation");
388 String vnfcV4OamIp = newVnfcCtx.getAttribute(responsePrefix + "vnfc.ipaddress-v4-oam-vip");
390 if (StringUtils.isBlank(vnfcType) || StringUtils.isBlank(vnfcFunctionCode)
391 || StringUtils.isBlank(vnfcGroupNotation) || StringUtils.isBlank(vnfcV4OamIp)) {
392 log.info("getVnfcInformationForVserver()::Some vnfc parameters are blank!!!!");
394 log.info("getVnfcInformationForVserver()::vnfcType=" + vnfcType + ",vnfcFunctionCode=" + vnfcFunctionCode,
395 ", vnfc-ipaddress-v4-oam-vip=" + vnfcV4OamIp);
396 ctx.setAttribute(responsePrefix + "vm.vnfc.vnfc-name", vnfcParams.get(PARAM_VNFC_NAME));
397 ctx.setAttribute(responsePrefix + "vm.vnfc.vnfc-type", vnfcType);
398 ctx.setAttribute(responsePrefix + "vm.vnfc.vnfc-function-code", vnfcFunctionCode);
399 ctx.setAttribute(responsePrefix + "vm.vnfc.vnfc-group-notation", vnfcGroupNotation);
400 ctx.setAttribute(responsePrefix + "vm.vnfc.vnfc-ipaddress-v4-oam-vip", vnfcV4OamIp);
403 private Map<String, String> setVmParams(SvcLogicContext ctx, String vServerId) {
404 log.info("setVmParams()::setVmParamsVM level action:" + vServerId);
405 Map<String, String> params = new HashMap<>();
408 String vmCountStr = ctx.getAttribute("tmp.vnfInfo.vm-count");
409 if (StringUtils.isNotBlank(vmCountStr)) {
410 vmCount = Integer.parseInt(vmCountStr);
412 for (int cnt = 0; cnt < vmCount; cnt++) {
413 String vsId = ctx.getAttribute(STR_TMP_VNF_INFO + cnt + STR_VSERVER_ID);
414 log.info("setVmParams():::vserver details::" + cnt + ":" + vsId);
415 if (StringUtils.equals(vServerId, vsId)) {
419 if (arrayIndex < 0) {
420 log.info("setVmParams()::VserverId not found in context!! Returning null for params!!");
423 String tenantId = ctx.getAttribute(STR_TMP_VNF_INFO + arrayIndex + STR_TENANT_ID);
424 String cloudOwner = ctx.getAttribute(STR_TMP_VNF_INFO + arrayIndex + STR_CLOUD_OWNER);
425 String cloudRegionId = ctx.getAttribute(STR_TMP_VNF_INFO + arrayIndex + STR_CLOUD_REGION_ID);
426 log.info("setVmParams()::tenantId=" + tenantId + " cloudOwner=" + cloudOwner + " cloudRegiodId= "
428 params.put(PARAM_VSERVER_ID, vServerId);
429 params.put(PARAM_TENANT_ID, tenantId);
430 params.put(PARAM_CLOUD_OWNER, cloudOwner);
431 params.put(PARAM_CLOUD_REGION_ID, cloudRegionId);
432 log.info("setVmParams()::setVmParamsVM level action:" + params.toString());
436 public void getVfModuleModelInfo(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
437 log.info("vfModuleInfo()::Retrieving vf-module information :" + inParams.toString());
438 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
440 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
441 AaiService aaiService = getAaiService();
442 processForVfModuleModelInfo(aaiService,inParams,ctx);
443 } catch (Exception e) {
444 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
445 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
446 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
447 log.error("Failed in vfModuleInfo", e);
451 public void processForVfModuleModelInfo(AaiService aaiService, Map<String, String> inParams, SvcLogicContext ctx) {
452 log.info("processForVfModuleModelInfo()::Retrieving vf-module information :" + inParams.toString());
453 String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX);
455 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
456 Map<String, String> params = new HashMap<>();
457 params.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
458 inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
459 params.put("vnfId", inParams.get("vnf-id"));
460 params.put("vfModuleId", inParams.get("vf-module-id"));
461 SvcLogicContext vfModuleCtx = new SvcLogicContext();
462 aaiService.getVfModuleInfo(params, vfModuleCtx);
464 String modelInvariantId = vfModuleCtx.getAttribute(responsePrefix + "vfModule.model-invariant-id");
465 String modelVersionId = vfModuleCtx.getAttribute(responsePrefix + "vfModule.model-version-id");
466 log.info("processForVfModuleModelInfo()::modelInvariantId=" + modelInvariantId+",modelVersionId="+modelVersionId);
468 Map<String, String> modelParams = new HashMap<>();
469 modelParams.put(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX,
470 inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX));
471 SvcLogicContext modelCtx = new SvcLogicContext();
472 if (StringUtils.isNotBlank(modelInvariantId) && StringUtils.isNotBlank(modelVersionId)) {
473 modelParams.put("model-invariant-id", modelInvariantId);
474 modelParams.put("model-version-id", modelVersionId);
477 log.info("processForVfModuleModelInfo()::model-invariant-id or model-version-id is blank, not getting model info !!!!");
480 aaiService.getModelVersionInfo(modelParams,modelCtx);
481 String modelName = modelCtx.getAttribute(responsePrefix+"vfModule.model-name");
482 log.info("processForVfModuleModelInfo()::modelName for vfModule:::"+modelName);
483 log.info("Setting context template-model-id as :::"+modelName);
484 ctx.setAttribute("template-model-id", modelName);
485 log.info("processForVfModuleModelInfo() ::: End");
487 catch (Exception e) {
488 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS,
489 AppcAaiClientConstant.OUTPUT_STATUS_FAILURE);
490 ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
491 log.error("Failed in vfModuleInfo", e);