summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db
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-requests-db
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-requests-db')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java25
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java4
2 files changed, 20 insertions, 9 deletions
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 66768ea349..a6d6af8a07 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
@@ -7,9 +7,9 @@
* 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.
@@ -55,6 +55,8 @@ public abstract class InfraRequests implements java.io.Serializable {
private String requestId;
@Column(name = "REQUEST_STATUS", length = 20)
private String requestStatus;
+ @Column(name = "RESOURCE_STATUS_MESSAGE", length = 2000)
+ private String resourceStatusMessage;
@Column(name = "STATUS_MESSAGE", length = 2000)
private String statusMessage;
@Column(name = "ROLLBACK_STATUS_MESSAGE", length = 2000)
@@ -179,6 +181,14 @@ public abstract class InfraRequests implements java.io.Serializable {
this.requestStatus = requestStatus;
}
+ public String getResourceStatusMessage() {
+ return resourceStatusMessage;
+ }
+
+ public void setResourceStatusMessage(String resourceStatusMessage) {
+ this.resourceStatusMessage = resourceStatusMessage;
+ }
+
public String getStatusMessage() {
return this.statusMessage;
}
@@ -608,11 +618,12 @@ public abstract class InfraRequests implements java.io.Serializable {
@Override
public String toString() {
return new ToStringBuilder(this).append("requestId", getRequestId()).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("pnfName", getPnfName()).append("vnfType", getVnfType()).append("serviceType", getServiceType())
+ .append("resourceStatusMessage", getResourceStatusMessage()).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("pnfName", getPnfName())
+ .append("vnfType", getVnfType()).append("serviceType", getServiceType())
.append("tenantId", getTenantId()).append("vnfParams", getVnfParams())
.append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
.append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
index 7b642ab831..6aa00caeed 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
@@ -360,6 +360,7 @@ public class RequestsDbClient {
restTemplate.postForLocation(uri, entity);
}
+ // TODO really this should be called save as its doing a put
public void updateInfraActiveRequests(InfraActiveRequests request) {
HttpHeaders headers = getHttpHeaders();
URI uri = getUri(infraActiveRequestURI + request.getRequestId());
@@ -371,8 +372,7 @@ public class RequestsDbClient {
HttpHeaders headers = getHttpHeaders();
URI uri = getUri(infraActiveRequestURI + request.getRequestId());
HttpEntity<InfraActiveRequests> entity = new HttpEntity<>(request, headers);
- restTemplate.exchange(uri, HttpMethod.PATCH, new HttpEntity<InfraActiveRequests>(request, headers),
- String.class);
+ restTemplate.exchange(uri, HttpMethod.PATCH, entity, String.class);
}
public InfraActiveRequests getInfraActiveRequests(String requestId, String basicAuth, String host) {