aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main/java
diff options
context:
space:
mode:
authorBoslet, Cory <cory.boslet@att.com>2020-03-08 10:43:59 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-03-08 10:43:59 -0400
commit7b42dee721e03ee3f0a52dda92010e09d748cf72 (patch)
tree3012b8bcf094713b10e1aade41046e7a74414ead /mso-api-handlers/mso-api-handler-infra/src/main/java
parent4d1e251ebcde26583cc85abef7b6909e9808771c (diff)
false positive on network creates
Added a new resourceStatusMessage field to the GET orch request API added new column to infra active request table updated openstack adapter to record the resource status added support of v8 on GET orch request API. Issue-ID: SO-2718 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I73b35f1562de4df477bf7e5cef01de13440ba98a
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java')
-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 b7d3d633d6..7fba48a7f2 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();
@@ -404,7 +403,7 @@ public class OrchestrationRequests {
});
}
- mapRequestStatusAndExtSysErrSrcToRequest(iar, status, format);
+ mapRequestStatusAndExtSysErrSrcToRequest(iar, status, format, version);
request.setRequestStatus(status);
return request;
@@ -433,7 +432,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();
@@ -469,6 +468,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 {
@@ -494,6 +499,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) {