diff options
author | Rob Daugherty <rd472p@att.com> | 2018-11-15 00:36:50 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-15 00:36:50 +0000 |
commit | b9b50c8cd06a5bb10ccedf3e0dc12965f3177ba2 (patch) | |
tree | 12b28d6c4f594a087eca070fa441477441621f15 | |
parent | e6a629beea75292037c3cabbc23e3a7a1b718b11 (diff) | |
parent | be24ada950e9f41a6034b472fc5502b285a510d5 (diff) |
Merge "separate error status from progression status"
19 files changed, 198 insertions, 34 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql new file mode 100644 index 0000000000..db34ab98e0 --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.14__Add_Flow_Status_To_Infra_Active_Requests.sql @@ -0,0 +1,7 @@ +use requestdb; + +ALTER TABLE infra_active_requests ADD FLOW_STATUS LONGTEXT; +ALTER TABLE archived_infra_requests ADD FLOW_STATUS LONGTEXT; + +ALTER TABLE infra_active_requests ADD RETRY_STATUS_MESSAGE LONGTEXT; +ALTER TABLE archived_infra_requests ADD RETRY_STATUS_MESSAGE LONGTEXT;
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java index 32540eb996..ba9426d88a 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java @@ -31,6 +31,8 @@ import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus; import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.db.request.client.RequestsDbClient; import org.onap.so.logger.MsoLogger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; @@ -44,6 +46,8 @@ public class ExecuteBuildingBlockRainyDay { @Autowired private CatalogDbClient catalogDbClient; + @Autowired + private RequestsDbClient requestDbclient; private static final String ASTERISK = "*"; @Autowired @@ -68,6 +72,7 @@ public class ExecuteBuildingBlockRainyDay { ExecuteBuildingBlock ebb = (ExecuteBuildingBlock) execution.getVariable("buildingBlock"); String bbName = ebb.getBuildingBlock().getBpmnFlowName(); GeneralBuildingBlock gBBInput = (GeneralBuildingBlock) execution.getVariable("gBBInput"); + String requestId = (String) execution.getVariable("mso-request-id"); Map<ResourceKey, String> lookupKeyMap = (Map<ResourceKey, String>) execution.getVariable("lookupKeyMap"); String serviceType = ASTERISK; boolean aLaCarte = (boolean) execution.getVariable("aLaCarte"); @@ -122,6 +127,16 @@ public class ExecuteBuildingBlockRainyDay { handlingCode = rainyDayHandlerStatus.getSecondaryPolicy(); } } + if(!primaryPolicy){ + try{ + InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); + request.setRetryStatusMessage("Retries have been exhausted."); + requestDbclient.updateInfraActiveRequests(request); + } catch(Exception ex){ + msoLogger.debug(ex.toString()); + msoLogger.error("Failed to update Request Db Infra Active Requests with Retry Status"); + } + } if(handlingCode.equals("RollbackToAssigned")&&!aLaCarte){ handlingCode = "Rollback"; } diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn index 2c134a9f59..07460a468d 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2"> <bpmn:process id="WorkflowActionBB" name="WorkflowActionBB" isExecutable="true"> <bpmn:startEvent id="Start_WorkflowActionBB" name="start"> <bpmn:outgoing>SequenceFlow_15s0okp</bpmn:outgoing> @@ -20,6 +20,7 @@ <camunda:in source="aLaCarte" target="aLaCarte" /> <camunda:in source="orchestrationStatusValidationResult" target="orchestrationStatusValidationResult" /> <camunda:out source="orchestrationStatusValidationResult" target="orchestrationStatusValidationResult" /> + <camunda:out source="RetryDuration" target="RetryDuration" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0mew9im</bpmn:incoming> <bpmn:outgoing>SequenceFlow_07h9d4y</bpmn:outgoing> diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java index 612051f903..55f898742c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java @@ -1,18 +1,23 @@ -/* - * Copyright (C) 2018 Bell Canada. - * +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) Copyright (C) 2018 Bell Canada. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. + * ============LICENSE_END========================================================= */ + package org.onap.so.bpmn.buildingblock; import java.util.Map; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 505c61da6b..66e2694db6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -109,7 +109,7 @@ public class WorkflowActionBBTasks { String statusMessage = this.getStatusMessage(completedBB.getBuildingBlock().getBpmnFlowName(), nextBB.getBuildingBlock().getBpmnFlowName(), completedBBs, remainingBBs); Long percentProgress = this.getPercentProgress(completedBBs, totalBBs); - request.setStatusMessage(statusMessage); + request.setFlowStatus(statusMessage); request.setProgress(percentProgress); request.setLastModifiedBy("CamundaBPMN"); return request; @@ -203,9 +203,18 @@ public class WorkflowActionBBTasks { public void checkRetryStatus(DelegateExecution execution) { String handlingCode = (String) execution.getVariable("handlingCode"); + String requestId = (String) execution.getVariable(G_REQUEST_ID); + String retryDuration = (String) execution.getVariable("RetryDuration"); int retryCount = (int) execution.getVariable(RETRY_COUNT); if (handlingCode.equals("Retry")){ updateRequestErrorStatusMessage(execution); + try{ + InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); + request.setRetryStatusMessage("Retry " + retryCount+1 + "/5 will be started in " + retryDuration); + requestDbclient.updateInfraActiveRequests(request); + } catch(Exception ex){ + logger.warn("Failed to update Request Db Infra Active Requests with Retry Status",ex); + } if(retryCount<5){ int currSequence = (int) execution.getVariable("gCurrentSequence"); execution.setVariable("gCurrentSequence", currSequence-1); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java index 8a57d5d43a..23fcddfe8a 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.so; import org.junit.runner.RunWith; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java index ab999a9889..0eddeb1649 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.so; import org.junit.runner.RunWith; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java index 5ac9f229f6..82ad6582c5 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.so; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index b0a80ebc72..fc269cd7cc 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -25,6 +25,7 @@ import static org.mockito.Matchers.anyObject; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.isA; import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; import java.util.ArrayList; @@ -42,6 +43,7 @@ import org.mockito.Spy; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; +import org.onap.so.db.request.beans.InfraActiveRequests; public class WorkflowActionBBTasksTest extends BaseTaskTest { @@ -258,19 +260,27 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { @Test public void checkRetryStatusTest(){ + String reqId = "reqId123"; + execution.setVariable("mso-request-id", reqId); doNothing().when(workflowActionBBTasks).updateRequestErrorStatusMessage(isA(DelegateExecution.class)); execution.setVariable("handlingCode","Retry"); execution.setVariable("retryCount", 1); execution.setVariable("gCurrentSequence",1); + InfraActiveRequests req = new InfraActiveRequests(); + doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId(reqId); workflowActionBBTasks.checkRetryStatus(execution); assertEquals(0,execution.getVariable("gCurrentSequence")); } @Test public void checkRetryStatusNoRetryTest(){ + String reqId = "reqId123"; + execution.setVariable("mso-request-id", reqId); execution.setVariable("retryCount", 3); execution.setVariable("handlingCode","Success"); execution.setVariable("gCurrentSequence",1); + InfraActiveRequests req = new InfraActiveRequests(); + doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId(reqId); workflowActionBBTasks.checkRetryStatus(execution); assertEquals(0,execution.getVariable("retryCount")); } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksUpdateReqDbTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksUpdateReqDbTest.java index 1e2558b580..0f106ad913 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksUpdateReqDbTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksUpdateReqDbTest.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.so.bpmn.infrastructure.workflow.tasks; import static org.junit.Assert.assertEquals; @@ -68,7 +88,7 @@ public class WorkflowActionBBTasksUpdateReqDbTest extends BaseTaskTest{ InfraActiveRequests mockedRequest = new InfraActiveRequests(); doReturn(mockedRequest).when(requestsDbClient).getInfraActiveRequestbyRequestId(isA(String.class)); InfraActiveRequests actual = workflowActionBBTasks.getUpdatedRequest(execution, currentSequence); - assertEquals(expectedStatusMessage, actual.getStatusMessage()); + assertEquals(expectedStatusMessage, actual.getFlowStatus()); assertEquals(expectedLong, actual.getProgress()); } } diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java index 9619a943cd..527aa037ed 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java @@ -29,7 +29,6 @@ public class RequestStatus { protected String requestState; protected String statusMessage; - protected String rollbackStatusMessage; protected Integer percentProgress; protected String finishTime; @@ -46,12 +45,6 @@ public class RequestStatus { public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } - public String getRollbackStatusMessage() { - return rollbackStatusMessage; - } - public void setRollbackStatusMessage(String rollbackStatusMessage) { - this.rollbackStatusMessage = rollbackStatusMessage; - } public Integer getPercentProgress() { return percentProgress; } @@ -67,7 +60,6 @@ public class RequestStatus { @Override public String toString() { return new ToStringBuilder(this).append("requestState", requestState).append("statusMessage", statusMessage) - .append("rollbackStatusMessage", rollbackStatusMessage).append("percentProgress", percentProgress) - .append("finishTime", finishTime).toString(); + .append("percentProgress", percentProgress).append("finishTime", finishTime).toString(); } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index 0c0b70b6dd..9c280cb70f 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -271,6 +271,9 @@ public class OrchestrationRequests { request.setRequestScope(iar.getRequestScope()); request.setRequestType(iar.getRequestAction()); String rollbackStatusMessage = iar.getRollbackStatusMessage(); + String flowStatusMessage = iar.getFlowStatus(); + String retryStatusMessage = iar.getRetryStatusMessage(); + InstanceReferences ir = new InstanceReferences(); if(iar.getNetworkId() != null) @@ -324,12 +327,32 @@ public class OrchestrationRequests { String startTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getStartTime()) + " GMT"; request.setStartTime(startTimeStamp); } - + String statusMessages = null; RequestStatus status = new RequestStatus(); if(iar.getStatusMessage() != null){ - status.setStatusMessage(iar.getStatusMessage()); + statusMessages = "STATUS: " + iar.getStatusMessage(); + } + if(flowStatusMessage != null){ + if(statusMessages != null){ + statusMessages = statusMessages + "/"; + } + statusMessages = statusMessages + "FLOW STATUS: " + flowStatusMessage; + } + if(retryStatusMessage != null){ + if(statusMessages != null){ + statusMessages = statusMessages + "/"; + } + statusMessages = statusMessages + "RETRY STATUS: " + retryStatusMessage; + } + if(rollbackStatusMessage != null){ + if(statusMessages != null){ + statusMessages = statusMessages + "/"; + } + statusMessages = statusMessages + "ROLLBACK STATUS: " + rollbackStatusMessage; + } + if(statusMessages != null){ + status.setStatusMessage(statusMessages); } - if(iar.getEndTime() != null){ String endTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getEndTime()) + " GMT"; status.setFinishTime(endTimeStamp); @@ -343,10 +366,6 @@ public class OrchestrationRequests { if(iar.getProgress() != null){ status.setPercentProgress(iar.getProgress().intValue()); } - - if(rollbackStatusMessage != null){ - status.setRollbackStatusMessage(rollbackStatusMessage); - } request.setRequestStatus(status); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java index 3a6839c92a..ce1dde835d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java @@ -89,7 +89,7 @@ public class CreateEcompOperationalEnvironmentTest extends BaseTest{ .withBody(mapper.writeValueAsString(iar)) .withStatus(HttpStatus.SC_OK))); stubFor(post(urlPathEqualTo("/infraActiveRequests/")) - .withRequestBody(containing("{\"requestId\":\"123\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL, operationalEnvironmentId - operationalEnvId; Success Message: SUCCESSFULLY Created ECOMP OperationalEnvironment.\",\"rollbackStatusMessage\":null,\"progress\":100")) + .withRequestBody(containing("{\"requestId\":\"123\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL, operationalEnvironmentId - operationalEnvId; Success Message: SUCCESSFULLY Created ECOMP OperationalEnvironment.\",\"rollbackStatusMessage\":null,\"flowStatus\":null,\"retryStatusMessage\":null,\"progress\":100")) .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .withStatus(HttpStatus.SC_OK))); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json index 2f824d007b..051ac16d77 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json @@ -27,7 +27,7 @@ }, "requestStatus": { "requestState": "COMPLETE", - "statusMessage": "COMPLETED", + "statusMessage": "STATUS: COMPLETED", "percentProgress": 100, "finishTime": "Tue, 02 May 2017 06:33:34 GMT" } @@ -61,8 +61,7 @@ }, "requestStatus": { "requestState": "COMPLETE", - "statusMessage": "Vf Module has been deleted successfully.", - "rollbackStatusMessage": "Rollback has been completed successfully.", + "statusMessage": "STATUS: Vf Module has been deleted successfully./FLOW STATUS: Building blocks 1 of 3 completed./ROLLBACK STATUS: Rollback has been completed successfully.", "percentProgress": 100, "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT" } @@ -96,7 +95,7 @@ }, "requestStatus": { "requestState": "PENDING", - "statusMessage": "Vf Module deletion pending.", + "statusMessage": "STATUS: Vf Module deletion pending.", "percentProgress": 0, "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT" } @@ -180,7 +179,7 @@ }, "requestStatus": { "requestState": "UNLOCKED", - "statusMessage": "Vf Module deletion pending.", + "statusMessage": "STATUS: Vf Module deletion pending.", "percentProgress": 0, "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT" } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json index 6f928e470a..d24b48ba29 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json @@ -26,7 +26,7 @@ }, "requestStatus":{ "requestState":"COMPLETE", - "statusMessage":"Vf Module has been deleted successfully.", + "statusMessage":"STATUS: Vf Module has been deleted successfully.", "percentProgress":100 } } @@ -57,8 +57,7 @@ }, "requestStatus":{ "requestState":"PENDING", - "statusMessage":"Vf Module deletion pending.", - "rollbackStatusMessage": "Rollback has been completed successfully.", + "statusMessage":"STATUS: Vf Module deletion pending./FLOW STATUS: Building blocks 1 of 3 completed./RETRY STATUS: Retry 2/5 will be started in 8 min./ROLLBACK STATUS: Rollback has been completed successfully.", "percentProgress":0 } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getOrchestrationRequest.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getOrchestrationRequest.json index 231b929372..97132fa037 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getOrchestrationRequest.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getOrchestrationRequest.json @@ -43,6 +43,8 @@ "operationalEnvId": null, "operationalEnvName": null, "rollbackStatusMessage": "Rollback has been completed successfully.", + "flowStatus": "Building blocks 1 of 3 completed.", + "retryStatusMessage": "Retry 2/5 will be started in 8 min.", "requestURI": "00032ab7-na18-42e5-965d-8ea592502018", "_links": { "self": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestDetailsFilter.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestDetailsFilter.json index a335930601..0f71dd48d3 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestDetailsFilter.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestDetailsFilter.json @@ -92,7 +92,8 @@ "operationalEnvId": null, "operationalEnvName": null, "requestURI": "00032ab7-3fb3-42e5-965d-8ea592502017", - "rollbackStatusMessage": "Rollback has been completed successfully." + "rollbackStatusMessage": "Rollback has been completed successfully.", + "flowStatus":"Building blocks 1 of 3 completed." }, { "requestId": "00032ab7-na18-42e5-965d-8ea592502018", diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql index 8cd8e397b1..57d765f4e5 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql @@ -52,6 +52,8 @@ CREATE CACHED TABLE PUBLIC.INFRA_ACTIVE_REQUESTS( REQUEST_STATUS VARCHAR SELECTIVITY 1, STATUS_MESSAGE longtext SELECTIVITY 36, ROLLBACK_STATUS_MESSAGE longtext SELECTIVITY 36, + FLOW_STATUS longtext SELECTIVITY 36, + RETRY_STATUS_MESSAGE longtext SELECTIVITY 36, PROGRESS VARCHAR SELECTIVITY 1, START_TIME VARCHAR, END_TIME VARCHAR, @@ -110,6 +112,8 @@ CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS( REQUEST_STATUS VARCHAR SELECTIVITY 1, STATUS_MESSAGE longtext SELECTIVITY 36, ROLLBACK_STATUS_MESSAGE longtext SELECTIVITY 36, + FLOW_STATUS longtext SELECTIVITY 36, + RETRY_STATUS_MESSAGE longtext SELECTIVITY 36, PROGRESS VARCHAR SELECTIVITY 1, START_TIME VARCHAR, END_TIME VARCHAR, diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java index 0f41d4f79b..a3743cc371 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java @@ -59,6 +59,10 @@ public abstract class InfraRequests implements java.io.Serializable { private String statusMessage; @Column(name = "ROLLBACK_STATUS_MESSAGE", length = 2000) private String rollbackStatusMessage; + @Column(name = "FLOW_STATUS", length = 2000) + private String flowStatus; + @Column(name = "RETRY_STATUS_MESSAGE", length = 2000) + private String retryStatusMessage; @Column(name = "PROGRESS", precision = 11) private Long progress; @@ -194,6 +198,22 @@ public abstract class InfraRequests implements java.io.Serializable { public void setRollbackStatusMessage(String rollbackStatusMessage) { this.rollbackStatusMessage = rollbackStatusMessage; } + + public String getFlowStatus() { + return this.flowStatus; + } + + public void setFlowStatus(String flowStatus) { + this.flowStatus = flowStatus; + } + + public String getRetryStatusMessage() { + return this.retryStatusMessage; + } + + public void setRetryStatusMessage(String retryStatusMessage) { + this.retryStatusMessage = retryStatusMessage; + } public Long getProgress() { return this.progress; @@ -553,6 +573,7 @@ public abstract class InfraRequests implements java.io.Serializable { return new ToStringBuilder(this).append("requestId", getRequestId()) .append("clientRequestId", getClientRequestId()).append("action", getAction()) .append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage()).append("rollbackStatusMessage", getRollbackStatusMessage()) + .append("flowStatus", getFlowStatus()).append("retryStatusMessage", getRetryStatusMessage()) .append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime()) .append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName()) .append("vnfType", getVnfType()).append("serviceType", getServiceType()) |