diff options
author | Steve Smokowski <ss835w@att.com> | 2019-06-20 12:09:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-20 12:09:53 +0000 |
commit | 93f17b4f2d169221aed8b64d293b788a5e08bf43 (patch) | |
tree | a05aa42a38b328aa27e7a027793fccd1e90dfcae /mso-api-handlers/mso-requests-db/src | |
parent | 31360b6b53c4e21d8dc61892aca111550ec91835 (diff) | |
parent | 4f82c56ca62b266d007f240c7b57d11cadd5f0b3 (diff) |
Merge "support no payload for alacarte deletes"
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src')
-rw-r--r-- | mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java | 15 |
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<>(); |