2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (c) 2019 Samsung
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.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.bpmn.infrastructure.scripts
25 import org.camunda.bpm.engine.delegate.BpmnError
26 import org.camunda.bpm.engine.delegate.DelegateExecution
27 import org.onap.aai.domain.yang.GenericVnf
28 import org.onap.aai.domain.yang.VolumeGroup
29 import org.onap.aai.domain.yang.VolumeGroups
30 import org.onap.so.bpmn.common.scripts.AaiUtil
31 import org.onap.so.bpmn.common.scripts.ExceptionUtil
32 import org.onap.so.bpmn.common.scripts.MsoUtils
33 import org.onap.so.bpmn.common.scripts.VfModuleBase
34 import org.onap.so.bpmn.core.RollbackData
35 import org.onap.so.bpmn.core.UrnPropertiesReader
36 import org.onap.so.bpmn.core.WorkflowException
37 import org.onap.so.bpmn.core.json.JsonUtils
38 import org.onap.so.client.aai.AAIObjectPlurals
39 import org.onap.so.client.aai.AAIObjectType
40 import org.onap.so.client.aai.AAIResourcesClient
41 import org.onap.so.client.aai.entities.uri.AAIResourceUri
42 import org.onap.so.client.aai.entities.uri.AAIUriFactory
43 import org.onap.so.constants.Defaults
44 import org.onap.so.db.catalog.beans.OrchestrationStatus
45 import org.slf4j.Logger
46 import org.slf4j.LoggerFactory
48 import javax.ws.rs.NotFoundException
50 class DoCreateVfModuleVolumeV2 extends VfModuleBase {
52 private static final Logger logger = LoggerFactory.getLogger( DoCreateVfModuleVolumeV2.class);
53 String prefix='DCVFMODVOLV2_'
54 JsonUtils jsonUtil = new JsonUtils()
55 private ExceptionUtil exceptionUtil = new ExceptionUtil()
59 * Perform initial processing, such as request validation, initialization of variables, etc.
62 public void preProcessRequest(DelegateExecution execution) {
63 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
64 preProcessRequest(execution, isDebugEnabled)
67 public void preProcessRequest(DelegateExecution execution, isDebugLogEnabled) {
69 execution.setVariable("prefix",prefix)
70 execution.setVariable(prefix+'SuccessIndicator', false)
71 execution.setVariable(prefix+'isPONR', false)
73 displayInput(execution, isDebugLogEnabled)
74 setRollbackData(execution, isDebugLogEnabled)
75 setRollbackEnabled(execution, isDebugLogEnabled)
78 def tenantId = execution.getVariable("tenantId")
79 if (tenantId == null) {
80 String cloudConfiguration = execution.getVariable("cloudConfiguration")
81 tenantId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.tenantId")
82 execution.setVariable("tenantId", tenantId)
85 def cloudSiteId = execution.getVariable("lcpCloudRegionId")
86 if (cloudSiteId == null) {
87 String cloudConfiguration = execution.getVariable("cloudConfiguration")
88 cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.lcpCloudRegionId")
89 def cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.cloudOwner")
90 execution.setVariable("lcpCloudRegionId", cloudSiteId)
91 execution.setVariable("cloudOwner", cloudOwner)
94 // Extract attributes from modelInfo
95 String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
97 //modelCustomizationUuid
98 def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
99 execution.setVariable("modelCustomizationId", modelCustomizationUuid)
100 logger.debug("modelCustomizationId: " + modelCustomizationUuid)
103 def modelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
104 execution.setVariable("modelName", modelName)
105 logger.debug("modelName: " + modelName)
107 // The following is used on the get Generic Service Instance call
108 execution.setVariable('GENGS_type', 'service-instance')
113 * Display input variables
115 * @param isDebugLogEnabled
117 public void displayInput(DelegateExecution execution, isDebugLogEnabled) {
118 def input = ['mso-request-id', 'msoRequestId', 'isDebugLogEnabled', 'disableRollback', 'failIfExists', 'serviceInstanceId',
119 'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo', 'asdcServiceModelVersion',
120 'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
122 logger.debug('Begin input: ')
124 logger.debug(it + ': ' + execution.getVariable(it))
126 logger.debug('End input.')
131 * Define and set rollbackdata object
133 * @param isDebugEnabled
135 public void setRollbackData(DelegateExecution execution, isDebugEnabled) {
136 def rollbackData = execution.getVariable("rollbackData")
137 if (rollbackData == null) {
138 rollbackData = new RollbackData()
140 def volumeGroupName = execution.getVariable('volumeGroupName')
141 rollbackData.put("DCVFMODULEVOL", "volumeGroupName", volumeGroupName)
142 execution.setVariable("rollbackData", rollbackData)
147 * Gets the service instance uri from aai
149 public void getServiceInstance(DelegateExecution execution) {
151 String serviceInstanceId = execution.getVariable('serviceInstanceId')
153 AAIResourcesClient resourceClient = new AAIResourcesClient()
154 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
156 if(!resourceClient.exists(uri)){
157 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
160 }catch(BpmnError e) {
162 }catch (Exception ex){
163 String msg = "Exception in getServiceInstance. " + ex.getMessage()
165 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, msg)
172 * @param isDebugEnabled
174 public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
176 def cloudRegion = execution.getVariable("lcpCloudRegionId")
177 logger.debug('Request cloud region is: ' + cloudRegion)
179 AaiUtil aaiUtil = new AaiUtil(this)
181 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion)
182 def queryCloudRegionRequest = aaiUtil.createAaiUri(uri)
184 cloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
186 def aaiCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "AAI", cloudRegion)
187 if ((aaiCloudRegion != "ERROR")) {
188 execution.setVariable("lcpCloudRegionId", aaiCloudRegion)
189 logger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
191 String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
192 logger.debug(errorMessage)
193 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
196 def poCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
197 if ((poCloudRegion != "ERROR")) {
198 execution.setVariable("poLcpCloudRegionId", poCloudRegion)
199 logger.debug("AIC Cloud Region for PO: " + poCloudRegion)
201 String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
202 logger.debug(errorMessage)
203 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
206 def rollbackData = execution.getVariable("rollbackData")
207 rollbackData.put("DCVFMODULEVOL", "aiccloudregion", cloudRegion)
212 * Query AAI volume group by name
214 * @param isDebugEnabled
216 public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
218 def volumeGroupName = execution.getVariable('volumeGroupName')
219 def cloudRegion = execution.getVariable('lcpCloudRegionId')
222 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
223 Optional<VolumeGroups> volumeGroups = getAAIClient().get(VolumeGroups.class,uri)
224 if(volumeGroups.isPresent()){
225 VolumeGroup volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
226 execution.setVariable(prefix+'AaiReturnCode', 200)
227 execution.setVariable("queriedVolumeGroupId",volumeGroup.getVolumeGroupId())
228 logger.debug("Volume Group Name $volumeGroupName exists in AAI.")
230 execution.setVariable(prefix+'AaiReturnCode', 404)
231 exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Volume Group Name $volumeGroupName does not exist in AAI.")
233 }catch(BpmnError error){
236 execution.setVariable(prefix+'AaiReturnCode', 500)
237 exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Exception in get volume group by name: " + e.getMessage())
243 * Create a WorkflowException
245 * @param isDebugEnabled
247 public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage) {
248 logger.debug(errorMessage)
249 (new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
254 * Create a WorkflowException
256 * @param isDebugEnabled
258 public void handleError(DelegateExecution execution, isDebugEnabled) {
259 WorkflowException we = execution.getVariable('WorkflowException')
261 (new ExceptionUtil()).buildWorkflowException(execution, 2500, "Enexpected error encountered!")
263 throw new BpmnError("MSOWorkflowException")
268 * Create volume group in AAI
270 * @param isDebugEnabled
272 public void callRESTCreateAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
274 def vnfId = execution.getVariable('vnfId')
275 def volumeGroupId = execution.getVariable('volumeGroupId')
276 def volumeName = execution.getVariable("volumeGroupName")
277 def modelCustomizationId = execution.getVariable("modelCustomizationId")
278 def vnfType = execution.getVariable("vnfType")
279 def tenantId = execution.getVariable("tenantId")
280 def cloudRegion = execution.getVariable('lcpCloudRegionId')
281 def cloudOwner = execution.getVariable('cloudOwner')
283 def testGroupId = execution.getVariable('test-volume-group-id')
284 if (testGroupId != null && testGroupId.trim() != '') {
285 logger.debug("test volumeGroupId is present: " + testGroupId)
286 volumeGroupId = testGroupId
287 execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
290 VolumeGroup volumeGroup = new VolumeGroup()
291 volumeGroup.setVolumeGroupId(volumeGroupId)
292 volumeGroup.setVolumeGroupName(volumeName)
293 volumeGroup.setVnfType(vnfType)
294 volumeGroup.setOrchestrationStatus(OrchestrationStatus.PENDING.toString())
295 volumeGroup.setModelCustomizationId(modelCustomizationId)
297 logger.debug("volumeGroupId to be used: " + volumeGroupId)
299 AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
300 AAIResourceUri tenantUri = AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)
301 AAIResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
303 getAAIClient().create(volumeGroupUri, volumeGroup)
304 getAAIClient().connect(volumeGroupUri, vnfUri)
305 getAAIClient().connect(volumeGroupUri, tenantUri)
306 execution.setVariable("queriedVolumeGroupId", volumeGroupId)
307 RollbackData rollbackData = execution.getVariable("rollbackData")
308 rollbackData.put("DCVFMODULEVOL", "isAAIRollbackNeeded", "true")
309 } catch (NotFoundException ignored) {
310 execution.setVariable(prefix + "isErrorMessageException", true)
311 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to create volume group in AAI. Response code: 404")
312 } catch (Exception ex) {
313 execution.setVariable(prefix + "isErrorMessageException", true)
314 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, ex.getMessage())
319 * Prepare VNF adapter create request XML
322 public void prepareVnfAdapterCreateRequest(DelegateExecution execution, isDebugEnabled) {
324 GenericVnf aaiGenericVnfResponse = execution.getVariable(prefix+'AAIQueryGenericVfnResponse')
325 def vnfId = aaiGenericVnfResponse.getVnfId()
326 def vnfName = aaiGenericVnfResponse.getVnfName()
327 def vnfType = aaiGenericVnfResponse.getVnfType()
329 def requestId = execution.getVariable('msoRequestId')
330 def serviceId = execution.getVariable('serviceInstanceId')
331 def cloudSiteId = execution.getVariable('poLcpCloudRegionId')
332 def tenantId = execution.getVariable('tenantId')
333 def volumeGroupId = execution.getVariable('volumeGroupId')
334 def volumeGroupnName = execution.getVariable('volumeGroupName')
336 def vnfVersion = execution.getVariable("asdcServiceModelVersion")
337 def vnfModuleType = execution.getVariable("modelName")
339 def modelCustomizationId = execution.getVariable("modelCustomizationId")
342 logger.debug("volumeGroupId: " + volumeGroupId)
343 def testGroupId = execution.getVariable('test-volume-group-id')
344 if (testGroupId != null && testGroupId.trim() != '') {
345 logger.debug("test volumeGroupId is present: " + testGroupId)
346 volumeGroupId = testGroupId
347 execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
349 logger.debug("volumeGroupId to be used: " + volumeGroupId)
351 // volume group parameters
353 String volumeGroupParams = ''
354 StringBuilder sbParams = new StringBuilder()
355 Map<String, String> paramsMap = execution.getVariable("vfModuleInputParams")
356 for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
358 String paramName = entry.getKey()
359 String paramValue = entry.getValue()
362 <key>${MsoUtils.xmlEscape(paramName)}</key>
363 <value>${MsoUtils.xmlEscape(paramValue)}</value>
366 sbParams.append(paramsXml)
369 volumeGroupParams = sbParams.toString()
370 logger.debug("volumeGroupParams: "+ volumeGroupParams)
372 def backoutOnFailure = execution.getVariable(prefix+"backoutOnFailure")
373 logger.debug("backoutOnFailure: "+ backoutOnFailure)
375 def failIfExists = execution.getVariable("failIfExists")
376 if(failIfExists == null) {
377 failIfExists = 'true'
380 String messageId = UUID.randomUUID()
381 logger.debug("messageId to be used is generated: " + messageId)
383 def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
384 def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
385 if ('true'.equals(useQualifiedHostName)) {
386 notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
388 logger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
391 String vnfSubCreateWorkflowRequest =
393 <createVolumeGroupRequest>
394 <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
395 <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
396 <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
397 <vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
398 <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
399 <volumeGroupName>${MsoUtils.xmlEscape(volumeGroupnName)}</volumeGroupName>
400 <vnfType>${MsoUtils.xmlEscape(vnfType)}</vnfType>
401 <vnfVersion>${MsoUtils.xmlEscape(vnfVersion)}</vnfVersion>
402 <vfModuleType>${MsoUtils.xmlEscape(vnfModuleType)}</vfModuleType>
403 <modelCustomizationUuid>${MsoUtils.xmlEscape(modelCustomizationId)}</modelCustomizationUuid>
407 <value>${MsoUtils.xmlEscape(vnfId)}</value>
411 <value>${MsoUtils.xmlEscape(vnfName)}</value>
414 <key>vf_module_id</key>
415 <value>${MsoUtils.xmlEscape(volumeGroupId)}</value>
418 <key>vf_module_name</key>
419 <value>${MsoUtils.xmlEscape(volumeGroupnName)}</value>
423 <skipAAI>true</skipAAI>
424 <backout>${MsoUtils.xmlEscape(backoutOnFailure)}</backout>
425 <failIfExists>${MsoUtils.xmlEscape(failIfExists)}</failIfExists>
427 <requestId>${MsoUtils.xmlEscape(requestId)}</requestId>
428 <serviceInstanceId>${MsoUtils.xmlEscape(serviceId)}</serviceInstanceId>
430 <messageId>${MsoUtils.xmlEscape(messageId)}</messageId>
431 <notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
432 </createVolumeGroupRequest>
435 String vnfSubCreateWorkflowRequestAsString = utils.formatXml(vnfSubCreateWorkflowRequest)
436 logger.debug(vnfSubCreateWorkflowRequestAsString)
437 logger.debug(vnfSubCreateWorkflowRequestAsString)
438 execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
440 // build rollback request for use later if needed
441 String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
443 logger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
445 String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
446 execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
449 public String buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl) {
452 <rollbackVolumeGroupRequest>
453 <volumeGroupRollback>
454 <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
455 <volumeGroupStackId>{{VOLUMEGROUPSTACKID}}</volumeGroupStackId>
456 <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
457 <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
458 <volumeGroupCreated>true</volumeGroupCreated>
460 <requestId>${MsoUtils.xmlEscape(requestId)}</requestId>
461 <serviceInstanceId>${MsoUtils.xmlEscape(serviceId)}</serviceInstanceId>
463 <messageId>${MsoUtils.xmlEscape(messageId)}</messageId>
464 </volumeGroupRollback>
465 <skipAAI>true</skipAAI>
466 <notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
467 </rollbackVolumeGroupRequest>
473 public String updateRollbackVolumeGroupRequestXml(String rollabackRequest, String heatStackId) {
474 String newRequest = rollabackRequest.replace("{{VOLUMEGROUPSTACKID}}", heatStackId)
479 * Validate VNF adapter response
482 public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
483 def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
484 logger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
485 if(vnfSuccess==true) {
486 String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
487 String heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
488 String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
489 String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
490 logger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
491 RollbackData rollbackData = execution.getVariable("rollbackData")
492 rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
493 rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
499 * Update voulume group in AAI
500 * @TODO: Can we re-use the create method??
502 * @param isDebugEnabled
504 public void callRESTUpdateCreatedVolGrpName(DelegateExecution execution, isDebugEnabled) {
505 String volumeGroupId = execution.getVariable("queriedVolumeGroupId")
506 String modelCustomizationId = execution.getVariable("modelCustomizationId")
507 String cloudRegion = execution.getVariable("lcpCloudRegionId")
508 String cloudOwner = execution.getVariable('cloudOwner')
509 String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
510 def heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
511 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
513 execution.setVariable(prefix+"heatStackId", heatStackID)
515 VolumeGroup volumeGroup = new VolumeGroup()
516 volumeGroup.setHeatStackId(heatStackID)
517 volumeGroup.setModelCustomizationId(modelCustomizationId)
519 getAAIClient().update(uri, volumeGroup)
520 execution.setVariable(prefix+"isPONR", true)
521 }catch(NotFoundException ignored){
522 execution.setVariable(prefix+"isErrorMessageException", true)
523 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to update volume group in AAI. Response code: 404")
524 }catch(BpmnError error){
527 execution.setVariable(prefix+"isErrorMessageException", true)
528 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Adapter Query Failed. "+ e.getMessage())
534 * Query AAI Generic VNF
536 * @param isDebugEnabled
538 public void callRESTQueryAAIGenericVnf(DelegateExecution execution, isDebugEnabled) {
540 def vnfId = execution.getVariable('vnfId')
541 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
543 Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class, uri)
544 if (genericVnf.isPresent()) {
545 execution.setVariable(prefix + 'AAIQueryGenericVfnResponse', genericVnf.get())
547 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, 'Generic vnf ' + vnfId + ' was not found in AAI. Return code: 404.')
550 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Exception in get generic VNF: " + e.getMessage())