diff options
author | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2022-10-03 21:43:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-10-03 21:43:33 +0000 |
commit | 105066944adc715547cc7cc03dc3abfdd15567dc (patch) | |
tree | 35e127980c111b84dfea409eaef0002eb832754b /bpmn/so-bpmn-tasks | |
parent | adf747a4270d0bcd4d02df2402b5544a138479ea (diff) | |
parent | e00d3ee9b090f3ceb87ac187e3e1c700d8a74fa7 (diff) |
Merge "Code & Workflow Enhancements for CNF - Upgrade"
Diffstat (limited to 'bpmn/so-bpmn-tasks')
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); |