From 32446dce35b5bf9d2c84751718cb4ece7f96fa72 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Mon, 1 Mar 2021 13:25:13 +0000 Subject: CPS-265 - updating cps path to support include-descendants option. Issue-ID: CPS-265 Signed-off-by: niamhcore Change-Id: I9e9b84760dbc8b5eb4b31ab972fdb2d186c6bb48 --- .../org/onap/cps/nfproxy/rest/controller/NfProxyController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cps-nf-proxy-rest/src/main/java') diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java index 93ed06580b..680ca127b8 100644 --- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java +++ b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java @@ -60,8 +60,12 @@ public class NfProxyController implements NfProxyApi { } @Override - public ResponseEntity queryNodesByCmHandleAndCpsPath(final String cmHandle, @Valid final String cpsPath) { - final Collection dataNodes = nfProxyDataService.queryDataNodes(cmHandle, cpsPath); + public ResponseEntity queryNodesByCmHandleAndCpsPath(final String cmHandle, @Valid final String cpsPath, + @Valid final Boolean includeDescendants) { + final FetchDescendantsOption fetchDescendantsOption = Boolean.TRUE.equals(includeDescendants) + ? FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS : FetchDescendantsOption.OMIT_DESCENDANTS; + final Collection dataNodes = + nfProxyDataService.queryDataNodes(cmHandle, cpsPath, fetchDescendantsOption); return new ResponseEntity<>(GSON.toJson(dataNodes), HttpStatus.OK); } -- cgit 1.2.3-korg