From 8f01af4f635801a5d319bab7f9f9f2c437f7af37 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Tue, 4 Jun 2019 20:49:09 -0400 Subject: Handle 201 and 422 status codes SDC activitySpec API returns 201 for success and 422 when already exists Issue-ID: SO-1996 Signed-off-by: Kuleshov, Elena Change-Id: I75837b75cbd24f4ccfb97a07e91219b3b61453f6 --- .../so/asdc/activity/ActivitySpecsActions.java | 8 +++- .../asdc/activity/ActivitySpecsActionsTest.java | 53 ++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java index c80e84b574..619d89438e 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java @@ -67,7 +67,9 @@ public class ActivitySpecsActions { Response response = httpClient.post(payload); int statusCode = response.getStatus(); - if (statusCode != HttpStatus.SC_OK) { + if (statusCode == HttpStatus.SC_UNPROCESSABLE_ENTITY) { + logger.warn("{} {} {}", "ActivitySpec", activitySpec.getName(), "already exists in SDC"); + } else if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) { logger.warn("{} {} {}", "Error creating activity spec", activitySpec.getName(), statusCode); } else { if (response.getEntity() != null) { @@ -108,7 +110,9 @@ public class ActivitySpecsActions { int statusCode = response.getStatus(); - if (statusCode != HttpStatus.SC_OK) { + if (statusCode == HttpStatus.SC_UNPROCESSABLE_ENTITY) { + logger.warn("{} {} {}", "ActivitySpec with id", activitySpecId, "is already certified in SDC"); + } else if (statusCode != HttpStatus.SC_OK) { logger.warn("{} {} {}", "Error certifying activity", activitySpecId, statusCode); } else { certificationResult = true; diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/ActivitySpecsActionsTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/ActivitySpecsActionsTest.java index 438120924a..7de35b5c13 100644 --- a/asdc-controller/src/test/java/org/onap/asdc/activity/ActivitySpecsActionsTest.java +++ b/asdc-controller/src/test/java/org/onap/asdc/activity/ActivitySpecsActionsTest.java @@ -55,6 +55,44 @@ public class ActivitySpecsActionsTest extends BaseTest { assertEquals("testActivityId", activitySpecId); } + @Test + public void CreateActivitySpecReturnsCreated_Test() throws Exception { + String HOSTNAME = createURLWithPort(""); + + ActivitySpec activitySpec = new ActivitySpec(); + activitySpec.setName("testActivitySpec"); + activitySpec.setDescription("Test Activity Spec"); + ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse(); + activitySpecCreateResponse.setId("testActivityId"); + ObjectMapper mapper = new ObjectMapper(); + String body = mapper.writeValueAsString(activitySpecCreateResponse); + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.CREATED.value()).withBody(body))); + + String activitySpecId = activitySpecsActions.createActivitySpec(HOSTNAME, activitySpec); + assertEquals("testActivityId", activitySpecId); + } + + @Test + public void CreateActivitySpecReturnsExists_Test() throws Exception { + String HOSTNAME = createURLWithPort(""); + + ActivitySpec activitySpec = new ActivitySpec(); + activitySpec.setName("testActivitySpec"); + activitySpec.setDescription("Test Activity Spec"); + ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse(); + activitySpecCreateResponse.setId("testActivityId"); + ObjectMapper mapper = new ObjectMapper(); + String body = mapper.writeValueAsString(activitySpecCreateResponse); + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY.value()).withBody(body))); + + String activitySpecId = activitySpecsActions.createActivitySpec(HOSTNAME, activitySpec); + assertEquals(null, activitySpecId); + } + @Test public void CertifyActivitySpec_Test() throws Exception { String HOSTNAME = createURLWithPort(""); @@ -70,6 +108,21 @@ public class ActivitySpecsActionsTest extends BaseTest { assertTrue(certificationResult); } + @Test + public void CertifyActivitySpecReturnsExists_Test() throws Exception { + String HOSTNAME = createURLWithPort(""); + + String activitySpecId = "testActivitySpec"; + String urlPath = "/v1.0/activity-spec/testActivitySpec/versions/latest/actions"; + + wireMockServer.stubFor( + put(urlPathMatching(urlPath)).willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY.value()))); + + boolean certificationResult = activitySpecsActions.certifyActivitySpec(HOSTNAME, activitySpecId); + assertFalse(certificationResult); + } + private String createURLWithPort(String uri) { return "http://localhost:" + wireMockPort + uri; } -- cgit 1.2.3-korg From e4fad24b687b054e7039c491b46f0fd013edd1c0 Mon Sep 17 00:00:00 2001 From: "marios.iakovidis" Date: Wed, 5 Jun 2019 20:21:16 +0300 Subject: Added post process to AAI in HandlePNF Issue-ID: SO-1993 Signed-off-by: MariosIakovidis Change-Id: I6abec916438221669817b49997431b6164ee1a76 --- .../bpmn/infrastructure/scripts/HandlePNF.groovy | 38 +++++++++++++ .../src/main/resources/process/HandlePNF.bpmn | 66 ++++++++++++++++------ 2 files changed, 86 insertions(+), 18 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy index f06d71cec4..cbeb1d3d69 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy @@ -22,8 +22,12 @@ package org.onap.so.bpmn.infrastructure.scripts import org.apache.commons.lang3.StringUtils import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.so.bpmn.common.recipe.ResourceInput +import org.onap.so.bpmn.common.resource.ResourceRequestBuilder import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.MsoUtils +import org.onap.so.bpmn.core.UrnPropertiesReader import org.onap.so.bpmn.core.json.JsonUtils import org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames import org.slf4j.Logger @@ -34,6 +38,8 @@ public class HandlePNF extends AbstractServiceTaskProcessor{ ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() + MsoUtils msoUtils = new MsoUtils() + String Prefix="CRESI_" @Override void preProcessRequest(DelegateExecution execution) { @@ -65,7 +71,33 @@ public class HandlePNF extends AbstractServiceTaskProcessor{ void postProcessRequest(DelegateExecution execution) { logger.debug("start postProcess for HandlePNF") + ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable("resourceInput"), ResourceInput.class) + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String serviceInstanceId = resourceInputObj.getServiceInstanceId() + String operationId = resourceInputObj.getOperationId() + String progress = "100" + String status = "finished" + String statusDescription = "SDCN resource creation and activation completed" + String body = """ + + + + + ${msoUtils.xmlEscape(operType)} + ${msoUtils.xmlEscape(operationId)} + ${msoUtils.xmlEscape(progress)} + ${msoUtils.xmlEscape(resourceCustomizationUuid)} + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(status)} + ${msoUtils.xmlEscape(statusDescription)} + + + """; + logger.debug("body: "+body) + setProgressUpdateVariables(execution, body) logger.debug("exit postProcess for HandlePNF") } @@ -87,4 +119,10 @@ public class HandlePNF extends AbstractServiceTaskProcessor{ } logger.debug(" ***** Exit sendSyncResponse *****") } + + private void setProgressUpdateVariables(DelegateExecution execution, String body) { + def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution) + execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) + execution.setVariable("CVFMI_updateResOperStatusRequest", body) + } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn index 257a0dee64..43ebf9810e 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn @@ -16,7 +16,7 @@ handlePNF.preProcessRequest(execution) SequenceFlow_02fi1yn - + @@ -27,13 +27,6 @@ handlePNF.preProcessRequest(execution) SequenceFlow_1apj1fn SequenceFlow_0pujwl4 - - SequenceFlow_0pujwl4 - SequenceFlow_1la8oih - import org.onap.so.bpmn.infrastructure.scripts.* -def handlePNF = new HandlePNF() -handlePNF.postProcessRequest(execution) - @@ -42,12 +35,42 @@ handlePNF.postProcessRequest(execution) - SequenceFlow_1la8oih + SequenceFlow_1ud44f8 SequenceFlow_02fi1yn import org.onap.so.bpmn.infrastructure.scripts.* def handlePNF = new HandlePNF() handlePNF.sendSyncResponse(execution) + + SequenceFlow_0pujwl4 + SequenceFlow_1la8oih + import org.onap.so.bpmn.infrastructure.scripts.* +def handlePNF = new HandlePNF() +handlePNF.postProcessRequest(execution) + + + + + + + ${CVFMI_dbAdapterEndpoint} + + + application/soap+xml + Basic YnBlbDpwYXNzd29yZDEk + + + ${CVFMI_updateResOperStatusRequest} + POST + ${statusCode} + ${response} + + http-connector + + + SequenceFlow_1la8oih + SequenceFlow_1ud44f8 + @@ -69,21 +92,18 @@ handlePNF.sendSyncResponse(execution) - + - + - + - - - @@ -96,11 +116,21 @@ handlePNF.sendSyncResponse(execution) - - + + - + + + + + + + + + + + -- cgit 1.2.3-korg From e27b401eb0b34db92804230e1f63e0262b2a20fe Mon Sep 17 00:00:00 2001 From: "marios.iakovidis" Date: Wed, 5 Jun 2019 20:31:51 +0300 Subject: Changed service orc status to Assigned Issue-ID: SO-1938 Signed-off-by: MariosIakovidis Change-Id: I68d684f837f2dea9decb2e577742ab905f825d04 --- .../bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy index a771741e18..fa3bfdb0e3 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy @@ -358,7 +358,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor } if (allActive){ - si.setOrchestrationStatus("Active") + si.setOrchestrationStatus("Assigned") }else { si.setOrchestrationStatus("Pending") } -- cgit 1.2.3-korg From 59af0e5c0f34b59795ea319d6a7c48992cf177ee Mon Sep 17 00:00:00 2001 From: seshukm Date: Thu, 6 Jun 2019 11:29:34 +0530 Subject: update SO release notes Issue-ID: SO-1992 Change-Id: I47f9651740ab012e05dc09f9b874cfba6fc83699 Signed-off-by: seshukm --- docs/release-notes.rst | 234 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 89e12e35c2..8d5f5727b6 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -8,6 +8,240 @@ Service Orchestrator Release Notes The SO provides the highest level of service orchestration in the ONAP architecture. +Version: 1.4.3 +============== + +:Release Date: 2019-06-06 + +Docker Images +------------- + +**Dockers released for SO:** + + - onap/so/api-handler-infra,1.4.3 + - onap/so/bpmn-infra,1.4.3 + - onap/so/catalog-db-adapter,1.4.3 + - onap/so/openstack-adapter,1.4.3 + - onap/so/request-db-adapter,1.4.3 + - onap/so/sdc-controller,1.4.3 + - onap/so/sdnc-adapter,1.4.3 + - onap/so/so-monitoring,1.4.3 + - onap/so/vfc-adapter,1.4.3 + +Release Purpose +---------------- + +**New Features** + +The main goal of the Dublin release was to: + - Support CCVPN extension + - Support BroadBand Service Usecase + - SO SOL003 plugin support + - Improve PNF PnP + + +**Epics** + +- [`SO-1508 `__\ ] - ETSI Alignment - SO SOL003 plugin support to connect to external VNFMs +- [`SO-1468 `__\ ] - Hardening of HPA in SO and extension of HPA capabilities to existing use-cases +- [`SO-1394 `__\ ] - Extended and enhance the SO generic building block to support pre and post instantiation. +- [`SO-1393 `__\ ] - Support the CCVPN Extension +- [`SO-1392 `__\ ] - Support the BroadBand Service Usecase +- [`SO-1353 `__\ ] - SO to be made independent of Cloud technologies +- [`SO-1273 `__\ ] - PNF PnP Dublin updates & improvements +- [`SO-1271 `__\ ] - PNF PnP Casablanca MR updates +- [`SO-677 `__\ ] - Improve the issues and findings of the SO Casablanca Release +- [`SO-166 `__\ ] - Non-stop operations required. + +**Stories** + +- [`SO-1974 ExtAPI interface/API +- [`SO-1414 `_. + +Quick Links: + + - `SO project page `_ + - `Passing Badge information for SO `_ + - `Project Vulnerability Review Table for SO `_ + + +**Known Issues** + + TBD + +**Upgrade Notes** + + N/A + +**Deprecation Notes** + + N/A + +**Other** + + N/A + +Version: 1.4.1 +============== + +:Release Date: 2019-04-19 + +This is the dublin release base version separated from master branch. + + Version: 1.3.7 -------------- -- cgit 1.2.3-korg From 1e2f06c201cf6649f24b76015175c37be3458a34 Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Thu, 6 Jun 2019 18:12:52 -0700 Subject: Add non-cloudowner nbrequest lookup in workflowAction Using a cloudOwner different than "CloudOwner" when instantiating a vfmodule using GR_API causes nbrequest lookup in workflowAction to fail. This change adds a final check for northboundRequest that does not use cloudOwner field before failing. This should enable instantiation on multiple cloudRegions without seperate northbound_request_ref_lookup actions for each cloudOwner. Issue-ID: SO-1995 Change-Id: I9d1fe39fb056d03e8473a524c21f41319c13c20f Signed-off-by: Marcus G K Williams --- .../onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 70726f2014..7065c2c76c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -1323,6 +1323,10 @@ public class WorkflowAction { northBoundRequest = catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner( requestAction, resourceName.toString(), aLaCarte, cloudOwner); } + if (northBoundRequest == null) { + northBoundRequest = catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(requestAction, + resourceName.toString(), aLaCarte); + } if (northBoundRequest == null) { if (aLaCarte) { buildAndThrowException(execution, -- cgit 1.2.3-korg From d0cd4dc3d204e80a7419c97b6b0ec59273984a99 Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Fri, 7 Jun 2019 13:14:20 -0700 Subject: Fix Dublin Build- Use Release 1.4.0 OpenStack Libs Issue-ID: SO-2005 Change-Id: If1483009d57179e01fbe52e07fbf4a3c81ae3ebf Signed-off-by: Marcus G K Williams --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 90fa8d4e14..5168141545 100644 --- a/pom.xml +++ b/pom.xml @@ -49,8 +49,7 @@ **/* 0.7.5.201505241946 - - 1.4.0-SNAPSHOT + 1.4.0 yyyyMMdd'T'HHmm original true -- cgit 1.2.3-korg