diff options
author | sanket12345 <SX00562924@techmahindra.com> | 2022-08-30 21:33:06 +0530 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2022-10-03 19:46:40 +0000 |
commit | e00d3ee9b090f3ceb87ac187e3e1c700d8a74fa7 (patch) | |
tree | 8f791fd7a77dffcd2f542d51dbc04e274fb67298 /bpmn/so-bpmn-tasks/src/main/java | |
parent | e4ae66db0d0e1bcfd19ef875491a236519be515d (diff) |
Code & Workflow Enhancements for CNF - Upgrade
- Adding New Building Block : VfModuleUpgradeBB, which delgates Workflow to next BB by just changing AAI Orch_status, else WF fails during Orchestration flow validation DB lookup.
- Adding changes to BB Inputs to take new version VNF & VFM model details and pass to BBs, as done for Service-Macro-Upgrade.
- Adding new operations in CDS to skip execution,when SDC Model has skipCDS=True.
- Calling CNF Adapter with existing heatStackID & passing it for CNF-Upgrade with new customization details.
Issue-ID: SO-3857
Change-Id: I69f71f825b812d423f82f1a902dcb8567d8a6adb
Signed-off-by: sanket12345 <SX00562924@techmahindra.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
4 files changed, 9 insertions, 7 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java index ed01f2271f..5e3b781903 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java @@ -170,7 +170,7 @@ public class CnfAdapterCreateTasks { logger.debug("currentFlow: {}", currentFlow); String apiPath = "http://so-cnf-adapter:8090"; - if ("CreateVfModuleBB".equals(currentFlow)) { + if ("CreateVfModuleBB".equals(currentFlow) || ("UpgradeVfModuleBB".equals(currentFlow))) { apiPath = apiPath + "/api/cnf-adapter/v1/aai-update/"; } else if ("DeleteVfModuleBB".equals(currentFlow)) { apiPath = apiPath + "/api/cnf-adapter/v1/aai-delete/"; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterUpgradeTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterUpgradeTasks.java index 2eebde0687..4fd0aab397 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterUpgradeTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterUpgradeTasks.java @@ -90,7 +90,8 @@ public class CnfAdapterUpgradeTasks { Map<String, String> sdncDirectives = getSdncDirectives(paramsMap); UpgradeInstanceRequest upgradeInstanceRequest = upgradeInstanceRequest(vfModule, cloudRegion, sdncDirectives); - UpgradeInstanceResponse response = cnfAdapterClient.upgradeVfModule(upgradeInstanceRequest); + String heatStackId = vfModule.getHeatStackId(); + UpgradeInstanceResponse response = cnfAdapterClient.upgradeVfModule(upgradeInstanceRequest, heatStackId); execution.setVariable("heatStackId", response.getId()); } catch (Exception ex) { logger.error("Exception occurred", ex); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java index dc77ea1f0c..6df4f76a59 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java @@ -47,8 +47,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator { @Autowired private CatalogDbClient catalogDbClient; - private Set<String> vnfActions = - new HashSet<String>(Arrays.asList("config-assign", "config-deploy", "VnfConfigAssign", "VnfConfigDeploy")); + private Set<String> vnfActions = new HashSet<String>(Arrays.asList("config-assign", "config-deploy", + "VnfConfigAssign", "VnfConfigDeploy", "config-upgrade-assign", "config-upgrade-deploy")); private Set<String> vFModuleAction = new HashSet<String>(Arrays.asList("VfModuleConfigAssign", "VfModuleConfigDeploy")); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java index e8122e7784..82c0e4916e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java @@ -118,11 +118,12 @@ public class CnfAdapterClient { } @Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000)) - public UpgradeInstanceResponse upgradeVfModule(UpgradeInstanceRequest request) throws CnfAdapterClientException { + public UpgradeInstanceResponse upgradeVfModule(UpgradeInstanceRequest request, String heatStackId) + throws CnfAdapterClientException { try { String uri = "http://so-cnf-adapter:8090"; - String endpoint = UriBuilder.fromUri(uri).path("/api/cnf-adapter/v1/instance/{instanceID}/upgrade").build() - .toString(); + String endpoint = UriBuilder.fromUri(uri).path(INSTANCE_CREATE_PATH + "/" + heatStackId + "/upgrade") + .build().toString(); HttpEntity<?> entity = getHttpEntity(request); ResponseEntity<UpgradeInstanceResponse> result = restTemplate.exchange(endpoint, HttpMethod.POST, entity, UpgradeInstanceResponse.class); |