summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db/src/main/java/org/onap
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-06-18 17:04:18 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-06-18 17:18:16 -0400
commit4f82c56ca62b266d007f240c7b57d11cadd5f0b3 (patch)
tree6452b1e22db9e70a7e8636689af5fe4b7ff4e7ee /mso-api-handlers/mso-requests-db/src/main/java/org/onap
parent7c69f07593a8c7474bd7a69a65979dc0635f1526 (diff)
support no payload for alacarte deletes
Swap to using HTTP Enumerations rather than ints Add Unit Tests to Service Instances endpoint Add Vnf Tests remove Abstract class Clean up usage of abstract classes Fix volume and module bean wiring issues Add logic to find create request if cloud not in AAI Updated network to take in version pathparam Additonal refactor of the endpoints Add missing license headers to all files Clean up public variable usage, move to protected Change-Id: Icdbdf78aa6c8af7a30fdff8a5805103f8df9364d Issue-ID: SO-2032 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src/main/java/org/onap')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java15
1 files changed, 14 insertions, 1 deletions
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 1867b85de6..9ab0f3b680 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
@@ -73,7 +73,6 @@ public class RequestsDbClient {
private static final String OPERATIONAL_ENVIRONMENT_ID = "OPERATIONAL_ENV_ID";
private static final String SERVICE_MODEL_VERSION_ID = "SERVICE_MODEL_VERSION_ID";
-
@Value("${mso.adapters.requestDb.endpoint:#{null}}")
protected String endpoint;
@@ -106,6 +105,8 @@ public class RequestsDbClient {
private String requestProcessingDataURI = "/requestProcessingData";
+ private String getInfraActiveRequests = "/infraActiveRequests/v1/getInfraActiveRequests";
+
private static final String findBySoRequestIdAndGroupIdAndName =
"/requestProcessingData/search/findOneBySoRequestIdAndGroupingIdAndName";
@@ -128,6 +129,7 @@ public class RequestsDbClient {
cloudOrchestrationFiltersFromInfraActive = endpoint + cloudOrchestrationFiltersFromInfraActive;
findOneByServiceIdAndOperationIdURI = endpoint + OPERATION_STATUS_SEARCH + findOneByServiceIdAndOperationIdURI;
requestProcessingDataURI = endpoint + requestProcessingDataURI;
+ getInfraActiveRequests = endpoint + getInfraActiveRequests;
operationalEnvDistributionStatusURI = endpoint + operationalEnvDistributionStatusURI;
findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI =
endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH
@@ -368,6 +370,17 @@ public class RequestsDbClient {
return requestProcessingDataList;
}
+ // From and To are defaulted to ignore start/endtime on query to database
+ public List<InfraActiveRequests> getRequest(final Map<String, String[]> filters) {
+ String url = UriBuilder.fromUri(getUri(getInfraActiveRequests)).queryParam("from", "0")
+ .queryParam("to", "10000000000000").build().toString();
+ HttpHeaders headers = getHttpHeaders();
+ HttpEntity<Map> entity = new HttpEntity<>(filters, headers);
+ return restTemplate
+ .exchange(url, HttpMethod.POST, entity, new ParameterizedTypeReference<List<InfraActiveRequests>>() {})
+ .getBody();
+ }
+
@Component
static class ClassURLMapper {
private static final Map<Class, String> classURLMap = new HashMap<>();