diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2022-12-09 15:33:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-12-09 15:33:12 +0000 |
commit | 377af14ab2664d8a15673e51cba82f1254379e14 (patch) | |
tree | bdbe5f9d09576ead253832362b145eb18d207866 /cps-rest/src/main/java/org | |
parent | aa29f24b0da9b9d2c86a0c528357a17ff3d7a871 (diff) | |
parent | 71e4f8339e0240f90ad0a42a9360be52553f0d82 (diff) |
Merge "Added API to get all schema sets for a given dataspace."
Diffstat (limited to 'cps-rest/src/main/java/org')
-rwxr-xr-x | cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java index a29f8d2969..285a15c6a3 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java @@ -110,6 +110,20 @@ public class AdminRestController implements CpsAdminApi { } /** + * Get list of schema sets for a given dataspace name. + * + * @param dataspaceName dataspace name + * @return a {@Link ResponseEntity} of schema sets & {@link HttpStatus} OK + */ + @Override + public ResponseEntity<List<SchemaSetDetails>> getSchemaSets(final String dataspaceName) { + final Collection<SchemaSet> schemaSets = cpsModuleService.getSchemaSets(dataspaceName); + final List<SchemaSetDetails> schemaSetDetails = schemaSets.stream().map(cpsRestInputMapper::toSchemaSetDetails) + .collect(Collectors.toList()); + return new ResponseEntity<>(schemaSetDetails, HttpStatus.OK); + } + + /** * Delete a {@link SchemaSet} based on given dataspace name & schemaset name. * * @param dataspaceName dataspace name |