diff options
-rw-r--r-- | components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java index 322be412..f177a9ac 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java @@ -74,6 +74,20 @@ public class DbController { return retString; } + @GetMapping("/idAndName") + @ResponseBody + @ApiOperation(value="Gat all databases id and name") + public Map<Integer, String> listIdAndName() { + Iterable<Db> ret = dbRepository.findAll(); + Map<Integer, String> map = new HashMap<>(); + for(Db db : ret) + { + log.info(db.getId() + "\t"+ db.getName()); + map.put(db.getId(), db.getName()); + } + return map; + } + //Create a DB @PostMapping("") @ResponseBody |