2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.bpmn.infrastructure.scripts
23 import org.camunda.bpm.engine.delegate.BpmnError
24 import org.camunda.bpm.engine.delegate.DelegateExecution
25 import org.onap.aai.domain.yang.GenericVnf
26 import org.onap.aai.domain.yang.VolumeGroup
27 import org.onap.so.bpmn.common.scripts.AaiUtil
28 import org.onap.so.bpmn.common.scripts.ExceptionUtil
29 import org.onap.so.bpmn.common.scripts.MsoUtils
30 import org.onap.so.bpmn.common.scripts.VfModuleBase
31 import org.onap.so.bpmn.core.RollbackData
32 import org.onap.so.bpmn.core.UrnPropertiesReader
33 import org.onap.so.bpmn.core.WorkflowException
34 import org.onap.so.bpmn.core.json.JsonUtils
35 import org.onap.so.client.aai.AAIObjectPlurals
36 import org.onap.so.client.aai.AAIObjectType
37 import org.onap.so.client.aai.AAIResourcesClient
38 import org.onap.so.client.aai.entities.uri.AAIResourceUri
39 import org.onap.so.client.aai.entities.uri.AAIUriFactory
40 import org.onap.so.constants.Defaults
41 import org.onap.so.db.catalog.beans.OrchestrationStatus
42 import org.onap.so.logger.MsoLogger
44 import javax.ws.rs.NotFoundException
46 class DoCreateVfModuleVolumeV2 extends VfModuleBase {
48 private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVfModuleVolumeV2.class)
49 String prefix='DCVFMODVOLV2_'
50 JsonUtils jsonUtil = new JsonUtils()
51 private ExceptionUtil exceptionUtil = new ExceptionUtil()
55 * Perform initial processing, such as request validation, initialization of variables, etc.
58 public void preProcessRequest(DelegateExecution execution) {
59 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
60 preProcessRequest(execution, isDebugEnabled)
63 public void preProcessRequest(DelegateExecution execution, isDebugLogEnabled) {
65 execution.setVariable("prefix",prefix)
66 execution.setVariable(prefix+'SuccessIndicator', false)
67 execution.setVariable(prefix+'isPONR', false)
69 displayInput(execution, isDebugLogEnabled)
70 setRollbackData(execution, isDebugLogEnabled)
71 setRollbackEnabled(execution, isDebugLogEnabled)
74 def tenantId = execution.getVariable("tenantId")
75 if (tenantId == null) {
76 String cloudConfiguration = execution.getVariable("cloudConfiguration")
77 tenantId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.tenantId")
78 execution.setVariable("tenantId", tenantId)
81 def cloudSiteId = execution.getVariable("lcpCloudRegionId")
82 if (cloudSiteId == null) {
83 String cloudConfiguration = execution.getVariable("cloudConfiguration")
84 cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.lcpCloudRegionId")
85 def cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.cloudOwner")
86 execution.setVariable("lcpCloudRegionId", cloudSiteId)
87 execution.setVariable("cloudOwner", cloudOwner)
90 // Extract attributes from modelInfo
91 String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
93 //modelCustomizationUuid
94 def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
95 execution.setVariable("modelCustomizationId", modelCustomizationUuid)
96 msoLogger.debug("modelCustomizationId: " + modelCustomizationUuid)
99 def modelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
100 execution.setVariable("modelName", modelName)
101 msoLogger.debug("modelName: " + modelName)
103 // The following is used on the get Generic Service Instance call
104 execution.setVariable('GENGS_type', 'service-instance')
109 * Display input variables
111 * @param isDebugLogEnabled
113 public void displayInput(DelegateExecution execution, isDebugLogEnabled) {
114 def input = ['mso-request-id', 'msoRequestId', 'isDebugLogEnabled', 'disableRollback', 'failIfExists', 'serviceInstanceId',
115 'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo', 'asdcServiceModelVersion',
116 'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
118 msoLogger.debug('Begin input: ')
120 msoLogger.debug(it + ': ' + execution.getVariable(it))
122 msoLogger.debug('End input.')
127 * Define and set rollbackdata object
129 * @param isDebugEnabled
131 public void setRollbackData(DelegateExecution execution, isDebugEnabled) {
132 def rollbackData = execution.getVariable("rollbackData")
133 if (rollbackData == null) {
134 rollbackData = new RollbackData()
136 def volumeGroupName = execution.getVariable('volumeGroupName')
137 rollbackData.put("DCVFMODULEVOL", "volumeGroupName", volumeGroupName)
138 execution.setVariable("rollbackData", rollbackData)
143 * Gets the service instance uri from aai
145 public void getServiceInstance(DelegateExecution execution) {
147 String serviceInstanceId = execution.getVariable('serviceInstanceId')
149 AAIResourcesClient resourceClient = new AAIResourcesClient()
150 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
152 if(!resourceClient.exists(uri)){
153 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
156 }catch(BpmnError e) {
158 }catch (Exception ex){
159 String msg = "Exception in getServiceInstance. " + ex.getMessage()
161 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, msg)
168 * @param isDebugEnabled
170 public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
172 def cloudRegion = execution.getVariable("lcpCloudRegionId")
173 msoLogger.debug('Request cloud region is: ' + cloudRegion)
175 AaiUtil aaiUtil = new AaiUtil(this)
177 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion)
178 def queryCloudRegionRequest = aaiUtil.createAaiUri(uri)
180 cloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
182 def aaiCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "AAI", cloudRegion)
183 if ((aaiCloudRegion != "ERROR")) {
184 execution.setVariable("lcpCloudRegionId", aaiCloudRegion)
185 msoLogger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
187 String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
188 msoLogger.debug(errorMessage)
189 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
192 def poCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
193 if ((poCloudRegion != "ERROR")) {
194 execution.setVariable("poLcpCloudRegionId", poCloudRegion)
195 msoLogger.debug("AIC Cloud Region for PO: " + poCloudRegion)
197 String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
198 msoLogger.debug(errorMessage)
199 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
202 def rollbackData = execution.getVariable("rollbackData")
203 rollbackData.put("DCVFMODULEVOL", "aiccloudregion", cloudRegion)
208 * Query AAI volume group by name
210 * @param isDebugEnabled
212 public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
214 def volumeGroupName = execution.getVariable('volumeGroupName')
215 def cloudRegion = execution.getVariable('lcpCloudRegionId')
218 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
219 Optional<VolumeGroup> volumeGroup = getAAIClient().get(VolumeGroup.class,uri)
220 if(volumeGroup.isPresent()){
221 execution.setVariable(prefix+'AaiReturnCode', 200)
222 execution.setVariable("queriedVolumeGroupId",volumeGroup.get().getVolumeGroupId())
223 msoLogger.debug("Volume Group Name $volumeGroupName exists in AAI.")
225 execution.setVariable(prefix+'AaiReturnCode', 404)
226 exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Volume Group Name $volumeGroupName does not exist in AAI.")
228 }catch(BpmnError error){
231 execution.setVariable(prefix+'AaiReturnCode', 500)
232 exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Exception in get volume group by name: " + e.getMessage())
238 * Create a WorkflowException
240 * @param isDebugEnabled
242 public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage, isDebugEnabled) {
243 msoLogger.debug(errorMessage)
244 (new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
249 * Create a WorkflowException
251 * @param isDebugEnabled
253 public void handleError(DelegateExecution execution, isDebugEnabled) {
254 WorkflowException we = execution.getVariable('WorkflowException')
256 (new ExceptionUtil()).buildWorkflowException(execution, 2500, "Enexpected error encountered!")
258 throw new BpmnError("MSOWorkflowException")
263 * Create volume group in AAI
265 * @param isDebugEnabled
267 public void callRESTCreateAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
269 def vnfId = execution.getVariable('vnfId')
270 def volumeGroupId = execution.getVariable('volumeGroupId')
271 def volumeName = execution.getVariable("volumeGroupName")
272 def modelCustomizationId = execution.getVariable("modelCustomizationId")
273 def vnfType = execution.getVariable("vnfType")
274 def tenantId = execution.getVariable("tenantId")
275 def cloudRegion = execution.getVariable('lcpCloudRegionId')
276 def cloudOwner = execution.getVariable('cloudOwner')
278 def testGroupId = execution.getVariable('test-volume-group-id')
279 if (testGroupId != null && testGroupId.trim() != '') {
280 msoLogger.debug("test volumeGroupId is present: " + testGroupId)
281 volumeGroupId = testGroupId
282 execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
285 VolumeGroup volumeGroup = new VolumeGroup()
286 volumeGroup.setVolumeGroupId(volumeGroupId)
287 volumeGroup.setVolumeGroupName(volumeName)
288 volumeGroup.setVnfType(vnfType)
289 volumeGroup.setOrchestrationStatus(OrchestrationStatus.PENDING.toString())
290 volumeGroup.setModelCustomizationId(modelCustomizationId)
292 msoLogger.debug("volumeGroupId to be used: " + volumeGroupId)
294 AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
295 AAIResourceUri tenantUri = AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)
296 AAIResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
298 getAAIClient().create(volumeGroupUri, volumeGroup)
299 getAAIClient().connect(volumeGroupUri, vnfUri)
300 getAAIClient().connect(volumeGroupUri, tenantUri)
301 RollbackData rollbackData = execution.getVariable("rollbackData")
302 rollbackData.put("DCVFMODULEVOL", "isAAIRollbackNeeded", "true")
303 } catch (NotFoundException ignored) {
304 execution.setVariable(prefix + "isErrorMessageException", true)
305 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to create volume group in AAI. Response code: 404")
306 } catch (Exception ex) {
307 execution.setVariable(prefix + "isErrorMessageException", true)
308 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, ex.getMessage())
313 * Prepare VNF adapter create request XML
316 public void prepareVnfAdapterCreateRequest(DelegateExecution execution, isDebugEnabled) {
318 GenericVnf aaiGenericVnfResponse = execution.getVariable(prefix+'AAIQueryGenericVfnResponse')
319 def vnfId = aaiGenericVnfResponse.getVnfId()
320 def vnfName = aaiGenericVnfResponse.getVnfName()
321 def vnfType = aaiGenericVnfResponse.getVnfType()
323 def requestId = execution.getVariable('msoRequestId')
324 def serviceId = execution.getVariable('serviceInstanceId')
325 def cloudSiteId = execution.getVariable('poLcpCloudRegionId')
326 def tenantId = execution.getVariable('tenantId')
327 def volumeGroupId = execution.getVariable('volumeGroupId')
328 def volumeGroupnName = execution.getVariable('volumeGroupName')
330 def vnfVersion = execution.getVariable("asdcServiceModelVersion")
331 def vnfModuleType = execution.getVariable("modelName")
333 def modelCustomizationId = execution.getVariable("modelCustomizationId")
336 msoLogger.debug("volumeGroupId: " + volumeGroupId)
337 def testGroupId = execution.getVariable('test-volume-group-id')
338 if (testGroupId != null && testGroupId.trim() != '') {
339 msoLogger.debug("test volumeGroupId is present: " + testGroupId)
340 volumeGroupId = testGroupId
341 execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
343 msoLogger.debug("volumeGroupId to be used: " + volumeGroupId)
345 // volume group parameters
347 String volumeGroupParams = ''
348 StringBuilder sbParams = new StringBuilder()
349 Map<String, String> paramsMap = execution.getVariable("vfModuleInputParams")
350 for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
352 String paramName = entry.getKey()
353 String paramValue = entry.getValue()
356 <key>${MsoUtils.xmlEscape(paramName)}</key>
357 <value>${MsoUtils.xmlEscape(paramValue)}</value>
360 sbParams.append(paramsXml)
363 volumeGroupParams = sbParams.toString()
364 msoLogger.debug("volumeGroupParams: "+ volumeGroupParams)
366 def backoutOnFailure = execution.getVariable(prefix+"backoutOnFailure")
367 msoLogger.debug("backoutOnFailure: "+ backoutOnFailure)
369 def failIfExists = execution.getVariable("failIfExists")
370 if(failIfExists == null) {
371 failIfExists = 'true'
374 String messageId = UUID.randomUUID()
375 msoLogger.debug("messageId to be used is generated: " + messageId)
377 def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
378 def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
379 if ('true'.equals(useQualifiedHostName)) {
380 notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
382 msoLogger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
385 String vnfSubCreateWorkflowRequest =
387 <createVolumeGroupRequest>
388 <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
389 <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
390 <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
391 <vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
392 <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
393 <volumeGroupName>${MsoUtils.xmlEscape(volumeGroupnName)}</volumeGroupName>
394 <vnfType>${MsoUtils.xmlEscape(vnfType)}</vnfType>
395 <vnfVersion>${MsoUtils.xmlEscape(vnfVersion)}</vnfVersion>
396 <vfModuleType>${MsoUtils.xmlEscape(vnfModuleType)}</vfModuleType>
397 <modelCustomizationUuid>${MsoUtils.xmlEscape(modelCustomizationId)}</modelCustomizationUuid>
401 <value>${MsoUtils.xmlEscape(vnfId)}</value>
405 <value>${MsoUtils.xmlEscape(vnfName)}</value>
408 <key>vf_module_id</key>
409 <value>${MsoUtils.xmlEscape(volumeGroupId)}</value>
412 <key>vf_module_name</key>
413 <value>${MsoUtils.xmlEscape(volumeGroupnName)}</value>
417 <skipAAI>true</skipAAI>
418 <backout>${MsoUtils.xmlEscape(backoutOnFailure)}</backout>
419 <failIfExists>${MsoUtils.xmlEscape(failIfExists)}</failIfExists>
421 <requestId>${MsoUtils.xmlEscape(requestId)}</requestId>
422 <serviceInstanceId>${MsoUtils.xmlEscape(serviceId)}</serviceInstanceId>
424 <messageId>${MsoUtils.xmlEscape(messageId)}</messageId>
425 <notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
426 </createVolumeGroupRequest>
429 String vnfSubCreateWorkflowRequestAsString = utils.formatXml(vnfSubCreateWorkflowRequest)
430 msoLogger.debug(vnfSubCreateWorkflowRequestAsString)
431 msoLogger.debug(vnfSubCreateWorkflowRequestAsString)
432 execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
434 // build rollback request for use later if needed
435 String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
437 msoLogger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
439 String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
440 execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
443 public String buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl) {
446 <rollbackVolumeGroupRequest>
447 <volumeGroupRollback>
448 <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
449 <volumeGroupStackId>{{VOLUMEGROUPSTACKID}}</volumeGroupStackId>
450 <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
451 <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
452 <volumeGroupCreated>true</volumeGroupCreated>
454 <requestId>${MsoUtils.xmlEscape(requestId)}</requestId>
455 <serviceInstanceId>${MsoUtils.xmlEscape(serviceId)}</serviceInstanceId>
457 <messageId>${MsoUtils.xmlEscape(messageId)}</messageId>
458 </volumeGroupRollback>
459 <skipAAI>true</skipAAI>
460 <notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
461 </rollbackVolumeGroupRequest>
467 public String updateRollbackVolumeGroupRequestXml(String rollabackRequest, String heatStackId) {
468 String newRequest = rollabackRequest.replace("{{VOLUMEGROUPSTACKID}}", heatStackId)
473 * Validate VNF adapter response
476 public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
477 def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
478 msoLogger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
479 if(vnfSuccess==true) {
480 String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
481 String heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
482 String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
483 String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
484 msoLogger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
485 RollbackData rollbackData = execution.getVariable("rollbackData")
486 rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
487 rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
493 * Update voulume group in AAI
494 * @TODO: Can we re-use the create method??
496 * @param isDebugEnabled
498 public void callRESTUpdateCreatedVolGrpName(DelegateExecution execution, isDebugEnabled) {
499 String volumeGroupId = execution.getVariable("queriedVolumeGroupId")
500 String modelCustomizationId = execution.getVariable("modelCustomizationId")
501 String cloudRegion = execution.getVariable("lcpCloudRegionId")
502 String cloudOwner = execution.getVariable('cloudOwner')
503 String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
504 def heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
505 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
507 execution.setVariable(prefix+"heatStackId", heatStackID)
509 VolumeGroup volumeGroup = new VolumeGroup()
510 volumeGroup.setHeatStackId(heatStackID)
511 volumeGroup.setModelCustomizationId(modelCustomizationId)
513 getAAIClient().update(uri, volumeGroup)
514 execution.setVariable(prefix+"isPONR", true)
515 }catch(NotFoundException ignored){
516 execution.setVariable(prefix+"isErrorMessageException", true)
517 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to update volume group in AAI. Response code: 404")
518 }catch(BpmnError error){
521 execution.setVariable(prefix+"isErrorMessageException", true)
522 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Adapter Query Failed. "+ e.getMessage())
528 * Query AAI Generic VNF
530 * @param isDebugEnabled
532 public void callRESTQueryAAIGenericVnf(DelegateExecution execution, isDebugEnabled) {
534 def vnfId = execution.getVariable('vnfId')
535 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
537 Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class, uri)
538 if (genericVnf.isPresent()) {
539 execution.setVariable(prefix + 'AAIQueryGenericVfnResponse', genericVnf.get())
541 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, 'Generic vnf ' + vnfId + ' was not found in AAI. Return code: 404.')
544 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Exception in get generic VNF: " + e.getMessage())