summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-03-10 14:54:10 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-10 14:54:10 +0000
commit43fc1ee27456a17668e5f3f424a0bc6b7973e6e8 (patch)
treee867127dae70e6f698938a33585b2bc117963859 /mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap
parent4dc7f5c75956c68223003ad10670ef47bdad6e26 (diff)
parent7b42dee721e03ee3f0a52dda92010e09d748cf72 (diff)
Merge "false positive on network creates"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java30
1 files changed, 21 insertions, 9 deletions
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 4e019ca602..33c2ac80be 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
@@ -106,7 +106,7 @@ public class OrchestrationRequests {
private CamundaRequestHandler camundaRequestHandler;
@GET
- @Path("/{version:[vV][4-7]}/{requestId}")
+ @Path("/{version:[vV][4-8]}/{requestId}")
@Operation(description = "Find Orchestrated Requests for a given requestId", responses = @ApiResponse(
content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Produces(MediaType.APPLICATION_JSON)
@@ -115,7 +115,6 @@ public class OrchestrationRequests {
@PathParam("version") String version, @QueryParam("includeCloudRequest") boolean includeCloudRequest,
@QueryParam(value = "format") String format) throws ApiException {
- String apiVersion = version.substring(1);
GetOrchestrationResponse orchestrationResponse = new GetOrchestrationResponse();
InfraActiveRequests infraActiveRequest = null;
@@ -152,7 +151,7 @@ public class OrchestrationRequests {
}
}
- Request request = mapInfraActiveRequestToRequest(infraActiveRequest, includeCloudRequest, format);
+ Request request = mapInfraActiveRequestToRequest(infraActiveRequest, includeCloudRequest, format, version);
if (null != requestProcessingData && !requestProcessingData.isEmpty()) {
request.setRequestProcessingData(mapRequestProcessingData(requestProcessingData));
@@ -161,11 +160,11 @@ public class OrchestrationRequests {
orchestrationResponse.setRequest(request);
return builder.buildResponse(HttpStatus.SC_OK, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID), orchestrationResponse,
- apiVersion);
+ version);
}
@GET
- @Path("/{version:[vV][4-7]}")
+ @Path("/{version:[vV][4-8]}")
@Operation(description = "Find Orchestrated Requests for a URI Information", responses = @ApiResponse(
content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Produces(MediaType.APPLICATION_JSON)
@@ -206,7 +205,7 @@ public class OrchestrationRequests {
for (InfraActiveRequests infraActive : activeRequests) {
RequestList requestList = new RequestList();
- Request request = mapInfraActiveRequestToRequest(infraActive, includeCloudRequest, format);
+ Request request = mapInfraActiveRequestToRequest(infraActive, includeCloudRequest, format, version);
if (isRequestProcessingDataRequired(format)) {
List<RequestProcessingData> requestProcessingData =
@@ -292,7 +291,7 @@ public class OrchestrationRequests {
}
protected Request mapInfraActiveRequestToRequest(InfraActiveRequests iar, boolean includeCloudRequest,
- String format) throws ApiException {
+ String format, String version) throws ApiException {
String requestBody = iar.getRequestBody();
Request request = new Request();
@@ -402,7 +401,7 @@ public class OrchestrationRequests {
});
}
- mapRequestStatusAndExtSysErrSrcToRequest(iar, status, format);
+ mapRequestStatusAndExtSysErrSrcToRequest(iar, status, format, version);
request.setRequestStatus(status);
return request;
@@ -431,7 +430,7 @@ public class OrchestrationRequests {
}
protected void mapRequestStatusAndExtSysErrSrcToRequest(InfraActiveRequests iar, RequestStatus status,
- String format) {
+ String format, String version) {
String rollbackStatusMessage = iar.getRollbackStatusMessage();
String flowStatusMessage = iar.getFlowStatus();
String retryStatusMessage = iar.getRetryStatusMessage();
@@ -467,6 +466,12 @@ public class OrchestrationRequests {
if (rollbackStatusMessage != null) {
status.setRollbackStatusMessage(rollbackStatusMessage);
}
+ if (version.matches("v[8-9]|v[1-9][0-9]")) {
+ if (iar.getResourceStatusMessage() != null) {
+ status.setResourceStatusMessage(iar.getResourceStatusMessage());
+ }
+ }
+
status.setExtSystemErrorSource(iar.getExtSystemErrorSource());
status.setRollbackExtSystemErrorSource(iar.getRollbackExtSystemErrorSource());
} else {
@@ -492,6 +497,13 @@ public class OrchestrationRequests {
statusMessages = "ROLLBACK STATUS: " + rollbackStatusMessage;
}
}
+ if (iar.getResourceStatusMessage() != null) {
+ if (statusMessages != null) {
+ statusMessages = statusMessages + " " + "RESOURCE STATUS: " + iar.getResourceStatusMessage();
+ } else {
+ statusMessages = "RESOURCE STATUS: " + iar.getResourceStatusMessage();
+ }
+ }
}
if (statusMessages != null) {