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.aai.domain.yang.VolumeGroups
28 import org.onap.so.bpmn.common.scripts.AaiUtil
29 import org.onap.so.bpmn.common.scripts.ExceptionUtil
30 import org.onap.so.bpmn.common.scripts.MsoUtils
31 import org.onap.so.bpmn.common.scripts.VfModuleBase
32 import org.onap.so.bpmn.core.RollbackData
33 import org.onap.so.bpmn.core.UrnPropertiesReader
34 import org.onap.so.bpmn.core.WorkflowException
35 import org.onap.so.bpmn.core.json.JsonUtils
36 import org.onap.so.client.aai.AAIObjectPlurals
37 import org.onap.so.client.aai.AAIObjectType
38 import org.onap.so.client.aai.AAIResourcesClient
39 import org.onap.so.client.aai.entities.uri.AAIResourceUri
40 import org.onap.so.client.aai.entities.uri.AAIUriFactory
41 import org.onap.so.constants.Defaults
42 import org.onap.so.db.catalog.beans.OrchestrationStatus
43 import org.onap.so.logger.MsoLogger
45 import javax.ws.rs.NotFoundException
47 class DoCreateVfModuleVolumeV2 extends VfModuleBase {
49 private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVfModuleVolumeV2.class)
50 String prefix='DCVFMODVOLV2_'
51 JsonUtils jsonUtil = new JsonUtils()
52 private ExceptionUtil exceptionUtil = new ExceptionUtil()
56 * Perform initial processing, such as request validation, initialization of variables, etc.
59 public void preProcessRequest(DelegateExecution execution) {
60 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
61 preProcessRequest(execution, isDebugEnabled)
64 public void preProcessRequest(DelegateExecution execution, isDebugLogEnabled) {
66 execution.setVariable("prefix",prefix)
67 execution.setVariable(prefix+'SuccessIndicator', false)
68 execution.setVariable(prefix+'isPONR', false)
70 displayInput(execution, isDebugLogEnabled)
71 setRollbackData(execution, isDebugLogEnabled)
72 setRollbackEnabled(execution, isDebugLogEnabled)
75 def tenantId = execution.getVariable("tenantId")
76 if (tenantId == null) {
77 String cloudConfiguration = execution.getVariable("cloudConfiguration")
78 tenantId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.tenantId")
79 execution.setVariable("tenantId", tenantId)
82 def cloudSiteId = execution.getVariable("lcpCloudRegionId")
83 if (cloudSiteId == null) {
84 String cloudConfiguration = execution.getVariable("cloudConfiguration")
85 cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.lcpCloudRegionId")
86 def cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.cloudOwner")
87 execution.setVariable("lcpCloudRegionId", cloudSiteId)
88 execution.setVariable("cloudOwner", cloudOwner)
91 // Extract attributes from modelInfo
92 String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
94 //modelCustomizationUuid
95 def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
96 execution.setVariable("modelCustomizationId", modelCustomizationUuid)
97 msoLogger.debug("modelCustomizationId: " + modelCustomizationUuid)
100 def modelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
101 execution.setVariable("modelName", modelName)
102 msoLogger.debug("modelName: " + modelName)
104 // The following is used on the get Generic Service Instance call
105 execution.setVariable('GENGS_type', 'service-instance')
110 * Display input variables
112 * @param isDebugLogEnabled
114 public void displayInput(DelegateExecution execution, isDebugLogEnabled) {
115 def input = ['mso-request-id', 'msoRequestId', 'isDebugLogEnabled', 'disableRollback', 'failIfExists', 'serviceInstanceId',
116 'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo', 'asdcServiceModelVersion',
117 'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
119 msoLogger.debug('Begin input: ')
121 msoLogger.debug(it + ': ' + execution.getVariable(it))
123 msoLogger.debug('End input.')
128 * Define and set rollbackdata object
130 * @param isDebugEnabled
132 public void setRollbackData(DelegateExecution execution, isDebugEnabled) {
133 def rollbackData = execution.getVariable("rollbackData")
134 if (rollbackData == null) {
135 rollbackData = new RollbackData()
137 def volumeGroupName = execution.getVariable('volumeGroupName')
138 rollbackData.put("DCVFMODULEVOL", "volumeGroupName", volumeGroupName)
139 execution.setVariable("rollbackData", rollbackData)
144 * Gets the service instance uri from aai
146 public void getServiceInstance(DelegateExecution execution) {
148 String serviceInstanceId = execution.getVariable('serviceInstanceId')
150 AAIResourcesClient resourceClient = new AAIResourcesClient()
151 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
153 if(!resourceClient.exists(uri)){
154 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
157 }catch(BpmnError e) {
159 }catch (Exception ex){
160 String msg = "Exception in getServiceInstance. " + ex.getMessage()
162 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, msg)
169 * @param isDebugEnabled
171 public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
173 def cloudRegion = execution.getVariable("lcpCloudRegionId")
174 msoLogger.debug('Request cloud region is: ' + cloudRegion)
176 AaiUtil aaiUtil = new AaiUtil(this)
178 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion)
179 def queryCloudRegionRequest = aaiUtil.createAaiUri(uri)
181 cloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
183 def aaiCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "AAI", cloudRegion)
184 if ((aaiCloudRegion != "ERROR")) {
185 execution.setVariable("lcpCloudRegionId", aaiCloudRegion)
186 msoLogger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
188 String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
189 msoLogger.debug(errorMessage)
190 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
193 def poCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
194 if ((poCloudRegion != "ERROR")) {
195 execution.setVariable("poLcpCloudRegionId", poCloudRegion)
196 msoLogger.debug("AIC Cloud Region for PO: " + poCloudRegion)
198 String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
199 msoLogger.debug(errorMessage)
200 (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
203 def rollbackData = execution.getVariable("rollbackData")
204 rollbackData.put("DCVFMODULEVOL", "aiccloudregion", cloudRegion)
209 * Query AAI volume group by name
211 * @param isDebugEnabled
213 public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
215 def volumeGroupName = execution.getVariable('volumeGroupName')
216 def cloudRegion = execution.getVariable('lcpCloudRegionId')
219 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
220 Optional<VolumeGroups> volumeGroups = getAAIClient().get(VolumeGroups.class,uri)
221 if(volumeGroups.isPresent()){
222 VolumeGroup volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
223 execution.setVariable(prefix+'AaiReturnCode', 200)
224 execution.setVariable("queriedVolumeGroupId",volumeGroup.getVolumeGroupId())
225 msoLogger.debug("Volume Group Name $volumeGroupName exists in AAI.")
227 execution.setVariable(prefix+'AaiReturnCode', 404)
228 exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Volume Group Name $volumeGroupName does not exist in AAI.")
230 }catch(BpmnError error){
233 execution.setVariable(prefix+'AaiReturnCode', 500)
234 exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Exception in get volume group by name: " + e.getMessage())
240 * Create a WorkflowException
242 * @param isDebugEnabled
244 public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage, isDebugEnabled) {
245 msoLogger.debug(errorMessage)
246 (new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
251 * Create a WorkflowException
253 * @param isDebugEnabled
255 public void handleError(DelegateExecution execution, isDebugEnabled) {
256 WorkflowException we = execution.getVariable('WorkflowException')
258 (new ExceptionUtil()).buildWorkflowException(execution, 2500, "Enexpected error encountered!")
260 throw new BpmnError("MSOWorkflowException")
265 * Create volume group in AAI
267 * @param isDebugEnabled
269 public void callRESTCreateAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
271 def vnfId = execution.getVariable('vnfId')
272 def volumeGroupId = execution.getVariable('volumeGroupId')
273 def volumeName = execution.getVariable("volumeGroupName")
274 def modelCustomizationId = execution.getVariable("modelCustomizationId")
275 def vnfType = execution.getVariable("vnfType")
276 def tenantId = execution.getVariable("tenantId")
277 def cloudRegion = execution.getVariable('lcpCloudRegionId')
278 def cloudOwner = execution.getVariable('cloudOwner')
280 def testGroupId = execution.getVariable('test-volume-group-id')
281 if (testGroupId != null && testGroupId.trim() != '') {
282 msoLogger.debug("test volumeGroupId is present: " + testGroupId)
283 volumeGroupId = testGroupId
284 execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
287 VolumeGroup volumeGroup = new VolumeGroup()
288 volumeGroup.setVolumeGroupId(volumeGroupId)
289 volumeGroup.setVolumeGroupName(volumeName)
290 volumeGroup.setVnfType(vnfType)
291 volumeGroup.setOrchestrationStatus(OrchestrationStatus.PENDING.toString())
292 volumeGroup.setModelCustomizationId(modelCustomizationId)
294 msoLogger.debug("volumeGroupId to be used: " + volumeGroupId)
296 AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
297 AAIResourceUri tenantUri = AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)
298 AAIResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
300 getAAIClient().create(volumeGroupUri, volumeGroup)
301 getAAIClient().connect(volumeGroupUri, vnfUri)
302 getAAIClient().connect(volumeGroupUri, tenantUri)
303 execution.setVariable("queriedVolumeGroupId", volumeGroupId)
304 RollbackData rollbackData = execution.getVariable("rollbackData")
305 rollbackData.put("DCVFMODULEVOL", "isAAIRollbackNeeded", "true")
306 } catch (NotFoundException ignored) {
307 execution.setVariable(prefix + "isErrorMessageException", true)
308 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to create volume group in AAI. Response code: 404")
309 } catch (Exception ex) {
310 execution.setVariable(prefix + "isErrorMessageException", true)
311 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, ex.getMessage())
316 * Prepare VNF adapter create request XML
319 public void prepareVnfAdapterCreateRequest(DelegateExecution execution, isDebugEnabled) {
321 GenericVnf aaiGenericVnfResponse = execution.getVariable(prefix+'AAIQueryGenericVfnResponse')
322 def vnfId = aaiGenericVnfResponse.getVnfId()
323 def vnfName = aaiGenericVnfResponse.getVnfName()
324 def vnfType = aaiGenericVnfResponse.getVnfType()
326 def requestId = execution.getVariable('msoRequestId')
327 def serviceId = execution.getVariable('serviceInstanceId')
328 def cloudSiteId = execution.getVariable('poLcpCloudRegionId')
329 def tenantId = execution.getVariable('tenantId')
330 def volumeGroupId = execution.getVariable('volumeGroupId')
331 def volumeGroupnName = execution.getVariable('volumeGroupName')
333 def vnfVersion = execution.getVariable("asdcServiceModelVersion")
334 def vnfModuleType = execution.getVariable("modelName")
336 def modelCustomizationId = execution.getVariable("modelCustomizationId")
339 msoLogger.debug("volumeGroupId: " + volumeGroupId)
340 def testGroupId = execution.getVariable('test-volume-group-id')
341 if (testGroupId != null && testGroupId.trim() != '') {
342 msoLogger.debug("test volumeGroupId is present: " + testGroupId)
343 volumeGroupId = testGroupId
344 execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
346 msoLogger.debug("volumeGroupId to be used: " + volumeGroupId)
348 // volume group parameters
350 String volumeGroupParams = ''
351 StringBuilder sbParams = new StringBuilder()
352 Map<String, String> paramsMap = execution.getVariable("vfModuleInputParams")
353 for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
355 String paramName = entry.getKey()
356 String paramValue = entry.getValue()
359 <key>${MsoUtils.xmlEscape(paramName)}</key>
360 <value>${MsoUtils.xmlEscape(paramValue)}</value>
363 sbParams.append(paramsXml)
366 volumeGroupParams = sbParams.toString()
367 msoLogger.debug("volumeGroupParams: "+ volumeGroupParams)
369 def backoutOnFailure = execution.getVariable(prefix+"backoutOnFailure")
370 msoLogger.debug("backoutOnFailure: "+ backoutOnFailure)
372 def failIfExists = execution.getVariable("failIfExists")
373 if(failIfExists == null) {
374 failIfExists = 'true'
377 String messageId = UUID.randomUUID()
378 msoLogger.debug("messageId to be used is generated: " + messageId)
380 def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
381 def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
382 if ('true'.equals(useQualifiedHostName)) {
383 notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
385 msoLogger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
388 String vnfSubCreateWorkflowRequest =
390 <createVolumeGroupRequest>
391 <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
392 <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
393 <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
394 <vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
395 <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
396 <volumeGroupName>${MsoUtils.xmlEscape(volumeGroupnName)}</volumeGroupName>
397 <vnfType>${MsoUtils.xmlEscape(vnfType)}</vnfType>
398 <vnfVersion>${MsoUtils.xmlEscape(vnfVersion)}</vnfVersion>
399 <vfModuleType>${MsoUtils.xmlEscape(vnfModuleType)}</vfModuleType>
400 <modelCustomizationUuid>${MsoUtils.xmlEscape(modelCustomizationId)}</modelCustomizationUuid>
404 <value>${MsoUtils.xmlEscape(vnfId)}</value>
408 <value>${MsoUtils.xmlEscape(vnfName)}</value>
411 <key>vf_module_id</key>
412 <value>${MsoUtils.xmlEscape(volumeGroupId)}</value>
415 <key>vf_module_name</key>
416 <value>${MsoUtils.xmlEscape(volumeGroupnName)}</value>
420 <skipAAI>true</skipAAI>
421 <backout>${MsoUtils.xmlEscape(backoutOnFailure)}</backout>
422 <failIfExists>${MsoUtils.xmlEscape(failIfExists)}</failIfExists>
424 <requestId>${MsoUtils.xmlEscape(requestId)}</requestId>
425 <serviceInstanceId>${MsoUtils.xmlEscape(serviceId)}</serviceInstanceId>
427 <messageId>${MsoUtils.xmlEscape(messageId)}</messageId>
428 <notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
429 </createVolumeGroupRequest>
432 String vnfSubCreateWorkflowRequestAsString = utils.formatXml(vnfSubCreateWorkflowRequest)
433 msoLogger.debug(vnfSubCreateWorkflowRequestAsString)
434 msoLogger.debug(vnfSubCreateWorkflowRequestAsString)
435 execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
437 // build rollback request for use later if needed
438 String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
440 msoLogger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
442 String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
443 execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
446 public String buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl) {
449 <rollbackVolumeGroupRequest>
450 <volumeGroupRollback>
451 <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
452 <volumeGroupStackId>{{VOLUMEGROUPSTACKID}}</volumeGroupStackId>
453 <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
454 <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
455 <volumeGroupCreated>true</volumeGroupCreated>
457 <requestId>${MsoUtils.xmlEscape(requestId)}</requestId>
458 <serviceInstanceId>${MsoUtils.xmlEscape(serviceId)}</serviceInstanceId>
460 <messageId>${MsoUtils.xmlEscape(messageId)}</messageId>
461 </volumeGroupRollback>
462 <skipAAI>true</skipAAI>
463 <notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
464 </rollbackVolumeGroupRequest>
470 public String updateRollbackVolumeGroupRequestXml(String rollabackRequest, String heatStackId) {
471 String newRequest = rollabackRequest.replace("{{VOLUMEGROUPSTACKID}}", heatStackId)
476 * Validate VNF adapter response
479 public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
480 def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
481 msoLogger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
482 if(vnfSuccess==true) {
483 String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
484 String heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
485 String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
486 String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
487 msoLogger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
488 RollbackData rollbackData = execution.getVariable("rollbackData")
489 rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
490 rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
496 * Update voulume group in AAI
497 * @TODO: Can we re-use the create method??
499 * @param isDebugEnabled
501 public void callRESTUpdateCreatedVolGrpName(DelegateExecution execution, isDebugEnabled) {
502 String volumeGroupId = execution.getVariable("queriedVolumeGroupId")
503 String modelCustomizationId = execution.getVariable("modelCustomizationId")
504 String cloudRegion = execution.getVariable("lcpCloudRegionId")
505 String cloudOwner = execution.getVariable('cloudOwner')
506 String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
507 def heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
508 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
510 execution.setVariable(prefix+"heatStackId", heatStackID)
512 VolumeGroup volumeGroup = new VolumeGroup()
513 volumeGroup.setHeatStackId(heatStackID)
514 volumeGroup.setModelCustomizationId(modelCustomizationId)
516 getAAIClient().update(uri, volumeGroup)
517 execution.setVariable(prefix+"isPONR", true)
518 }catch(NotFoundException ignored){
519 execution.setVariable(prefix+"isErrorMessageException", true)
520 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to update volume group in AAI. Response code: 404")
521 }catch(BpmnError error){
524 execution.setVariable(prefix+"isErrorMessageException", true)
525 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Adapter Query Failed. "+ e.getMessage())
531 * Query AAI Generic VNF
533 * @param isDebugEnabled
535 public void callRESTQueryAAIGenericVnf(DelegateExecution execution, isDebugEnabled) {
537 def vnfId = execution.getVariable('vnfId')
538 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
540 Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class, uri)
541 if (genericVnf.isPresent()) {
542 execution.setVariable(prefix + 'AAIQueryGenericVfnResponse', genericVnf.get())
544 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, 'Generic vnf ' + vnfId + ' was not found in AAI. Return code: 404.')
547 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Exception in get generic VNF: " + e.getMessage())