diff options
author | JosephKeenan <joseph.keenan@est.tech> | 2022-03-28 12:26:07 +0100 |
---|---|---|
committer | JosephKeenan <joseph.keenan@est.tech> | 2022-04-06 15:50:08 +0100 |
commit | deac4777c1a245be1dc4c423658523b41071b110 (patch) | |
tree | 6dea5a08ae885840fbc4aff566f74f815a8444bf /cps-ncmp-rest/src/main | |
parent | ea01d09861289ff162dff318713d1c24eba89259 (diff) |
Query based on Public CM Properties
-Updated OpenAPI for new Endpoint
-Will replace SQL with CPSPathQuery once investigation is complete
-Functionality in place to determine if public properties match -
-Added Unit and CSIT tests - small modifications may need to be made
-CSIT tests enhanced to add additional nodes and tests
Issue-ID: CPS-731
Change-Id: I403e603ce79c4a4a6994d51b459b5703510d5a83
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/main')
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 19b9193330..84fcd88a96 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -34,6 +34,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; import javax.validation.Valid; @@ -42,11 +43,13 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; import org.onap.cps.ncmp.api.impl.exception.InvalidTopicException; +import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters; import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle; import org.onap.cps.ncmp.rest.api.NetworkCmProxyApi; import org.onap.cps.ncmp.rest.model.CmHandleProperties; import org.onap.cps.ncmp.rest.model.CmHandleProperty; import org.onap.cps.ncmp.rest.model.CmHandlePublicProperties; +import org.onap.cps.ncmp.rest.model.CmHandleQueryRestParameters; import org.onap.cps.ncmp.rest.model.CmHandles; import org.onap.cps.ncmp.rest.model.ConditionProperties; import org.onap.cps.ncmp.rest.model.Conditions; @@ -213,6 +216,19 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { } /** + * Query and return cm handles that match the given query parameters. + * + * @param cmHandleQueryRestParameters the cm handle query parameters + * @return collection of cm handle ids + */ + public ResponseEntity<List<String>> queryCmHandles( + final CmHandleQueryRestParameters cmHandleQueryRestParameters) { + final Set<String> cmHandleIds = networkCmProxyDataService.queryCmHandles( + jsonObjectMapper.convertToValueType(cmHandleQueryRestParameters, CmHandleQueryApiParameters.class)); + return ResponseEntity.ok(List.copyOf(cmHandleIds)); + } + + /** * Search for Cm Handle and Properties by Name. * @param cmHandleId cm-handle identifier * @return cm handle and its properties |