From 19efd68c8f8babdaf8a2eb7f78b4522940339da2 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Wed, 28 Mar 2018 11:25:31 -0400 Subject: ControllerType update for CM flows Change-Id: I42c60ba45baaf29fa5fe54a8bb7ffc0aab5622c7 Signed-off-by: Elena Kuleshov Issue-ID: SO-526 --- .../mso/bpmn/common/scripts/AppCClient.groovy | 7 +++- .../client/appc/ApplicationControllerAction.java | 47 +++++++++++----------- .../client/appc/ApplicationControllerClient.java | 18 +++++---- .../appc/ApplicationControllerOrchestrator.java | 4 +- .../appc/ApplicationControllerClientTest.java | 11 ++--- .../ApplicationControllerOrchestratorTest.java | 4 +- .../infrastructure/scripts/ReplaceVnfInfra.groovy | 8 +++- .../infrastructure/scripts/UpdateVnfInfra.groovy | 8 +++- .../infrastructure/scripts/VnfConfigUpdate.groovy | 10 ++++- .../infrastructure/scripts/VnfInPlaceUpdate.groovy | 8 +++- .../main/resources/process/ReplaceVnfInfra.bpmn | 11 ++++- .../src/main/resources/process/UpdateVnfInfra.bpmn | 9 ++++- .../main/resources/process/VnfConfigUpdate.bpmn | 7 +++- .../main/resources/process/VnfInPlaceUpdate.bpmn | 13 +++++- .../src/main/resources/subprocess/RollbackVnf.bpmn | 5 ++- .../InfrastructureFlows/ConfigVnf_VID_request.json | 1 + .../ReplaceVnf_VID_request.json | 1 + .../InfrastructureFlows/UpdateVnf_VID_request.json | 1 + .../VnfInPlaceUpdate_VID_request.json | 1 + .../src/test/resources/mso.bpmn.urn.properties | 4 +- 20 files changed, 124 insertions(+), 54 deletions(-) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy index 8df6af7adb..ca7eef8aa1 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy @@ -27,6 +27,8 @@ import java.util.UUID; * @param - vnfId * @param - action * @param - payload + * @param - vnfName + * @param - controllerType * * Outputs: * @param - errorcode @@ -72,7 +74,8 @@ public class AppCClient extends AbstractServiceTaskProcessor{ String vnfHostIpAddress = execution.getVariable('vnfHostIpAddress') String vmIdList = execution.getVariable("vmIdList") String identityUrl = execution.getVariable("identityUrl") - HashMap payloadInfo = new HashMap(); + String controllerType = execution.getVariable("controllerType") + HashMap payloadInfo = new HashMap(); payloadInfo.put("vnfName", vnfName) payloadInfo.put("aicIdentity", aicIdentity) payloadInfo.put("vnfHostIpAddress", vnfHostIpAddress) @@ -96,7 +99,7 @@ public class AppCClient extends AbstractServiceTaskProcessor{ ApplicationControllerAction client = new ApplicationControllerAction() utils.log("DEBUG", "Created Application Controller Action Object", isDebugLogEnabled) //PayloadInfo contains extra information that adds on to payload before making request to appc - client.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo) + client.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType) utils.log("DEBUG", "ran through the main method for Application Contoller", isDebugLogEnabled) appcCode = client.getErrorCode() appcMessage = client.getErrorMessage() diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerAction.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerAction.java index 8b870889ac..44da566ec7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerAction.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerAction.java @@ -46,8 +46,7 @@ public class ApplicationControllerAction { private String errorMessage = "Unable to reach App C Servers"; protected final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - public void runAppCCommand(Action action, String msoRequestId, String vnfId, Optional payload, HashMap payloadInfo){ - Status appCStatus = null; + public void runAppCCommand(Action action, String msoRequestId, String vnfId, Optional payload, HashMap payloadInfo, String controllerType){ Status appCStatus = null; try{ String vnfName = payloadInfo.getOrDefault("vnfName", ""); String aicIdentity = payloadInfo.getOrDefault("vnfName",""); @@ -56,21 +55,21 @@ public class ApplicationControllerAction { String identityUrl = payloadInfo.getOrDefault("identityUrl", ""); switch(action){ case ResumeTraffic: - appCStatus = resumeTrafficAction(msoRequestId, vnfId, vnfName); + appCStatus = resumeTrafficAction(msoRequestId, vnfId, vnfName, controllerType); break; case Start: case Stop: - appCStatus = startStopAction(action, msoRequestId, vnfId, aicIdentity); + appCStatus = startStopAction(action, msoRequestId, vnfId, aicIdentity, controllerType); break; case Unlock: case Lock: - appCStatus = client.vnfCommand(action, msoRequestId, vnfId, Optional.empty()); + appCStatus = client.vnfCommand(action, msoRequestId, vnfId, Optional.empty(), controllerType); break; case QuiesceTraffic: - appCStatus = quiesceTrafficAction(msoRequestId, vnfId, payload, vnfName); + appCStatus = quiesceTrafficAction(msoRequestId, vnfId, payload, vnfName, controllerType); break; case HealthCheck: - appCStatus = healthCheckAction(msoRequestId, vnfId, vnfName, vnfHostIpAddress); + appCStatus = healthCheckAction(msoRequestId, vnfId, vnfName, vnfHostIpAddress, controllerType); break; case Snapshot: String vmIds = JsonUtils.getJsonValue(vmIdList, "vmIds"); @@ -80,18 +79,18 @@ public class ApplicationControllerAction { int i = 0; while(i < vmIdJsonList.size()){ vmId = vmIdJsonList.get(i); - appCStatus = snapshotAction(msoRequestId, vnfId, vmId, identityUrl); + appCStatus = snapshotAction(msoRequestId, vnfId, vmId, identityUrl, controllerType); i++; } break; case ConfigModify: - appCStatus = payloadAction(action, msoRequestId, vnfId, payload); + appCStatus = payloadAction(action, msoRequestId, vnfId, payload, controllerType); break; case UpgradePreCheck: case UpgradePostCheck: case UpgradeSoftware: case UpgradeBackup: - appCStatus = upgradeAction(action,msoRequestId, vnfId, payload, vnfName); + appCStatus = upgradeAction(action,msoRequestId, vnfId, payload, vnfName, controllerType); break; default: errorMessage = "Unable to idenify Action request for AppCClient"; @@ -125,47 +124,47 @@ public class ApplicationControllerAction { } } - private Status payloadAction(Action action, String msoRequestId, String vnfId, Optional payload) throws JsonProcessingException, Exception{ + private Status payloadAction(Action action, String msoRequestId, String vnfId, Optional payload, String controllerType) throws JsonProcessingException, Exception{ if(!(payload.isPresent())){ throw new IllegalArgumentException("Payload is not present for " + action.toString()); } - return client.vnfCommand(action, msoRequestId, vnfId, payload); + return client.vnfCommand(action, msoRequestId, vnfId, payload, controllerType); } - private Status quiesceTrafficAction(String msoRequestId, String vnfId, Optional payload, String vnfName) throws JsonProcessingException, Exception{ + private Status quiesceTrafficAction(String msoRequestId, String vnfId, Optional payload, String vnfName, String controllerType) throws JsonProcessingException, Exception{ if(!(payload.isPresent())){ throw new IllegalArgumentException("Payload is not present for " + Action.QuiesceTraffic.toString()); } payload = PayloadClient.quiesceTrafficFormat(payload, vnfName); - return client.vnfCommand(Action.QuiesceTraffic, msoRequestId, vnfId, payload); + return client.vnfCommand(Action.QuiesceTraffic, msoRequestId, vnfId, payload, controllerType); } - private Status upgradeAction(Action action, String msoRequestId, String vnfId, Optional payload, String vnfName) throws JsonProcessingException, Exception{ + private Status upgradeAction(Action action, String msoRequestId, String vnfId, Optional payload, String vnfName, String controllerType) throws JsonProcessingException, Exception{ if(!(payload.isPresent())){ throw new IllegalArgumentException("Payload is not present for " + action.toString()); } payload = PayloadClient.upgradeFormat(payload, vnfName); - return client.vnfCommand(action, msoRequestId, vnfId, payload); + return client.vnfCommand(action, msoRequestId, vnfId, payload, controllerType); } - private Status resumeTrafficAction(String msoRequestId, String vnfId, String vnfName)throws JsonProcessingException, Exception{ + private Status resumeTrafficAction(String msoRequestId, String vnfId, String vnfName, String controllerType)throws JsonProcessingException, Exception{ Optional payload = PayloadClient.resumeTrafficFormat(vnfName); - return client.vnfCommand(Action.ResumeTraffic, msoRequestId, vnfId, payload); + return client.vnfCommand(Action.ResumeTraffic, msoRequestId, vnfId, payload, controllerType); } - private Status startStopAction(Action action, String msoRequestId, String vnfId, String aicIdentity)throws JsonProcessingException, Exception{ + private Status startStopAction(Action action, String msoRequestId, String vnfId, String aicIdentity, String controllerType)throws JsonProcessingException, Exception{ Optional payload = PayloadClient.startStopFormat(aicIdentity); - return client.vnfCommand(action, msoRequestId, vnfId, payload); + return client.vnfCommand(action, msoRequestId, vnfId, payload, controllerType); } - private Status healthCheckAction(String msoRequestId, String vnfId, String vnfName, String vnfHostIpAddress)throws JsonProcessingException, Exception{ + private Status healthCheckAction(String msoRequestId, String vnfId, String vnfName, String vnfHostIpAddress, String controllerType)throws JsonProcessingException, Exception{ Optional payload = PayloadClient.healthCheckFormat(vnfName, vnfHostIpAddress); - return client.vnfCommand(Action.HealthCheck, msoRequestId, vnfId, payload); + return client.vnfCommand(Action.HealthCheck, msoRequestId, vnfId, payload, controllerType); } - private Status snapshotAction(String msoRequestId, String vnfId, String vmId, String identityUrl) throws JsonProcessingException, Exception{ + private Status snapshotAction(String msoRequestId, String vnfId, String vmId, String identityUrl, String controllerType) throws JsonProcessingException, Exception{ Optional payload = PayloadClient.snapshotFormat(vmId, identityUrl); - return client.vnfCommand(Action.Snapshot, msoRequestId, vnfId, payload); + return client.vnfCommand(Action.Snapshot, msoRequestId, vnfId, payload, controllerType); } public String getErrorMessage(){ diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java index c383408488..8c57b9255c 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java @@ -60,11 +60,11 @@ public class ApplicationControllerClient { @Autowired public ApplicationControllerSupport appCSupport; - private static LifeCycleManagerStateful client; + private static LifeCycleManagerStateful client; - public ApplicationControllerClient() { + public ApplicationControllerClient(String controllerType) { appCSupport = new ApplicationControllerSupport(); - client = this.getAppCClient(); + client = this.getAppCClient(controllerType); } public Status runCommand(Action action, org.onap.appc.client.lcm.model.ActionIdentifiers actionIdentifiers, org.onap.appc.client.lcm.model.Payload payload, String requestID) @@ -81,27 +81,31 @@ public class ApplicationControllerClient { } } - public LifeCycleManagerStateful getAppCClient() { + public LifeCycleManagerStateful getAppCClient(String controllerType) { if (client == null) try { client = AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class) - .createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties()); + .createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties(controllerType)); } catch (AppcClientException e) { auditLogger.log(Level.ERROR, "Error in getting LifeCycleManagerStateful: ", e, e.getMessage()); } return client; } - protected Properties getLCMProperties() { + protected Properties getLCMProperties(String controllerType) { Properties properties = new Properties(); Map globalProperties = PropertyConfiguration.getInstance() .getProperties("mso.bpmn.urn.properties"); - + String controllerTypeValue = controllerType; + if (controllerType == null) { + controllerTypeValue = ""; + } properties.put("topic.read", globalProperties.get("appc.topic.read")); properties.put("topic.read.timeout", globalProperties.get("appc.topic.read.timeout")); properties.put("client.response.timeout", globalProperties.get("appc.client.response.timeout")); properties.put("topic.write", globalProperties.get("appc.topic.write")); properties.put("poolMembers", globalProperties.get("appc.poolMembers")); + properties.put("client.controllerType", controllerTypeValue); properties.put("client.key", globalProperties.get("appc.client.key")); properties.put("client.secret", globalProperties.get("appc.client.secret")); properties.put("client.name", CLIENT_NAME); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestrator.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestrator.java index 217525e56a..744be5f28f 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestrator.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestrator.java @@ -31,8 +31,8 @@ import org.onap.appc.client.lcm.model.Status; public class ApplicationControllerOrchestrator { - public Status vnfCommand(Action action, String requestId, String vnfId, Optional request) throws ApplicationControllerOrchestratorException { - ApplicationControllerClient client = new ApplicationControllerClient(); + public Status vnfCommand(Action action, String requestId, String vnfId, Optional request, String controllerType) throws ApplicationControllerOrchestratorException { + ApplicationControllerClient client = new ApplicationControllerClient(controllerType); Status status; ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); actionIdentifiers.setVnfId(vnfId); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java index 7fe32880c6..e737f5da16 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java @@ -43,7 +43,7 @@ public class ApplicationControllerClientTest { @Test public void createRequest_CheckLock_RequestBuilt() { - ApplicationControllerClient client = new ApplicationControllerClient(); + ApplicationControllerClient client = new ApplicationControllerClient("appc"); ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); actionIdentifiers.setVnfId("vnfId"); CheckLockInput checkLockInput = (CheckLockInput) client.createRequest(Action.CheckLock, actionIdentifiers, null, @@ -54,7 +54,7 @@ public class ApplicationControllerClientTest { @Test @Ignore // 1802 merge public void runCommand_liveAppc() { - ApplicationControllerClient client = new ApplicationControllerClient(); + ApplicationControllerClient client = new ApplicationControllerClient("appc"); ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); //actionIdentifiers.setVnfId("ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f"); actionIdentifiers.setVnfId("2d2bf10e-81a5-"); @@ -72,7 +72,7 @@ public class ApplicationControllerClientTest { @Test @Ignore // 1802 merge public void runCommand_CheckLock_RequestBuilt() { - ApplicationControllerClient client = new ApplicationControllerClient(); + ApplicationControllerClient client = new ApplicationControllerClient("appc"); ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); actionIdentifiers.setVnfId("fusion-vpp-vnf-001"); Status status; @@ -88,14 +88,15 @@ public class ApplicationControllerClientTest { @Test public void test_getLCMPropertiesHelper() { - ApplicationControllerClient client = new ApplicationControllerClient(); - Properties properties = client.getLCMProperties(); + ApplicationControllerClient client = new ApplicationControllerClient("appc"); + Properties properties = client.getLCMProperties("appc"); assertEquals(properties.get("topic.write"), "APPC-TEST-AMDOCS1-DEV3"); assertEquals(properties.get("topic.read.timeout"), "120000"); assertEquals(properties.get("client.response.timeout"), "120000"); assertEquals(properties.get("topic.read"), "APPC-TEST-AMDOCS2"); assertEquals(properties.get("poolMembers"), "uebsb93kcdc.it.att.com:3904,uebsb92kcdc.it.att.com:3904,uebsb91kcdc.it.att.com:3904"); + assertEquals(properties.get("client.controllerType"), "appc"); assertEquals(properties.get("client.key"), "iaEMAfjsVsZnraBP"); assertEquals(properties.get("client.secret"), "wcivUjsjXzmGFBfxMmyJu9dz"); } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java index bd026d0b6d..d9c5654989 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java @@ -46,7 +46,7 @@ public class ApplicationControllerOrchestratorTest { Status status; try { status = client.vnfCommand(Action.Lock, UUID.randomUUID().toString(), - "3ffdee3c-94d2-45fe-904d-fc1efa0f8b59", Optional.of("")); + "3ffdee3c-94d2-45fe-904d-fc1efa0f8b59", Optional.of(""), "appc"); } catch (ApplicationControllerOrchestratorException e) { status = new Status(); status.setCode(e.getAppcCode()); @@ -62,7 +62,7 @@ public class ApplicationControllerOrchestratorTest { Status status; try { status = client.vnfCommand(Action.Unlock, UUID.randomUUID().toString(), - "ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f", Optional.of("")); + "ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f", Optional.of(""), "appc"); } catch (ApplicationControllerOrchestratorException e) { status = new Status(); status.setCode(e.getAppcCode()); diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy index c84c73cb96..a9cc776ab6 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy @@ -76,6 +76,7 @@ public class ReplaceVnfInfra extends VnfCmBase { execution.setVariable('vnfInputs', null) execution.setVariable('tenantId', null) execution.setVariable('vnfParams', null) + execution.setVariable('controllerType', null) execution.setVariable('cloudConfiguration', null) execution.setVariable('ReplaceVnfSuccessIndicator', false) execution.setVariable('serviceType', null) @@ -164,7 +165,12 @@ public class ReplaceVnfInfra extends VnfCmBase { logDebug("vnfModelInvariantUuid: " + vnfModelInvariantUuid, isDebugLogEnabled) def vnfType = execution.getVariable('vnfType') - execution.setVariable('vnfType', vnfType) + execution.setVariable('vnfType', vnfType) + + def controllerType = reqMap.requestDetails?.requestParameters?.controllerType + execution.setVariable('controllerType', controllerType) + + utils.log("DEBUG", 'Controller Type: ' + controllerType, isDebugLogEnabled) def userParams = reqMap.requestDetails?.requestParameters?.userParams diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy index b6af0a5a6b..0b6ddb8ad2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy @@ -74,7 +74,8 @@ public class UpdateVnfInfra extends VnfCmBase { execution.setVariable('source', null) execution.setVariable('vnfInputs', null) execution.setVariable('tenantId', null) - execution.setVariable('vnfParams', null) + execution.setVariable('vnfParams', null) + execution.setVariable('controllerType', null) execution.setVariable('UpdateVnfSuccessIndicator', false) execution.setVariable('serviceType', null) execution.setVariable('nfRole', null) @@ -154,6 +155,11 @@ public class UpdateVnfInfra extends VnfCmBase { def vnfType = execution.getVariable('vnfType') execution.setVariable('vnfType', vnfType) + def controllerType = reqMap.requestDetails?.requestParameters?.controllerType + execution.setVariable('controllerType', controllerType) + + utils.log("DEBUG", 'Controller Type: ' + controllerType, isDebugLogEnabled) + def userParams = reqMap.requestDetails?.requestParameters?.userParams Map userParamsMap = [:] diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy index 13016a5ae4..aa3320044d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy @@ -75,7 +75,8 @@ public class VnfConfigUpdate extends VnfCmBase { public void initProcessVariables(DelegateExecution execution) { execution.setVariable('prefix', 'VnfCU_') execution.setVariable('Request', null) - execution.setVariable('source', null) + execution.setVariable('source', null) + execution.setVariable('controllerType', null) execution.setVariable('UpdateVnfSuccessIndicator', false) execution.setVariable('serviceType', null) execution.setVariable('nfRole', null) @@ -128,7 +129,12 @@ public class VnfConfigUpdate extends VnfCmBase { execution.setVariable('serviceType', 'Mobility') execution.setVariable('payload', "") execution.setVariable('actionHealthCheck', Action.HealthCheck) - execution.setVariable('actionConfigModify', Action.ConfigModify) + execution.setVariable('actionConfigModify', Action.ConfigModify) + + def controllerType = reqMap.requestDetails?.requestParameters?.controllerType + execution.setVariable('controllerType', controllerType) + + utils.log("DEBUG", 'Controller Type: ' + controllerType, isDebugLogEnabled) def payload = reqMap.requestDetails?.requestParameters?.payload execution.setVariable('payload', payload) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy index 4a64ab058b..64894563bf 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy @@ -80,7 +80,8 @@ public class VnfInPlaceUpdate extends VnfCmBase { execution.setVariable('source', null) execution.setVariable('vnfInputs', null) execution.setVariable('tenantId', null) - execution.setVariable('vnfParams', null) + execution.setVariable('vnfParams', null) + execution.setVariable('controllerType', null) execution.setVariable('UpdateVnfSuccessIndicator', false) execution.setVariable('serviceType', null) execution.setVariable('nfRole', null) @@ -140,6 +141,11 @@ public class VnfInPlaceUpdate extends VnfCmBase { execution.setVariable('actionUpgradeBackup', Action.UpgradeBackup) execution.setVariable('actionUpgradeSoftware', Action.UpgradeSoftware) execution.setVariable('actionResumeTraffic', Action.ResumeTraffic) + + def controllerType = reqMap.requestDetails?.requestParameters?.controllerType + execution.setVariable('controllerType', controllerType) + + utils.log("DEBUG", 'Controller Type: ' + controllerType, isDebugLogEnabled) def payload = reqMap.requestDetails?.requestParameters?.payload execution.setVariable('payload', payload) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/ReplaceVnfInfra.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/ReplaceVnfInfra.bpmn index c15c391558..0e849a8a7b 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/ReplaceVnfInfra.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/ReplaceVnfInfra.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_5 @@ -109,6 +109,7 @@ uvfm.postProcessRollback(execution)]]> + SequenceFlow_0msgw6c SequenceFlow_0uhssvq @@ -394,7 +395,8 @@ uvfm.prepDoCreateVnfAndModules(execution)]]> - + + SequenceFlow_1bkhs8m SequenceFlow_1qfjlt7 @@ -414,6 +416,7 @@ uvfm.prepDoCreateVnfAndModules(execution)]]> + SequenceFlow_0qy68ib SequenceFlow_0x7iupc @@ -431,6 +434,7 @@ uvfm.prepDoCreateVnfAndModules(execution)]]> + SequenceFlow_0q0qan8 SequenceFlow_0hp0w6k @@ -448,6 +452,7 @@ uvfm.prepDoCreateVnfAndModules(execution)]]> + SequenceFlow_04zwhw4 SequenceFlow_1lrbndo @@ -467,6 +472,7 @@ uvfm.prepDoCreateVnfAndModules(execution)]]> + SequenceFlow_162mm0m SequenceFlow_14mblvp @@ -574,6 +580,7 @@ uvfm.prepDoCreateVnfAndModules(execution)]]> + SequenceFlow_197t3qk SequenceFlow_18e0jz0 diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateVnfInfra.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateVnfInfra.bpmn index fa58c0b21b..4b805f87ab 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateVnfInfra.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateVnfInfra.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_5 @@ -109,6 +109,7 @@ uvfm.postProcessRollback(execution)]]> + SequenceFlow_0a0lfh8 SequenceFlow_0r0o5yt @@ -366,6 +367,7 @@ uvfm.prepDoUpdateVnfAndModules(execution)]]> + SequenceFlow_1bkhs8m SequenceFlow_0qmpjgv @@ -385,6 +387,7 @@ uvfm.prepDoUpdateVnfAndModules(execution)]]> + SequenceFlow_0qy68ib SequenceFlow_0tld38t @@ -402,6 +405,7 @@ uvfm.prepDoUpdateVnfAndModules(execution)]]> + SequenceFlow_0q0qan8 SequenceFlow_08dyt3l @@ -419,6 +423,7 @@ uvfm.prepDoUpdateVnfAndModules(execution)]]> + SequenceFlow_04zwhw4 SequenceFlow_0ye8oij @@ -438,6 +443,7 @@ uvfm.prepDoUpdateVnfAndModules(execution)]]> + SequenceFlow_162mm0m SequenceFlow_08kn9ok @@ -454,6 +460,7 @@ uvfm.prepDoUpdateVnfAndModules(execution)]]> + SequenceFlow_197t3qk SequenceFlow_02uiht9 diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfConfigUpdate.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfConfigUpdate.bpmn index 5915b9b592..01307b35b7 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfConfigUpdate.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfConfigUpdate.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_5 @@ -109,6 +109,7 @@ uvfm.postProcessRollback(execution)]]> + SequenceFlow_1vxpbd0 SequenceFlow_03ayqeh @@ -562,6 +563,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_1cjiv6i SequenceFlow_1colra4 @@ -581,6 +583,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_16igl7b SequenceFlow_0q1skau @@ -597,6 +600,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_188a7lk SequenceFlow_1wqinjh @@ -644,6 +648,7 @@ execution.getVariable(retryVariableName) < execution.getVariable("maxRetryCount" + SequenceFlow_1qr8msw SequenceFlow_18lemf9 diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfInPlaceUpdate.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfInPlaceUpdate.bpmn index b6361aaa20..362eb1ac05 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfInPlaceUpdate.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfInPlaceUpdate.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_5 @@ -95,6 +95,7 @@ uvfm.falloutHandlerPrep(execution, 'FalloutHandlerRequest') + SequenceFlow_0hvg70o SequenceFlow_1qnzi6i @@ -718,6 +719,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_1c0vdki SequenceFlow_0if6xj4 @@ -734,6 +736,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_1cjiv6i SequenceFlow_1ood2pr @@ -750,6 +753,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_1q3bwlt SequenceFlow_1hwtq9x @@ -767,6 +771,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_0qy68ib SequenceFlow_16t9vai @@ -784,6 +789,7 @@ uvfm.setClosedLoopDisabledInAAI(execution, false) + SequenceFlow_162mm0m SequenceFlow_16igl7b @@ -842,6 +848,7 @@ execution.getVariable(retryVariableName) < execution.getVariable("maxRetryCount" + SequenceFlow_1qr8msw SequenceFlow_0syfgbo @@ -860,6 +867,7 @@ execution.getVariable(retryVariableName) < execution.getVariable("maxRetryCount" + SequenceFlow_0q0qan8 SequenceFlow_1urt6le @@ -877,6 +885,7 @@ execution.getVariable(retryVariableName) < execution.getVariable("maxRetryCount" + SequenceFlow_1fuaq5k SequenceFlow_1v59be9 @@ -894,6 +903,7 @@ execution.getVariable(retryVariableName) < execution.getVariable("maxRetryCount" + SequenceFlow_0txgesu SequenceFlow_1colra4 @@ -912,6 +922,7 @@ execution.getVariable(retryVariableName) < execution.getVariable("maxRetryCount" + SequenceFlow_1c2xyhk SequenceFlow_0yja56j diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/RollbackVnf.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/RollbackVnf.bpmn index 2fa1fa932c..4d1ccf9c8d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/RollbackVnf.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/RollbackVnf.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0bie3cu @@ -63,6 +63,7 @@ uvfm.preProcessRequest(execution) + SequenceFlow_1lne8je SequenceFlow_1ney8l6 @@ -74,6 +75,7 @@ uvfm.preProcessRequest(execution) + SequenceFlow_0gsro0z SequenceFlow_11556y3 @@ -128,6 +130,7 @@ uvfm.setRollbackResult(execution) + SequenceFlow_05ihl7f SequenceFlow_1pirwg0 diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json index 04040028c3..3fc25944f2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json @@ -33,6 +33,7 @@ } ], "requestParameters": { +"controllerType" : "appc", "payload": "{\"request-parameters\":{\"host-ip-address\":\"10.10.10.10\"},\"configuration- parameters\":{\"name1\":\"value1\",\"name2\":\"value2\"}}" } } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json index 7c9717244b..a018f50355 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json @@ -34,6 +34,7 @@ ], "requestParameters": { "usePreload": false, +"controllerType" : "appc", "userParams" : [ { "name" : "someUserParam", diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json index 40e7b598c0..e6d3e97a5c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json @@ -34,6 +34,7 @@ ], "requestParameters": { "usePreload": false, +"controllerType" : "appc", "userParams" : [ { "name" : "someUserParam", diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json index 009db93d68..588ef1cbec 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json @@ -9,6 +9,7 @@ "requestorId": "ab1234" }, "requestParameters": { +"controllerType": "", "payload": "{\"existing-software-version\": \"3.1\",\"new-software-version\": \"3.2\", \"operations-timeout\": \"3600\"}" } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties index 2e5a199cdb..245d753f3e 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties @@ -106,6 +106,7 @@ log.debug.CreateGenericALaCarteServiceInstance=true log.debug.DecomposeService=true log.debug.DoCreateServiceInstance=true log.debug.DoDeleteServiceInstance=true +log.debug.VnfInPlaceUpdate=true policy.client.auth=Basic bTAzNzQzOnBvbGljeVIwY2sk policy.auth=Basic dGVzdHBkcDphbHBoYTEyMw== @@ -117,9 +118,10 @@ appc.topic.read=APPC-CL-FUSION-LCM-RESPONSE appc.topic.read.timeout=100 appc.client.response.timeout=300 appc.topic.write=APPC-CL-FUSION-LCM -appc.pool.members=localhost:28090 +appc.poolMembers=localhost:28090 appc.client.key=iaEMAfjsVsZnraBP appc.client.secret=wcivUjsjXzmGFBfxMmyJu9dz +appc.service=ueb sdnc.si.sv.types=PORT-MIRROR,PPROBES mso.bpmn.optimisticlockingexception.retrycount=3 -- cgit 1.2.3-korg