From be24ada950e9f41a6034b472fc5502b285a510d5 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Sat, 10 Nov 2018 11:58:39 -0500 Subject: separate error status from progression status Re-ordered statuses, capitalized, and added delimiters added retrystatusmessage to to string in infrarequests Added retryStatusMessage to OrchestrationRequests removed the word min from retry status message string added retry status message to infra active requests Began adding retryStatusMessage Added rollback status and flow status to status message added flow status table to separate errors from status Change-Id: If756fa4523955e4e4b6bfd10aad730b715892b62 Issue-ID: SO-1205 Signed-off-by: Benjamin, Max (mb388a) --- .../so/apihandlerinfra/OrchestrationRequests.java | 33 +++++++++++++++++----- .../CreateEcompOperationalEnvironmentTest.java | 2 +- .../OrchestrationFilterResponse.json | 9 +++--- .../OrchestrationRequest/OrchestrationList.json | 5 ++-- .../getOrchestrationRequest.json | 2 ++ .../getRequestDetailsFilter.json | 3 +- .../src/test/resources/schema.sql | 4 +++ .../onap/so/db/request/beans/InfraRequests.java | 21 ++++++++++++++ 8 files changed, 62 insertions(+), 17 deletions(-) (limited to 'mso-api-handlers') 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()) -- cgit 1.2.3-korg