From 4f82c56ca62b266d007f240c7b57d11cadd5f0b3 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Tue, 18 Jun 2019 17:04:18 -0400 Subject: 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) --- .../org/onap/so/db/request/client/RequestsDbClient.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'mso-api-handlers/mso-requests-db') 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 getRequest(final Map filters) { + String url = UriBuilder.fromUri(getUri(getInfraActiveRequests)).queryParam("from", "0") + .queryParam("to", "10000000000000").build().toString(); + HttpHeaders headers = getHttpHeaders(); + HttpEntity entity = new HttpEntity<>(filters, headers); + return restTemplate + .exchange(url, HttpMethod.POST, entity, new ParameterizedTypeReference>() {}) + .getBody(); + } + @Component static class ClassURLMapper { private static final Map classURLMap = new HashMap<>(); -- cgit 1.2.3-korg