aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-01-12 09:12:23 -0500
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-08-04 08:55:43 -0400
commit30106b39d2ac1bc206134cfcb8fc73eb1f29b923 (patch)
treebe83e5d35925fdd87c39cba7607feaefc23c34b5 /bpmn/MSOCommonBPMN/src/main/java
parent872613eafe80034cca612bd93294286b3dbed4b1 (diff)
Add new endpoint and macro for service upgrade
This enables upgrading an existing service instance by updating its model UUID's in AAI and md-sal. Issue-ID: SO-3636 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: Ic5f067a1267053a61f46e2d9563ca4e4ac869bdf
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index 569f6b1c77..d39da5ee37 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -1249,7 +1249,8 @@ public class BBInputSetup implements JavaDelegate {
|| requestAction.equalsIgnoreCase("activateInstance")
|| requestAction.equalsIgnoreCase("activateFabricConfiguration")
|| requestAction.equalsIgnoreCase("recreateInstance")
- || requestAction.equalsIgnoreCase("replaceInstance")) {
+ || requestAction.equalsIgnoreCase("replaceInstance")
+ || requestAction.equalsIgnoreCase("upgradeInstance")) {
return getGBBMacroExistingService(executeBB, lookupKeyMap, bbName, requestAction,
requestDetails.getCloudConfiguration());
}
@@ -1429,7 +1430,13 @@ public class BBInputSetup implements JavaDelegate {
if (serviceInstanceId != null) {
aaiServiceInstance = bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId);
if (aaiServiceInstance != null) {
- service = bbInputSetupUtils.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+ String modelVersionId = aaiServiceInstance.getModelVersionId();
+ if ("upgradeInstance".equalsIgnoreCase(requestAction)) {
+ modelVersionId = requestDetails.getModelInfo().getModelVersionId();
+ }
+
+ service = bbInputSetupUtils.getCatalogServiceByModelUUID(modelVersionId);
+
if (service == null) {
String message = String.format(
"Related service instance model not found in MSO CatalogDB: model-version-id=%s",