updateOrchestrationStatusForVfModule(execution, OrchestrationStatus.CREATED);
}
+ /**
+ * BPMN access method to update status of VfModule to Active in AAI
+ */
+ public void updateOrchestrationStatusActivateVfModule(BuildingBlockExecution execution) {
+ execution.setVariable("aaiActivateVfModuleRollback", false);
+ updateOrchestrationStatusForVfModule(execution, OrchestrationStatus.ACTIVE);
+ execution.setVariable("aaiActivateVfModuleRollback", true);
+ }
+
/**
* BPMN access method to update aaiDeactivateVfModuleRollback to true for deactivating the VfModule
*/
/**
* BPMN access method to update status of L3Network to Assigned in AAI
- *
- * @param execution
- * @throws BBObjectNotFoundException
*/
public void updateOrchestrationStatusAssignedNetwork(BuildingBlockExecution execution) {
updateNetwork(execution, OrchestrationStatus.ASSIGNED);
/**
* BPMN access method to update status of L3Network to Active in AAI
- *
- * @param execution
- * @throws BBObjectNotFoundException
*/
public void updateOrchestrationStatusActiveNetwork(BuildingBlockExecution execution) {
updateNetwork(execution, OrchestrationStatus.ACTIVE);
/**
* BPMN access method to update status of L3Network to Created in AAI
- *
- * @param execution
- * @throws BBObjectNotFoundException
*/
public void updateOrchestrationStatusCreatedNetwork(BuildingBlockExecution execution) {
updateNetwork(execution, OrchestrationStatus.CREATED);
/**
* BPMN access method to update status of L3Network Collection to Active in AAI
- *
- * @param execution
- * @throws BBObjectNotFoundException
*/
public void updateOrchestrationStatusActiveNetworkCollection(BuildingBlockExecution execution) {
execution.setVariable("aaiNetworkCollectionActivateRollback", false);
}
}
- /**
- * BPMN access method to update status of VfModule to Active in AAI
- *
- * @param execution
- */
- public void updateOrchestrationStatusActivateVfModule(BuildingBlockExecution execution) {
- execution.setVariable("aaiActivateVfModuleRollback", false);
- try {
- VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
- GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ACTIVE);
- execution.setVariable("aaiActivateVfModuleRollback", true);
- } catch (Exception ex) {
- logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActivateVfModule", ex);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
- }
- }
-
/**
* BPMN access method to update HeatStackId of VfModule in AAI
- *
- * @param execution
*/
public void updateHeatStackIdVfModule(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update L3Network after it was created in cloud
- *
- * @param execution
- * @throws Exception
*/
public void updateNetworkCreated(BuildingBlockExecution execution) throws Exception {
execution.setVariable("aaiNetworkActivateRollback", false);
/**
* BPMN access method to update L3Network after it was updated in cloud
- *
- * @param execution
- * @throws Exception
*/
public void updateNetworkUpdated(BuildingBlockExecution execution) throws Exception {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
/**
* BPMN access method to update L3Network Object
- *
- * @param execution
*/
public void updateObjectNetwork(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update ServiceInstance
- *
- * @param execution
*/
public void updateServiceInstance(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update Vnf Object
- *
- * @param execution
*/
public void updateObjectVnf(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update status of VfModuleRollback as true
- *
- * @param execution
*/
public void updateOrchestrationStatusDeleteVfModule(BuildingBlockExecution execution) {
execution.setVariable("aaiDeleteVfModuleRollback", false);
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
vfModule.setHeatStackId("");
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
-
- VfModule copiedVfModule = vfModule.shallowCopyId();
- copiedVfModule.setHeatStackId("");
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
execution.setVariable("aaiDeleteVfModuleRollback", true);
} catch (Exception ex) {
/**
* BPMN access method to update Model of VfModule
- *
- * @param execution
*/
public void updateModelVfModule(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update status of FabricConfiguration to Assigned in AAI
- *
- * @param execution
*/
public void updateOrchestrationStatusAssignFabricConfiguration(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update status of FabricConfiguration to Active in AAI
- *
- * @param execution
*/
public void updateOrchestrationStatusActivateFabricConfiguration(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update status of FabricConfiguration to deactive in AAI
- *
- * @param execution
*/
public void updateOrchestrationStatusDeactivateFabricConfiguration(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update Ipv4OamAddress of Vnf
- *
- * @param execution
*/
public void updateIpv4OamAddressVnf(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update ManagementV6Address of Vnf
- *
- * @param execution
*/
public void updateManagementV6AddressVnf(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update ContrailServiceInstanceFqdn of VfModule
- *
- * @param execution
*/
public void updateContrailServiceInstanceFqdnVfModule(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update status of Vnf to ConfigAssigned in AAI
- *
- * @param execution
*/
public void updateOrchestrationStatusConfigAssignedVnf(BuildingBlockExecution execution) {
try {
/**
* BPMN access method to update status of Vnf to Configure in AAI
- *
- * @param execution
*/
public void updateOrchestrationStatusConfigDeployConfigureVnf(BuildingBlockExecution execution) {
- try {
- GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURE);
-
- } catch (Exception ex) {
- logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigDeployConfigureVnf", ex);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
- }
+ updateOrchestrationStatusForVnf(execution, OrchestrationStatus.CONFIGURE);
}
/**
* BPMN access method to update status of Vnf to configured in AAI
- *
- * @param execution
*/
public void updateOrchestrationStatusConfigDeployConfiguredVnf(BuildingBlockExecution execution) {
- try {
- GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURED);
- } catch (Exception ex) {
- logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigDeployConfiguredVnf", ex);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
- }
- }
-
- /**
- * BPMN access method to update status of VNF/VF-Module based on SO scope and action.
- *
- * @param execution - BuildingBlockExecution
- * @param scope - SO scope (vnf/vfModule)
- * @param action - action (configAssign/configDeploy/configUndeploy etc..)
- */
- public void updateOrchestrationStatusForCds(BuildingBlockExecution execution, String scope, String action) {
- try {
- GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- OrchestrationStatus status = getOrchestrationStatus(action);
- switch (scope) {
- case "vnf":
- aaiVnfResources.updateOrchestrationStatusVnf(vnf, status);
- break;
- case "vfModule":
- VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
- aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, status);
- break;
- default:
- throw new IllegalArgumentException(
- "Invalid scope to update orchestration status for CDS : " + action);
- }
- } catch (Exception ex) {
- logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusForCds", ex);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
- }
- }
-
- private OrchestrationStatus getOrchestrationStatus(String action) {
- /**
- * At this state, OrcherstationStatus enum associated with configAssign and configDeploy. I am not sure which is
- * the correct approach. 1. Are we going to map each specific action to OrchestrationStauts ? 2. We will have
- * only one generic status for all actions ?
- */
-
- switch (action) {
- case "configAssign":
- return OrchestrationStatus.ASSIGNED;
- case "configDeploy":
- return OrchestrationStatus.CONFIGURED;
- default:
- throw new IllegalArgumentException("Invalid action to set Orchestration status: " + action);
- }
+ updateOrchestrationStatusForVnf(execution, OrchestrationStatus.CONFIGURED);
}
private void updateOrchestrationStatusForService(BuildingBlockExecution execution, OrchestrationStatus status) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
-
}