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.aai.tasks;
25 import java.util.List;
28 import org.onap.so.adapters.nwrest.CreateNetworkResponse;
29 import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
30 import org.onap.so.bpmn.common.BuildingBlockExecution;
31 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
32 import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
33 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
34 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
35 import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
36 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet;
38 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
39 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
40 import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
41 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
42 import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
43 import org.onap.so.client.exception.BBObjectNotFoundException;
44 import org.onap.so.client.exception.ExceptionBuilder;
45 import org.onap.so.client.orchestration.AAICollectionResources;
46 import org.onap.so.client.orchestration.AAIConfigurationResources;
47 import org.onap.so.client.orchestration.AAINetworkResources;
48 import org.onap.so.client.orchestration.AAIServiceInstanceResources;
49 import org.onap.so.client.orchestration.AAIVfModuleResources;
50 import org.onap.so.client.orchestration.AAIVnfResources;
51 import org.onap.so.client.orchestration.AAIVolumeGroupResources;
52 import org.onap.so.db.catalog.beans.OrchestrationStatus;
53 import org.slf4j.Logger;
54 import org.slf4j.LoggerFactory;
55 import org.springframework.beans.factory.annotation.Autowired;
56 import org.springframework.stereotype.Component;
59 public class AAIUpdateTasks {
60 private static final Logger logger = LoggerFactory.getLogger(AAIUpdateTasks.class);
61 private static final String ALACARTE = "aLaCarte";
62 private static final String MULTI_STAGE_DESIGN_OFF = "false";
63 private static final String MULTI_STAGE_DESIGN_ON = "true";
65 private AAIServiceInstanceResources aaiServiceInstanceResources;
67 private AAIVnfResources aaiVnfResources;
69 private AAIVfModuleResources aaiVfModuleResources;
71 private ExceptionBuilder exceptionUtil;
73 private ExtractPojosForBB extractPojosForBB;
75 private AAIVolumeGroupResources aaiVolumeGroupResources;
77 private AAINetworkResources aaiNetworkResources;
79 private AAICollectionResources aaiCollectionResources;
81 private AAIConfigurationResources aaiConfigurationResources;
83 public void updateOrchestrationStatusAssignedService(BuildingBlockExecution execution) {
85 ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
86 aaiServiceInstanceResources.updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ASSIGNED);
87 execution.setVariable("aaiServiceInstanceRollback", true);
88 } catch (Exception ex) {
89 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
93 public void updateOrchestrationStatusActiveService(BuildingBlockExecution execution) {
95 ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
96 aaiServiceInstanceResources.updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ACTIVE);
97 } catch (Exception ex) {
98 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
102 public void updateOrchestrationStatusAssignedVnf(BuildingBlockExecution execution) {
104 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
105 aaiVnfResources.updateOrchestrationStatusVnf(vnf,OrchestrationStatus.ASSIGNED);
106 } catch (Exception ex) {
107 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
111 public void updateOrchestrationStatusActiveVnf(BuildingBlockExecution execution) {
113 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
114 aaiVnfResources.updateOrchestrationStatusVnf(vnf,OrchestrationStatus.ACTIVE);
115 } catch (Exception ex) {
116 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
120 public void updateOrchestrationStatusAssignedVolumeGroup(BuildingBlockExecution execution) {
122 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
124 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
125 CloudRegion cloudRegion = gBBInput.getCloudRegion();
126 volumeGroup.setHeatStackId("");
127 aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ASSIGNED);
128 } catch (Exception ex) {
129 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
133 public void updateOrchestrationStatusActiveVolumeGroup(BuildingBlockExecution execution) {
135 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
137 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
138 CloudRegion cloudRegion = gBBInput.getCloudRegion();
140 aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ACTIVE);
141 } catch (Exception ex) {
142 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
146 public void updateOrchestrationStatusCreatedVolumeGroup(BuildingBlockExecution execution) {
148 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
150 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
151 CloudRegion cloudRegion = gBBInput.getCloudRegion();
153 aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.CREATED);
154 } catch (Exception ex) {
155 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
159 public void updateHeatStackIdVolumeGroup(BuildingBlockExecution execution) {
161 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
162 String heatStackId = execution.getVariable("heatStackId");
163 if (heatStackId == null) {
166 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
167 CloudRegion cloudRegion = gBBInput.getCloudRegion();
168 volumeGroup.setHeatStackId(heatStackId);
170 aaiVolumeGroupResources.updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
171 } catch (Exception ex) {
172 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
176 public void updateOrchestrationStatusAssignedVfModule(BuildingBlockExecution execution) {
178 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
179 vfModule.setHeatStackId("");
180 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
181 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.ASSIGNED);
182 } catch (Exception ex) {
183 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
187 public void updateOrchestrationStatusPendingActivationVfModule(BuildingBlockExecution execution) {
189 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
190 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
191 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.PENDING_ACTIVATION);
192 } catch (Exception ex) {
193 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
197 public void updateOrchestrationStatusAssignedOrPendingActivationVfModule(BuildingBlockExecution execution) {
199 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
200 vfModule.setHeatStackId("");
201 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
202 String multiStageDesign = MULTI_STAGE_DESIGN_OFF;
203 if (vnf.getModelInfoGenericVnf() != null) {
204 multiStageDesign = vnf.getModelInfoGenericVnf().getMultiStageDesign();
206 boolean aLaCarte = (boolean) execution.getVariable(ALACARTE);
207 if (aLaCarte && multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) {
208 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.PENDING_ACTIVATION);
211 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.ASSIGNED);
213 } catch (Exception ex) {
214 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
218 public void updateOrchestrationStatusCreatedVfModule(BuildingBlockExecution execution) {
220 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
221 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
222 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.CREATED);
223 } catch (Exception ex) {
224 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
228 public void updateOrchestrationStatusDeactivateVfModule(BuildingBlockExecution execution) {
229 execution.setVariable("aaiDeactivateVfModuleRollback", false);
231 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
232 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
233 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.CREATED);
234 execution.setVariable("aaiDeactivateVfModuleRollback", true);
235 } catch (Exception ex) {
236 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
241 * BPMN access method to update status of L3Network to Assigned in AAI
243 * @throws BBObjectNotFoundException
245 public void updateOrchestrationStatusAssignedNetwork(BuildingBlockExecution execution) {
246 updateNetwork(execution, OrchestrationStatus.ASSIGNED);
250 * BPMN access method to update status of L3Network to Active in AAI
252 * @throws BBObjectNotFoundException
254 public void updateOrchestrationStatusActiveNetwork(BuildingBlockExecution execution) {
255 updateNetwork(execution, OrchestrationStatus.ACTIVE);
259 * BPMN access method to update status of L3Network to Created in AAI
261 * @throws BBObjectNotFoundException
263 public void updateOrchestrationStatusCreatedNetwork(BuildingBlockExecution execution) {
264 updateNetwork(execution, OrchestrationStatus.CREATED);
267 protected void updateNetwork(BuildingBlockExecution execution, OrchestrationStatus status) {
269 L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
270 updateNetworkAAI(l3Network, status);
271 } catch (Exception ex) {
272 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
276 protected void updateNetworkAAI(L3Network l3Network, OrchestrationStatus status) {
277 L3Network copiedl3Network = l3Network.shallowCopyId();
279 copiedl3Network.setOrchestrationStatus(status);
280 l3Network.setOrchestrationStatus(status);
281 aaiNetworkResources.updateNetwork(copiedl3Network);
283 List<Subnet> subnets = l3Network.getSubnets();
284 if (subnets != null){
285 for (Subnet subnet : subnets){
286 Subnet copiedSubnet = subnet.shallowCopyId();
287 copiedSubnet.setOrchestrationStatus(status);
288 aaiNetworkResources.updateSubnet(copiedl3Network, copiedSubnet);
294 * BPMN access method to update status of L3Network Collection to Active in AAI
296 * @throws BBObjectNotFoundException
298 public void updateOrchestrationStatusActiveNetworkCollection(BuildingBlockExecution execution) {
299 execution.setVariable("aaiNetworkCollectionActivateRollback", false);
301 ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
302 Collection networkCollection = serviceInstance.getCollection();
303 Collection copiedNetworkCollection = networkCollection.shallowCopyId();
305 networkCollection.setOrchestrationStatus(OrchestrationStatus.ACTIVE);
306 copiedNetworkCollection.setOrchestrationStatus(OrchestrationStatus.ACTIVE);
307 aaiCollectionResources.updateCollection(copiedNetworkCollection);
308 execution.setVariable("aaiNetworkCollectionActivateRollback", true);
309 } catch (Exception ex) {
310 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
314 public void updateOrchestrationStatusActivateVfModule(BuildingBlockExecution execution) {
315 execution.setVariable("aaiActivateVfModuleRollback", false);
317 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
318 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
319 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ACTIVE);
320 execution.setVariable("aaiActivateVfModuleRollback", true);
321 } catch (Exception ex) {
322 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
326 public void updateHeatStackIdVfModule(BuildingBlockExecution execution) {
328 String heatStackId = execution.getVariable("heatStackId");
329 if (heatStackId == null) {
332 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
333 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
334 vfModule.setHeatStackId(heatStackId);
335 aaiVfModuleResources.updateHeatStackIdVfModule(vfModule, vnf);
336 } catch (Exception ex) {
337 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
342 * BPMN access method to update L3Network after it was created in cloud
346 public void updateNetworkCreated(BuildingBlockExecution execution) throws Exception {
347 execution.setVariable("aaiNetworkActivateRollback", false);
348 L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
349 L3Network copiedl3network = l3network.shallowCopyId();
350 CreateNetworkResponse response = execution.getVariable("createNetworkResponse");
352 if(response.getNetworkFqdn()!=null){
353 l3network.setContrailNetworkFqdn(response.getNetworkFqdn());
355 l3network.setOrchestrationStatus(OrchestrationStatus.CREATED);
356 l3network.setHeatStackId(response.getNetworkStackId());
357 l3network.setNeutronNetworkId(response.getNeutronNetworkId());
359 copiedl3network.setContrailNetworkFqdn(response.getNetworkFqdn());
360 copiedl3network.setOrchestrationStatus(OrchestrationStatus.CREATED);
361 copiedl3network.setHeatStackId(response.getNetworkStackId());
362 copiedl3network.setNeutronNetworkId(response.getNeutronNetworkId());
364 aaiNetworkResources.updateNetwork(copiedl3network);
366 Map<String, String> subnetMap = response.getSubnetMap();
367 List<Subnet> subnets = l3network.getSubnets();
368 if (subnets != null && subnetMap != null){
369 for (Subnet subnet: subnets){
370 Subnet copiedSubnet = subnet.shallowCopyId();
371 copiedSubnet.setNeutronSubnetId(subnetMap.get(copiedSubnet.getSubnetId()));
372 copiedSubnet.setOrchestrationStatus(OrchestrationStatus.CREATED);
373 aaiNetworkResources.updateSubnet(copiedl3network, copiedSubnet);
377 execution.setVariable("aaiNetworkActivateRollback", true);
378 } catch (Exception ex) {
379 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
384 * BPMN access method to update L3Network after it was updated in cloud
388 public void updateNetworkUpdated(BuildingBlockExecution execution) throws Exception {
389 L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
390 L3Network copiedl3network = l3network.shallowCopyId();
391 UpdateNetworkResponse response = execution.getVariable("updateNetworkResponse");
393 copiedl3network.setNeutronNetworkId(response.getNeutronNetworkId());
394 aaiNetworkResources.updateNetwork(copiedl3network);
396 Map<String, String> subnetMap = response.getSubnetMap();
397 List<Subnet> subnets = l3network.getSubnets();
398 if (subnets != null && subnetMap != null){
399 for (Subnet subnet: subnets){
400 Subnet copiedSubnet = subnet.shallowCopyId();
401 copiedSubnet.setNeutronSubnetId(subnetMap.get(copiedSubnet.getSubnetId()));
402 copiedSubnet.setOrchestrationStatus(OrchestrationStatus.CREATED);
403 aaiNetworkResources.updateSubnet(copiedl3network, copiedSubnet);
406 } catch (Exception ex) {
407 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
411 public void updateObjectNetwork(BuildingBlockExecution execution) {
413 L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
414 aaiNetworkResources.updateNetwork(l3network);
415 } catch(Exception ex) {
416 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
421 * BPMN access method to update ServiceInstance
424 public void updateServiceInstance(BuildingBlockExecution execution) {
426 ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
427 aaiServiceInstanceResources.updateServiceInstance(serviceInstance);
428 } catch (Exception ex) {
429 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
433 public void updateObjectVnf(BuildingBlockExecution execution) {
435 GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
436 aaiVnfResources.updateObjectVnf(genericVnf);
437 } catch(Exception ex) {
438 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
442 public void updateOrchestrationStatusDeleteVfModule(BuildingBlockExecution execution) {
443 execution.setVariable("aaiDeleteVfModuleRollback", false);
445 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
446 vfModule.setHeatStackId("");
447 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
449 VfModule copiedVfModule = vfModule.shallowCopyId();
450 copiedVfModule.setHeatStackId("");
451 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.ASSIGNED);
452 execution.setVariable("aaiDeleteVfModuleRollback", true);
453 } catch (Exception ex) {
454 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
458 public void updateModelVfModule(BuildingBlockExecution execution) {
460 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
461 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
462 aaiVfModuleResources.changeAssignVfModule(vfModule, vnf);
463 } catch (Exception ex) {
464 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
467 public void updateOrchestrationStatusActivateFabricConfiguration(BuildingBlockExecution execution) {
469 Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
470 aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ACTIVE);
471 } catch (Exception ex) {
472 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
476 public void updateOrchestrationStatusDeactivateFabricConfiguration(BuildingBlockExecution execution) {
478 Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
479 aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ASSIGNED);
480 } catch (Exception ex) {
481 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
485 public void updateIpv4OamAddressVnf(BuildingBlockExecution execution) {
487 String ipv4OamAddress = execution.getVariable("oamManagementV4Address");
488 if (ipv4OamAddress != null) {
489 GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
490 GenericVnf copiedGenericVnf = genericVnf.shallowCopyId();
492 genericVnf.setIpv4OamAddress(ipv4OamAddress);
493 copiedGenericVnf.setIpv4OamAddress(ipv4OamAddress);
495 aaiVnfResources.updateObjectVnf(copiedGenericVnf);
497 } catch(Exception ex) {
498 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
502 public void updateManagementV6AddressVnf(BuildingBlockExecution execution) {
504 String managementV6Address = execution.getVariable("oamManagementV6Address");
505 if (managementV6Address != null) {
506 GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
507 GenericVnf copiedGenericVnf = genericVnf.shallowCopyId();
509 genericVnf.setManagementV6Address(managementV6Address);
510 copiedGenericVnf.setManagementV6Address(managementV6Address);
512 aaiVnfResources.updateObjectVnf(copiedGenericVnf);
514 } catch(Exception ex) {
515 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
519 public void updateContrailServiceInstanceFqdnVfModule(BuildingBlockExecution execution) {
521 String contrailServiceInstanceFqdn = execution.getVariable("contrailServiceInstanceFqdn");
522 if (contrailServiceInstanceFqdn != null) {
523 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
524 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
525 vfModule.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdn);
526 aaiVfModuleResources.updateContrailServiceInstanceFqdnVfModule(vfModule, vnf);
528 } catch (Exception ex) {
529 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
533 public void updateOrchestrationStatusConfigAssignedVnf(BuildingBlockExecution execution) {
535 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
536 aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGASSIGNED);
537 } catch (Exception ex) {
538 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);