diff options
author | 2025-01-22 08:57:39 +0000 | |
---|---|---|
committer | 2025-01-23 11:54:24 +0000 | |
commit | bfd35a4539088ea6aa7773ab4d80d4422b9e22a7 (patch) | |
tree | 159fa214bec1a4b5e80acbeaa098085596231ec8 /cps-rest/src/main | |
parent | 6fb1e85fd1cdb20cb8f64f81c188c29c0391ab2a (diff) |
Add DB Clean-up to CPS Rest Interface
- add dataspace filter to module cleanup impl
- updated integration test to only delete orphaned modules in relevant dataspaces
(this also fixes CPS-2571)
- improved labels on admin controller test
- add dataspaces/../clean rest endpoint for cps core
- added 'Regular Maintenance' section to RTD Admin Guide
- consistent spelling of 'CM Handle' in RTD Docs
Issue-ID: CPS-2554
Change-Id: Ica70c3495758f073eaac9eeeadcc0e1be2c8cc1c
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Diffstat (limited to 'cps-rest/src/main')
-rwxr-xr-x | cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java | 16 |
1 files changed, 15 insertions, 1 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 675c0eaec4..4c6bd6cdc5 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 @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2020-2023 Nordix Foundation + * Copyright (C) 2020-2025 Nordix Foundation * Modifications Copyright (C) 2020-2021 Bell Canada. * Modifications Copyright (C) 2021 Pantheon.tech * Modifications Copyright (C) 2022 TechMahindra Ltd. @@ -176,6 +176,20 @@ public class AdminRestController implements CpsAdminApi { } /** + * Clean the given dataspace of any orphaned (module) data. + * + * @param apiVersion api version + * @param dataspaceName dataspace name + * + * @return a {@Link ResponseEntity} of {@link HttpStatus} NO_CONTENT + */ + @Override + public ResponseEntity<Void> cleanDataspace(final String apiVersion, final String dataspaceName) { + cpsModuleService.deleteAllUnusedYangModuleData(dataspaceName); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + /** * Create a new anchor. * * @param dataspaceName dataspace name |