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;
27 import org.onap.so.adapters.nwrest.CreateNetworkResponse;
28 import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
29 import org.onap.so.bpmn.common.BuildingBlockExecution;
30 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
31 import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
32 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
33 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
34 import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
35 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
36 import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
38 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
39 import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
40 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
41 import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
42 import org.onap.so.client.exception.BBObjectNotFoundException;
43 import org.onap.so.client.exception.ExceptionBuilder;
44 import org.onap.so.client.orchestration.AAICollectionResources;
45 import org.onap.so.client.orchestration.AAIConfigurationResources;
46 import org.onap.so.client.orchestration.AAINetworkResources;
47 import org.onap.so.client.orchestration.AAIServiceInstanceResources;
48 import org.onap.so.client.orchestration.AAIVfModuleResources;
49 import org.onap.so.client.orchestration.AAIVnfResources;
50 import org.onap.so.client.orchestration.AAIVolumeGroupResources;
51 import org.onap.so.db.catalog.beans.OrchestrationStatus;
52 import org.slf4j.Logger;
53 import org.slf4j.LoggerFactory;
54 import org.springframework.beans.factory.annotation.Autowired;
55 import org.springframework.stereotype.Component;
58 public class AAIUpdateTasks {
59 private static final Logger logger = LoggerFactory.getLogger(AAIUpdateTasks.class);
60 private static final String ALACARTE = "aLaCarte";
61 private static final String MULTI_STAGE_DESIGN_OFF = "false";
62 private static final String MULTI_STAGE_DESIGN_ON = "true";
64 private AAIServiceInstanceResources aaiServiceInstanceResources;
66 private AAIVnfResources aaiVnfResources;
68 private AAIVfModuleResources aaiVfModuleResources;
70 private ExceptionBuilder exceptionUtil;
72 private ExtractPojosForBB extractPojosForBB;
74 private AAIVolumeGroupResources aaiVolumeGroupResources;
76 private AAINetworkResources aaiNetworkResources;
78 private AAICollectionResources aaiCollectionResources;
80 private AAIConfigurationResources aaiConfigurationResources;
82 public void updateOrchestrationStatusAssignedService(BuildingBlockExecution execution) {
84 ServiceInstance serviceInstance =
85 extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
86 aaiServiceInstanceResources.updateOrchestrationStatusServiceInstance(serviceInstance,
87 OrchestrationStatus.ASSIGNED);
88 execution.setVariable("aaiServiceInstanceRollback", true);
89 } catch (Exception ex) {
90 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
94 public void updateOrchestrationStatusActiveService(BuildingBlockExecution execution) {
96 ServiceInstance serviceInstance =
97 extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
98 aaiServiceInstanceResources.updateOrchestrationStatusServiceInstance(serviceInstance,
99 OrchestrationStatus.ACTIVE);
100 } catch (Exception ex) {
101 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
105 public void updateOrchestrationStatusAssignedVnf(BuildingBlockExecution execution) {
107 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
108 aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.ASSIGNED);
109 } catch (Exception ex) {
110 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
114 public void updateOrchestrationStatusActiveVnf(BuildingBlockExecution execution) {
116 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
117 aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.ACTIVE);
118 } catch (Exception ex) {
119 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
123 public void updateOrchestrationStatusAssignedVolumeGroup(BuildingBlockExecution execution) {
125 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
127 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
128 CloudRegion cloudRegion = gBBInput.getCloudRegion();
129 volumeGroup.setHeatStackId("");
130 aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion,
131 OrchestrationStatus.ASSIGNED);
132 } catch (Exception ex) {
133 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
137 public void updateOrchestrationStatusActiveVolumeGroup(BuildingBlockExecution execution) {
139 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
141 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
142 CloudRegion cloudRegion = gBBInput.getCloudRegion();
144 aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion,
145 OrchestrationStatus.ACTIVE);
146 } catch (Exception ex) {
147 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
151 public void updateOrchestrationStatusCreatedVolumeGroup(BuildingBlockExecution execution) {
153 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
155 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
156 CloudRegion cloudRegion = gBBInput.getCloudRegion();
158 aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion,
159 OrchestrationStatus.CREATED);
160 } catch (Exception ex) {
161 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
165 public void updateHeatStackIdVolumeGroup(BuildingBlockExecution execution) {
167 GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
168 String heatStackId = execution.getVariable("heatStackId");
169 if (heatStackId == null) {
172 VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
173 CloudRegion cloudRegion = gBBInput.getCloudRegion();
174 volumeGroup.setHeatStackId(heatStackId);
176 aaiVolumeGroupResources.updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
177 } catch (Exception ex) {
178 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
182 public void updateOrchestrationStatusAssignedVfModule(BuildingBlockExecution execution) {
184 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
185 vfModule.setHeatStackId("");
186 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
187 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
188 } catch (Exception ex) {
189 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
193 public void updateOrchestrationStatusPendingActivationVfModule(BuildingBlockExecution execution) {
195 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
196 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
197 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf,
198 OrchestrationStatus.PENDING_ACTIVATION);
199 } catch (Exception ex) {
200 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
204 public void updateOrchestrationStatusAssignedOrPendingActivationVfModule(BuildingBlockExecution execution) {
206 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
207 vfModule.setHeatStackId("");
208 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
209 String multiStageDesign = MULTI_STAGE_DESIGN_OFF;
210 if (vnf.getModelInfoGenericVnf() != null) {
211 multiStageDesign = vnf.getModelInfoGenericVnf().getMultiStageDesign();
213 boolean aLaCarte = (boolean) execution.getVariable(ALACARTE);
214 if (aLaCarte && multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) {
215 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf,
216 OrchestrationStatus.PENDING_ACTIVATION);
218 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
220 } catch (Exception ex) {
221 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
225 public void updateOrchestrationStatusCreatedVfModule(BuildingBlockExecution execution) {
227 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
228 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
229 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.CREATED);
230 } catch (Exception ex) {
231 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
235 public void updateOrchestrationStatusDeactivateVfModule(BuildingBlockExecution execution) {
236 execution.setVariable("aaiDeactivateVfModuleRollback", false);
238 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
239 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
240 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.CREATED);
241 execution.setVariable("aaiDeactivateVfModuleRollback", true);
242 } catch (Exception ex) {
243 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
248 * BPMN access method to update status of L3Network to Assigned in AAI
251 * @throws BBObjectNotFoundException
253 public void updateOrchestrationStatusAssignedNetwork(BuildingBlockExecution execution) {
254 updateNetwork(execution, OrchestrationStatus.ASSIGNED);
258 * BPMN access method to update status of L3Network to Active in AAI
261 * @throws BBObjectNotFoundException
263 public void updateOrchestrationStatusActiveNetwork(BuildingBlockExecution execution) {
264 updateNetwork(execution, OrchestrationStatus.ACTIVE);
268 * BPMN access method to update status of L3Network to Created in AAI
271 * @throws BBObjectNotFoundException
273 public void updateOrchestrationStatusCreatedNetwork(BuildingBlockExecution execution) {
274 updateNetwork(execution, OrchestrationStatus.CREATED);
277 protected void updateNetwork(BuildingBlockExecution execution, OrchestrationStatus status) {
279 L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
280 updateNetworkAAI(l3Network, status);
281 } catch (Exception ex) {
282 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
286 protected void updateNetworkAAI(L3Network l3Network, OrchestrationStatus status) {
287 L3Network copiedl3Network = l3Network.shallowCopyId();
289 copiedl3Network.setOrchestrationStatus(status);
290 l3Network.setOrchestrationStatus(status);
291 aaiNetworkResources.updateNetwork(copiedl3Network);
293 List<Subnet> subnets = l3Network.getSubnets();
294 if (subnets != null) {
295 for (Subnet subnet : subnets) {
296 Subnet copiedSubnet = subnet.shallowCopyId();
297 copiedSubnet.setOrchestrationStatus(status);
298 aaiNetworkResources.updateSubnet(copiedl3Network, copiedSubnet);
304 * BPMN access method to update status of L3Network Collection to Active in AAI
307 * @throws BBObjectNotFoundException
309 public void updateOrchestrationStatusActiveNetworkCollection(BuildingBlockExecution execution) {
310 execution.setVariable("aaiNetworkCollectionActivateRollback", false);
312 ServiceInstance serviceInstance =
313 extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
314 Collection networkCollection = serviceInstance.getCollection();
315 Collection copiedNetworkCollection = networkCollection.shallowCopyId();
317 networkCollection.setOrchestrationStatus(OrchestrationStatus.ACTIVE);
318 copiedNetworkCollection.setOrchestrationStatus(OrchestrationStatus.ACTIVE);
319 aaiCollectionResources.updateCollection(copiedNetworkCollection);
320 execution.setVariable("aaiNetworkCollectionActivateRollback", true);
321 } catch (Exception ex) {
322 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
326 public void updateOrchestrationStatusActivateVfModule(BuildingBlockExecution execution) {
327 execution.setVariable("aaiActivateVfModuleRollback", false);
329 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
330 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
331 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ACTIVE);
332 execution.setVariable("aaiActivateVfModuleRollback", true);
333 } catch (Exception ex) {
334 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
338 public void updateHeatStackIdVfModule(BuildingBlockExecution execution) {
340 String heatStackId = execution.getVariable("heatStackId");
341 if (heatStackId == null) {
344 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
345 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
346 vfModule.setHeatStackId(heatStackId);
347 aaiVfModuleResources.updateHeatStackIdVfModule(vfModule, vnf);
348 } catch (Exception ex) {
349 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
354 * BPMN access method to update L3Network after it was created in cloud
359 public void updateNetworkCreated(BuildingBlockExecution execution) throws Exception {
360 execution.setVariable("aaiNetworkActivateRollback", false);
361 L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
362 L3Network copiedl3network = l3network.shallowCopyId();
363 CreateNetworkResponse response = execution.getVariable("createNetworkResponse");
365 if (response.getNetworkFqdn() != null) {
366 l3network.setContrailNetworkFqdn(response.getNetworkFqdn());
368 l3network.setOrchestrationStatus(OrchestrationStatus.CREATED);
369 l3network.setHeatStackId(response.getNetworkStackId());
370 l3network.setNeutronNetworkId(response.getNeutronNetworkId());
372 copiedl3network.setContrailNetworkFqdn(response.getNetworkFqdn());
373 copiedl3network.setOrchestrationStatus(OrchestrationStatus.CREATED);
374 copiedl3network.setHeatStackId(response.getNetworkStackId());
375 copiedl3network.setNeutronNetworkId(response.getNeutronNetworkId());
377 aaiNetworkResources.updateNetwork(copiedl3network);
379 Map<String, String> subnetMap = response.getSubnetMap();
380 List<Subnet> subnets = l3network.getSubnets();
381 if (subnets != null && subnetMap != null) {
382 for (Subnet subnet : subnets) {
383 Subnet copiedSubnet = subnet.shallowCopyId();
384 copiedSubnet.setNeutronSubnetId(subnetMap.get(copiedSubnet.getSubnetId()));
385 copiedSubnet.setOrchestrationStatus(OrchestrationStatus.CREATED);
386 aaiNetworkResources.updateSubnet(copiedl3network, copiedSubnet);
390 execution.setVariable("aaiNetworkActivateRollback", true);
391 } catch (Exception ex) {
392 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
397 * BPMN access method to update L3Network after it was updated in cloud
402 public void updateNetworkUpdated(BuildingBlockExecution execution) throws Exception {
403 L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
404 L3Network copiedl3network = l3network.shallowCopyId();
405 UpdateNetworkResponse response = execution.getVariable("updateNetworkResponse");
407 copiedl3network.setNeutronNetworkId(response.getNeutronNetworkId());
408 aaiNetworkResources.updateNetwork(copiedl3network);
410 Map<String, String> subnetMap = response.getSubnetMap();
411 List<Subnet> subnets = l3network.getSubnets();
412 if (subnets != null && subnetMap != null) {
413 for (Subnet subnet : subnets) {
414 Subnet copiedSubnet = subnet.shallowCopyId();
415 copiedSubnet.setNeutronSubnetId(subnetMap.get(copiedSubnet.getSubnetId()));
416 copiedSubnet.setOrchestrationStatus(OrchestrationStatus.CREATED);
417 aaiNetworkResources.updateSubnet(copiedl3network, copiedSubnet);
420 } catch (Exception ex) {
421 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
425 public void updateObjectNetwork(BuildingBlockExecution execution) {
427 L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
428 aaiNetworkResources.updateNetwork(l3network);
429 } catch (Exception ex) {
430 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
435 * BPMN access method to update ServiceInstance
439 public void updateServiceInstance(BuildingBlockExecution execution) {
441 ServiceInstance serviceInstance =
442 extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
443 aaiServiceInstanceResources.updateServiceInstance(serviceInstance);
444 } catch (Exception ex) {
445 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
449 public void updateObjectVnf(BuildingBlockExecution execution) {
451 GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
452 aaiVnfResources.updateObjectVnf(genericVnf);
453 } catch (Exception ex) {
454 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
458 public void updateOrchestrationStatusDeleteVfModule(BuildingBlockExecution execution) {
459 execution.setVariable("aaiDeleteVfModuleRollback", false);
461 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
462 vfModule.setHeatStackId("");
463 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
465 VfModule copiedVfModule = vfModule.shallowCopyId();
466 copiedVfModule.setHeatStackId("");
467 aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
468 execution.setVariable("aaiDeleteVfModuleRollback", true);
469 } catch (Exception ex) {
470 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
474 public void updateModelVfModule(BuildingBlockExecution execution) {
476 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
477 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
478 aaiVfModuleResources.changeAssignVfModule(vfModule, vnf);
479 } catch (Exception ex) {
480 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
484 public void updateOrchestrationStatusAssignFabricConfiguration(BuildingBlockExecution execution) {
486 Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
487 aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration,
488 OrchestrationStatus.ASSIGNED);
489 } catch (Exception ex) {
490 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
494 public void updateOrchestrationStatusActivateFabricConfiguration(BuildingBlockExecution execution) {
496 Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
497 aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ACTIVE);
498 } catch (Exception ex) {
499 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
503 public void updateOrchestrationStatusDeactivateFabricConfiguration(BuildingBlockExecution execution) {
505 Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
506 aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration,
507 OrchestrationStatus.ASSIGNED);
508 } catch (Exception ex) {
509 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
513 public void updateIpv4OamAddressVnf(BuildingBlockExecution execution) {
515 String ipv4OamAddress = execution.getVariable("oamManagementV4Address");
516 if (ipv4OamAddress != null) {
517 GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
518 GenericVnf copiedGenericVnf = genericVnf.shallowCopyId();
520 genericVnf.setIpv4OamAddress(ipv4OamAddress);
521 copiedGenericVnf.setIpv4OamAddress(ipv4OamAddress);
523 aaiVnfResources.updateObjectVnf(copiedGenericVnf);
525 } catch (Exception ex) {
526 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
530 public void updateManagementV6AddressVnf(BuildingBlockExecution execution) {
532 String managementV6Address = execution.getVariable("oamManagementV6Address");
533 if (managementV6Address != null) {
534 GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
535 GenericVnf copiedGenericVnf = genericVnf.shallowCopyId();
537 genericVnf.setManagementV6Address(managementV6Address);
538 copiedGenericVnf.setManagementV6Address(managementV6Address);
540 aaiVnfResources.updateObjectVnf(copiedGenericVnf);
542 } catch (Exception ex) {
543 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
547 public void updateContrailServiceInstanceFqdnVfModule(BuildingBlockExecution execution) {
549 String contrailServiceInstanceFqdn = execution.getVariable("contrailServiceInstanceFqdn");
550 if (contrailServiceInstanceFqdn != null) {
551 VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
552 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
553 vfModule.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdn);
554 aaiVfModuleResources.updateContrailServiceInstanceFqdnVfModule(vfModule, vnf);
556 } catch (Exception ex) {
557 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
561 public void updateOrchestrationStatusConfigAssignedVnf(BuildingBlockExecution execution) {
563 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
564 aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGASSIGNED);
565 } catch (Exception ex) {
566 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
570 public void updateOrchestrationStausConfigDeployConfigureVnf(BuildingBlockExecution execution) {
572 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
573 aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURE);
575 } catch (Exception ex) {
576 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
581 public void updateOrchestrationStausConfigDeployConfiguredVnf(BuildingBlockExecution execution) {
583 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
584 aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURED);
586 } catch (Exception ex) {
587 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);