Add DB Clean-up to CPS Rest Interface 97/139997/3
authorToineSiebelink <toine.siebelink@est.tech>
Wed, 22 Jan 2025 08:57:39 +0000 (08:57 +0000)
committerToine Siebelink <toine.siebelink@est.tech>
Thu, 23 Jan 2025 11:54:24 +0000 (11:54 +0000)
- 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>
28 files changed:
cps-rest/docs/openapi/cpsAdmin.yml
cps-rest/docs/openapi/openapi.yml
cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java
cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java
cps-ri/src/main/java/org/onap/cps/ri/repository/SchemaSetRepository.java
cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java
cps-service/src/main/java/org/onap/cps/impl/CpsModuleServiceImpl.java
cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
cps-service/src/test/groovy/org/onap/cps/impl/CpsModuleServiceImplSpec.groovy
docs/admin-guide.rst
docs/api/swagger/cps/openapi.yaml
docs/cm-handle-lcm-events.rst
docs/cps-events.rst
docs/cps-ncmp-message-status-codes.rst
docs/cps-scheduled-processes.rst
docs/deployment.rst
docs/modeling.rst
docs/ncmp-data-operation.rst
docs/overview.rst
docs/release-notes.rst
integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/AnchorServiceIntegrationSpec.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy
integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy

index f394270..6cfffa4 100644 (file)
@@ -1,6 +1,6 @@
 # ============LICENSE_START=======================================================
 # Copyright (c) 2021 Bell Canada.
-# Modifications Copyright (C) 2021-2022 Nordix Foundation
+# Modifications Copyright (C) 2021-2025 Nordix Foundation
 # Modifications Copyright (C) 2022 TechMahindra Ltd.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -230,3 +230,23 @@ adminDataspace:
        $ref: 'components.yml#/components/responses/Forbidden'
      '500':
        $ref: 'components.yml#/components/responses/InternalServerError'
+
+adminCleanDataspace:
+  post:
+    description: Clean the dataspace (remove orphaned schema sets and modules)
+    tags:
+      - cps-admin
+    summary: Clean the dataspace
+    operationId: cleanDataspace
+    parameters:
+      - $ref: 'components.yml#/components/parameters/apiVersionInPath'
+      - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
+    responses:
+      '204':
+        $ref: 'components.yml#/components/responses/NoContent'
+      '400':
+        $ref: 'components.yml#/components/responses/BadRequest'
+      '403':
+        $ref: 'components.yml#/components/responses/Forbidden'
+      '500':
+        $ref: 'components.yml#/components/responses/InternalServerError'
index f4eab61..c85bf7c 100644 (file)
@@ -1,5 +1,5 @@
 #  ============LICENSE_START=======================================================
-#  Copyright (C) 2021-2024 Nordix Foundation
+#  Copyright (C) 2021-2025 Nordix Foundation
 #  Modifications Copyright (C) 2021 Pantheon.tech
 #  Modifications Copyright (C) 2021 Bell Canada.
 #  Modifications Copyright (C) 2022-2024 TechMahindra Ltd.
@@ -61,6 +61,9 @@ paths:
   /{apiVersion}/admin/dataspaces/{dataspace-name}:
     $ref: 'cpsAdmin.yml#/adminDataspace'
 
+  /{apiVersion}/admin/dataspaces/{dataspace-name}/actions/clean:
+    $ref: 'cpsAdmin.yml#/adminCleanDataspace'
+
   /v1/dataspaces/{dataspace-name}/anchors:
     $ref: 'cpsAdminV1Deprecated.yml#/anchorsByDataspace'
 
index 675c0ea..4c6bd6c 100755 (executable)
@@ -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.
@@ -175,6 +175,20 @@ public class AdminRestController implements CpsAdminApi {
         return new ResponseEntity<>(HttpStatus.NO_CONTENT);
     }
 
+    /**
+     * 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.
      *
index 2335a5e..0d18978 100755 (executable)
@@ -2,7 +2,7 @@
  *  ============LICENSE_START=======================================================
  *  Copyright (C) 2020-2021 Pantheon.tech
  *  Modifications Copyright (C) 2020-2021 Bell Canada.
- *  Modifications Copyright (C) 2021-2022 Nordix Foundation
+ *  Modifications Copyright (C) 2021-2025 Nordix Foundation
  *  Modifications Copyright (C) 2022 TechMahindra Ltd.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.cps.rest.controller
 
-import org.onap.cps.api.CpsAnchorService
-
-import static org.onap.cps.api.parameters.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
-
 import org.mapstruct.factory.Mappers
+import org.onap.cps.api.CpsAnchorService
 import org.onap.cps.api.CpsDataspaceService
 import org.onap.cps.api.CpsModuleService
 import org.onap.cps.api.exceptions.AlreadyDefinedException
@@ -51,6 +44,12 @@ import org.springframework.util.LinkedMultiValueMap
 import org.springframework.util.MultiValueMap
 import spock.lang.Specification
 
+import static org.onap.cps.api.parameters.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
+
 @WebMvcTest(AdminRestController)
 class AdminRestControllerSpec extends Specification {
 
@@ -79,7 +78,7 @@ class AdminRestControllerSpec extends Specification {
     def dataspace = new Dataspace(name: dataspaceName)
 
     def 'Create new dataspace with #scenario.'() {
-        when: 'post is invoked'
+        when: 'post is invoked on endpoint for creating a dataspace'
             def response =
                 mvc.perform(
                     post("/cps/api/${apiVersion}/dataspaces")
@@ -97,7 +96,7 @@ class AdminRestControllerSpec extends Specification {
     }
 
     def 'Create dataspace over existing with same name.'() {
-        given: 'an endpoint'
+        given: 'the endpoint to create a dataspace'
             def createDataspaceEndpoint = "$basePath/v1/dataspaces"
         and: 'the service method throws an exception indicating the dataspace is already defined'
             def thrownException = new AlreadyDefinedException(dataspaceName, new RuntimeException())
@@ -115,7 +114,7 @@ class AdminRestControllerSpec extends Specification {
     def 'Get a dataspace.'() {
         given: 'service method returns a dataspace'
             mockCpsDataspaceService.getDataspace(dataspaceName) >> dataspace
-        and: 'an endpoint'
+        and: 'the endpoint for getting a dataspace by name'
             def getDataspaceEndpoint = "$basePath/v1/admin/dataspaces/$dataspaceName"
         when: 'get dataspace API is invoked'
             def response = mvc.perform(get(getDataspaceEndpoint)).andReturn().response
@@ -124,6 +123,17 @@ class AdminRestControllerSpec extends Specification {
             response.getContentAsString().contains(dataspaceName)
     }
 
+    def 'Clean a dataspace.'() {
+        given: 'service method returns a dataspace'
+            mockCpsDataspaceService.getDataspace(dataspaceName) >> dataspace
+        and: 'the endpoint for cleaning a dataspace'
+            def postCleanDataspaceEndpoint = "$basePath/v1/admin/dataspaces/$dataspaceName/actions/clean"
+        when: 'post is invoked on the clean dataspace endpoint'
+            def response = mvc.perform(post(postCleanDataspaceEndpoint)).andReturn().response
+        then: 'no content is returned'
+            response.status == HttpStatus.NO_CONTENT.value()
+    }
+
     def 'Get all dataspaces.'() {
         given: 'service method returns all dataspace'
             mockCpsDataspaceService.getAllDataspaces() >> [dataspace, new Dataspace(name: "dataspace-test2")]
@@ -173,8 +183,7 @@ class AdminRestControllerSpec extends Specification {
                                     .param('schema-set-name', schemaSetName))
                             .andReturn().response
         then: 'associated service method is invoked with expected parameters'
-            1 * mockCpsModuleService.createSchemaSet(dataspaceName, schemaSetName, _) >>
-                    { args -> yangResourceMapCapture = args[2] }
+            1 * mockCpsModuleService.createSchemaSet(dataspaceName, schemaSetName, _) >> { args -> yangResourceMapCapture = args[2] }
             yangResourceMapCapture['assembly.yang'] == "fake assembly content 1\n"
             yangResourceMapCapture['component.yang'] == "fake component content 1\n"
         and: 'response code indicates success'
@@ -208,7 +217,7 @@ class AdminRestControllerSpec extends Specification {
     }
 
     def 'Create schema set from zip archive having #caseDescriptor.'() {
-        given: 'an endpoint'
+        given: 'the endpoint to create a schema set'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets"
         when: 'zip archive having #caseDescriptor is uploaded with create schema set request'
             def response =
@@ -228,7 +237,7 @@ class AdminRestControllerSpec extends Specification {
     def 'Create schema set from file with unsupported filename extension.'() {
         given: 'file with unsupported filename extension (.doc)'
             def multipartFile = createMultipartFile("filename.doc", "content")
-        and: 'an endpoint'
+        and: 'the endpoint to create a schema set'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets"
         when: 'file uploaded with schema set create request'
             def response =
@@ -242,7 +251,7 @@ class AdminRestControllerSpec extends Specification {
     }
 
     def 'Create schema set from #fileType file with IOException occurrence on processing.'() {
-        given: 'an endpoint'
+        given: 'the endpoint to create a schema set'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets"
         when: 'file uploaded with schema set create request'
             def multipartFile = createMultipartFileForIOException(fileType)
@@ -259,7 +268,7 @@ class AdminRestControllerSpec extends Specification {
     }
 
     def 'Delete schema set.'() {
-        given: 'an endpoint'
+        given: 'the endpoint for deleting a schema set'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets/$schemaSetName"
         when: 'delete schema set endpoint is invoked'
             def response = mvc.perform(delete(schemaSetEndpoint)).andReturn().response
@@ -274,7 +283,7 @@ class AdminRestControllerSpec extends Specification {
             def thrownException = new SchemaSetInUseException(dataspaceName, schemaSetName)
             mockCpsModuleService.deleteSchemaSet(dataspaceName, schemaSetName, CASCADE_DELETE_PROHIBITED) >>
                     { throw thrownException }
-        and: 'an endpoint'
+        and: 'the endpoint for deleting a schema set'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets/$schemaSetName"
         when: 'delete schema set endpoint is invoked'
             def response = mvc.perform(delete(schemaSetEndpoint)).andReturn().response
@@ -286,7 +295,7 @@ class AdminRestControllerSpec extends Specification {
         given: 'service method returns a new schema set'
             mockCpsModuleService.getSchemaSet(dataspaceName, schemaSetName) >>
                     new SchemaSet(name: schemaSetName, dataspaceName: dataspaceName)
-        and: 'an endpoint'
+        and: 'the endpoint for getting a schema set'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets/$schemaSetName"
         when: 'get schema set API is invoked'
             def response = mvc.perform(get(schemaSetEndpoint)).andReturn().response
@@ -300,7 +309,7 @@ class AdminRestControllerSpec extends Specification {
             mockCpsModuleService.getSchemaSets(dataspaceName) >>
                 [new SchemaSet(name: schemaSetName, dataspaceName: dataspaceName),
                 new SchemaSet(name: "test-schemaset", dataspaceName: dataspaceName)]
-        and: 'an endpoint'
+        and: 'the  endpoint for getting all schema sets'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets"
         when: 'get schema sets API is invoked'
             def response = mvc.perform(get(schemaSetEndpoint)).andReturn().response
@@ -315,7 +324,7 @@ class AdminRestControllerSpec extends Specification {
             def requestParams = new LinkedMultiValueMap<>()
             requestParams.add('schema-set-name', schemaSetName)
             requestParams.add('anchor-name', anchorName)
-        when: 'post is invoked'
+        when: 'post is invoked on the create anchors endpoint'
             def response =
                     mvc.perform(
                             post("/cps/api/${apiVersion}/dataspaces/my_dataspace/anchors")
@@ -332,10 +341,10 @@ class AdminRestControllerSpec extends Specification {
             'V2 API' | 'v2'       || ''
     }
 
-    def 'Get existing anchor.'() {
-        given: 'service method returns a list of anchors'
+    def 'Get existing anchors.'() {
+        given: 'service method returns a list of (one) anchors'
             mockCpsAnchorService.getAnchors(dataspaceName) >> [anchor]
-        and: 'an endpoint'
+        and: 'the endpoint for getting all anchors'
             def anchorEndpoint = "$basePath/v1/dataspaces/$dataspaceName/anchors"
         when: 'get all anchors API is invoked'
             def response = mvc.perform(get(anchorEndpoint)).andReturn().response
@@ -348,7 +357,7 @@ class AdminRestControllerSpec extends Specification {
         given: 'service method returns an anchor'
             mockCpsAnchorService.getAnchor(dataspaceName, anchorName) >>
                     new Anchor(name: anchorName, dataspaceName: dataspaceName, schemaSetName: schemaSetName)
-        and: 'an endpoint'
+        and: 'the endpoint for getting an anchor'
             def anchorEndpoint = "$basePath/v1/dataspaces/$dataspaceName/anchors/$anchorName"
         when: 'get anchor API is invoked'
             def response = mvc.perform(get(anchorEndpoint)).andReturn().response
@@ -361,7 +370,7 @@ class AdminRestControllerSpec extends Specification {
     }
 
     def 'Delete anchor.'() {
-        given: 'an endpoint'
+        given: 'the endpoint for deleting an anchor'
             def anchorEndpoint = "$basePath/v1/dataspaces/$dataspaceName/anchors/$anchorName"
         when: 'delete method is invoked on anchor endpoint'
             def response = mvc.perform(delete(anchorEndpoint)).andReturn().response
@@ -372,7 +381,7 @@ class AdminRestControllerSpec extends Specification {
     }
 
     def 'Delete dataspace.'() {
-        given: 'an endpoint'
+        given: 'the endpoint for deleting a dataspace'
             def dataspaceEndpoint = "$basePath/v1/dataspaces"
         when: 'delete dataspace endpoint is invoked'
             def response = mvc.perform(delete(dataspaceEndpoint)
index 64c9539..4f7492f 100755 (executable)
@@ -227,8 +227,9 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ
 
     @Override
     @Transactional
-    public void deleteAllUnusedYangModuleData() {
-        schemaSetRepository.deleteOrphanedSchemaSets();
+    public void deleteAllUnusedYangModuleData(final String dataspaceName) {
+        final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName);
+        schemaSetRepository.deleteOrphanedSchemaSets(dataspaceEntity.getId());
         yangResourceRepository.deleteOrphanedYangResources();
     }
 
index b8dd7b7..fdd7262 100644 (file)
@@ -83,8 +83,8 @@ public interface SchemaSetRepository extends JpaRepository<SchemaSetEntity, Inte
      */
     @Modifying
     @Query(value = """
-           DELETE FROM schema_set WHERE NOT EXISTS
-           (SELECT 1 FROM anchor WHERE anchor.schema_set_id = schema_set.id)
+           DELETE FROM schema_set WHERE schema_set.dataspace_id = :dataspaceId AND
+           NOT EXISTS (SELECT 1 FROM anchor WHERE anchor.schema_set_id = schema_set.id)
            """, nativeQuery = true)
-    void deleteOrphanedSchemaSets();
+    void deleteOrphanedSchemaSets(@Param("dataspaceId") final int dataspaceId);
 }
index 81b6439..c6b8c60 100644 (file)
@@ -164,8 +164,11 @@ public interface CpsModuleService {
     Collection<ModuleReference> identifyNewModuleReferences(Collection<ModuleReference> moduleReferencesToCheck);
 
     /**
-     * Remove any Yang Resource Modules and Schema Sets from the DB that are no longer referenced by any anchor.
+     * Remove any Yang Resource Modules and Schema Sets from the given dataspace that are no longer referenced
+     * by any anchor.
+     *
+     * @param dataspaceName     dataspace name
      */
-    void deleteAllUnusedYangModuleData();
+    void deleteAllUnusedYangModuleData(String dataspaceName);
 
 }
index 7622ba5..1e92c7e 100644 (file)
@@ -175,8 +175,9 @@ public class CpsModuleServiceImpl implements CpsModuleService {
     }
 
     @Override
-    public void deleteAllUnusedYangModuleData() {
-        cpsModulePersistenceService.deleteAllUnusedYangModuleData();
+    public void deleteAllUnusedYangModuleData(final String dataspaceName) {
+        cpsValidator.validateNameCharacters(dataspaceName);
+        cpsModulePersistenceService.deleteAllUnusedYangModuleData(dataspaceName);
     }
 
     private boolean isCascadeDeleteProhibited(final CascadeDeleteAllowed cascadeDeleteAllowed) {
index b1f8aad..86ad502 100755 (executable)
@@ -146,9 +146,11 @@ public interface CpsModulePersistenceService {
                                                                              String moduleName, String moduleRevision);
 
     /**
-     * Remove any unused Yang Resource Modules and Schema Sets.
+     * Remove any unused Yang Resource Modules and Schema Sets from the given dataspace.
+     *
+     * @param dataspaceName  dataspace name
      */
-    void deleteAllUnusedYangModuleData();
+    void deleteAllUnusedYangModuleData(String dataspaceName);
 
     /**
      * Identify new module references from those returned by a node compared to what is in CPS already.
index ce87162..af1859f 100644 (file)
@@ -252,11 +252,11 @@ class CpsModuleServiceImplSpec extends Specification {
             1 * mockCpsValidator.validateNameCharacters('some-dataspace-name', 'some-anchor-name')
     }
 
-    def 'Delete all unused yang module data.'() {
+    def 'Delete unused yang module data for a dataspace.'() {
         when: 'deleting unused yang module data'
-            objectUnderTest.deleteAllUnusedYangModuleData()
-        then: 'it is delegated to the module persistence service'
-            1 * mockCpsModulePersistenceService.deleteAllUnusedYangModuleData()
+            objectUnderTest.deleteAllUnusedYangModuleData('some-dataspace-name')
+        then: 'it is delegated to the module persistence service with the correct parameters'
+            1 * mockCpsModulePersistenceService.deleteAllUnusedYangModuleData('some-dataspace-name')
     }
 
     def 'Schema set exists.'() {
index 4a40f9b..68edc87 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2021-2022 Nordix Foundation
+.. Copyright (C) 2021-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _adminGuide:
@@ -12,6 +12,40 @@ CPS Admin Guide
 .. toctree::
    :maxdepth: 1
 
+Regular Maintenance
+===================
+This section details tasks that an administrator of the CPS application should execute on regular basis
+to ensure optimum working of CPS.
+
+Dataspace Clean Up
+------------------
+Certain data in the CPS database might not be explicitly removed after it is no longer required ('orphaned data').
+For example, schema sets and their associated unique module resources no longer used by any anchor because of model upgrades.
+This data would unnecessarily take up space and could eventually affect the performance of the DB if it is not deleted.
+How often this needs to be done depends on how often schema sets are being deprecated.
+Typically once per month should suffice.
+
+To remove orphaned data in a given dataspace use the following post request:
+
+.. code::
+
+    http://<cps-component-service-name>:<cps-port>/v2/admin/dataspaces/<dataspace-name>/actions/clean
+
+for example
+
+.. code-block:: bash
+
+    curl --location --request POST 'http://cps:8080/admin/datsaspaces/bookstore/actions/clean' \
+    --header 'Content-Type: application/json; charset=utf-8'
+
+    Response : HTTP Status 204
+
+For more details refer to the CPS-Core API:  :doc:`design`.
+
+.. note::
+   NCMP has no specific maintenance tasks but it will also build up orphaned data when CM Handles get updated and or deleted.
+   To delete this data execute the above procedure for the dataspace named 'NFP-Operational'.
+
 Logging Configuration
 =====================
 
@@ -210,9 +244,8 @@ Naming Validation
 As part of the Kohn 3.1.0 release, CPS has added validation to the names of the following components:
 
     - Dataspace names
-    - Schema Set names
     - Anchor names
-    - Cm-Handle identifiers
+    - CHandle identifiers
 
 The following characters along with spaces are no longer valid for naming of these components.
 
index c84609b..330c2ca 100644 (file)
@@ -330,6 +330,65 @@ paths:
       summary: Get a dataspace
       tags:
       - cps-admin
+  /{apiVersion}/admin/dataspaces/{dataspace-name}/actions/clean:
+    post:
+      description: Clean the dataspace (remove orphaned modules)
+      operationId: cleanDataspace
+      parameters:
+      - description: apiVersion
+        in: path
+        name: apiVersion
+        required: true
+        schema:
+          default: v2
+          enum:
+          - v1
+          - v2
+          type: string
+      - description: dataspace-name
+        in: path
+        name: dataspace-name
+        required: true
+        schema:
+          example: my-dataspace
+          type: string
+      responses:
+        "204":
+          content: {}
+          description: No Content
+        "400":
+          content:
+            application/json:
+              example:
+                status: 400
+                message: Bad Request
+                details: The provided request is not valid
+              schema:
+                $ref: '#/components/schemas/ErrorMessage'
+          description: Bad Request
+        "403":
+          content:
+            application/json:
+              example:
+                status: 403
+                message: Request Forbidden
+                details: This request is forbidden
+              schema:
+                $ref: '#/components/schemas/ErrorMessage'
+          description: Forbidden
+        "500":
+          content:
+            application/json:
+              example:
+                status: 500
+                message: Internal Server Error
+                details: Internal Server Error occurred
+              schema:
+                $ref: '#/components/schemas/ErrorMessage'
+          description: Internal Server Error
+      summary: Clean the dataspace
+      tags:
+      - cps-admin
   /v1/dataspaces/{dataspace-name}/anchors:
     post:
       deprecated: true
index 8446834..38339e2 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2023 Nordix Foundation
+.. Copyright (C) 2023-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _cmHandleLcmEvents:
@@ -15,7 +15,7 @@ CM Handle Lifecycle Management (LCM) Events
 Introduction
 ============
 
-LCM events for CM Handles are published when a CM Handle is created, deleted or another change in the cm handle state occurs.
+LCM events for CM Handles are published when a CM Handle is created, deleted or another change in the CM Handle state occurs.
 
   **3 possible event types:**
 
@@ -55,7 +55,7 @@ Event payload varies based on the type of event.
 
 **CREATE**
 
-Event payload for this event contains the properties of the new cm handle created.
+Event payload for this event contains the properties of the new CM Handle created.
 
 *Create event payload prototype*
 
@@ -77,7 +77,7 @@ Event payload for this event contains the properties of the new cm handle create
 
 **UPDATE**
 
-Event payload for this event contains the difference in state and properties of the cm handle.
+Event payload for this event contains the difference in state and properties of the CM Handle.
 
 *Update event payload prototype*
 
@@ -106,7 +106,7 @@ Event payload for this event contains the difference in state and properties of
 
 **DELETE**
 
-Event payload for this event contains the identifier of the deleted cm handle.
+Event payload for this event contains the identifier of the deleted CM Handle.
 
 *Delete event payload prototype*
 
@@ -114,4 +114,4 @@ Event payload for this event contains the identifier of the deleted cm handle.
 
   "event": {
          "cmHandleId" : "cmhandle-001",
-   }
\ No newline at end of file
+   }
index 47aa73f..1097af9 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2022-2023 Nordix Foundation
+.. Copyright (C) 2022-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _cpsEvents:
@@ -16,9 +16,9 @@ CPS Events
    cm-notification-subscriptions.rst
 
 .. note::
-    Legacy async response on a client supplied topic for single cm handle data request are no longer supported. Click link below for the legacy specification.
+    Legacy async response on a client supplied topic for single CM Handle data request are no longer supported. Click link below for the legacy specification.
 
       .. toctree::
          :maxdepth: 0
 
-         ncmp-async-events.rst
\ No newline at end of file
+         ncmp-async-events.rst
index e0a3f03..799838a 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2023-2024 Nordix Foundation
+.. Copyright (C) 2023-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _dataOperationMessageStatusCodes:
@@ -16,9 +16,9 @@ CPS-NCMP Message Status Codes
     +-----------------+------------------------------------------------------+-----------------------------------+
     | 1               | ACCEPTED                                             | CM Data Notification Subscription |
     +-----------------+------------------------------------------------------+-----------------------------------+
-    | 100             | cm handle id(s) is(are) not found                    | All features                      |
+    | 100             | CM Handle id(s) is(are) not found                    | All features                      |
     +-----------------+------------------------------------------------------+-----------------------------------+
-    | 101             | cm handle(s) not ready                               | Data Operation                    |
+    | 101             | CM Handle(s) not ready                               | Data Operation                    |
     +-----------------+------------------------------------------------------+-----------------------------------+
     | 102             | dmi plugin service is not responding                 | Data Operation                    |
     +-----------------+------------------------------------------------------+-----------------------------------+
@@ -30,9 +30,9 @@ CPS-NCMP Message Status Codes
     +-----------------+------------------------------------------------------+-----------------------------------+
     | 108             | Unknown error                                        | All features                      |
     +-----------------+------------------------------------------------------+-----------------------------------+
-    | 109             | cm-handle already exists                             | Inventory                         |
+    | 109             | CM Handle already exists                             | Inventory                         |
     +-----------------+------------------------------------------------------+-----------------------------------+
-    | 110             | cm-handle has an invalid character(s) in id          | Inventory                         |
+    | 110             | CM Handle has an invalid character(s) in id          | Inventory                         |
     +-----------------+------------------------------------------------------+-----------------------------------+
     | 111             | alternate id already associated                      | Inventory                         |
     +-----------------+------------------------------------------------------+-----------------------------------+
index c204e6c..9af9a81 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2022 Nordix Foundation
+.. Copyright (C) 2022-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 
@@ -21,17 +21,17 @@ The following section is a list of the current scheduled processes running withi
 Module Sync
 -----------
 The module sync is a user :ref:`configurable timed process<additional-cps-ncmp-customizations>`,
-which is set to search for CM-Handles within CPS with an *'ADVISED'* state.
-Once the CM-Handle is processed by the module sync, the CM-Handle state is then set to *'READY'*, if the process completes successfully.
-If for any reason the module sync fails, the CM-Handle state will then be set to *'LOCKED'*,
+which is set to search for CM Handles within CPS with an *'ADVISED'* state.
+Once the CM Handle is processed by the module sync, the CM Handle state is then set to *'READY'*, if the process completes successfully.
+If for any reason the module sync fails, the CM Handle state will then be set to *'LOCKED'*,
 and the reason for the lock will also be stored within CPS.
-CM-Handles in the *'LOCKED'* state will be retried when the system has availability. CM-Handles in a *'LOCKED'*
-state are processed by the retry mechanism, by setting CM-Handle state back to *'ADVISED'* so the next sync cycle will process those again.
+CM Handles in the *'LOCKED'* state will be retried when the system has availability. CM Handles in a *'LOCKED'*
+state are processed by the retry mechanism, by setting CM Handle state back to *'ADVISED'* so the next sync cycle will process those again.
 
 Data Sync
 ---------
 The data sync is a user :ref:`configurable timed process<additional-cps-ncmp-customizations>`,
-which is set to search for CM-Handles with a sync state of *'UNSYNCHRONIZED'*.
-Once the CM-Handle(s) with a sync state of *'UNSYNCHRONIZED'* is processed by the data sync,
-the CM-Handle sync state is then set to *'SYNCHRONIZED'*, if the process completes successfully.
-If the data sync fails, the CM-Handle sync state will remain as *'UNSYNCHRONIZED'*, and will be re-attempted.
+which is set to search for CM Handles with a sync state of *'UNSYNCHRONIZED'*.
+Once the CM Handle(s) with a sync state of *'UNSYNCHRONIZED'* is processed by the data sync,
+the CM Handle sync state is then set to *'SYNCHRONIZED'*, if the process completes successfully.
+If the data sync fails, the CM Handle sync state will remain as *'UNSYNCHRONIZED'*, and will be re-attempted.
index 940bc50..e967cde 100644 (file)
@@ -342,13 +342,13 @@ Below are the list of distributed datastructures that we have.
 +--------------+------------------------------------+-----------------------------------------------------------+
 | Component    | Data Structure Name                |                 Use                                       |
 +==============+====================================+===========================================================+
-| cps-ncmp     | moduleSyncStartedOnCmHandles       | Watchdog process to register cm handles.                  |
+| cps-ncmp     | moduleSyncStartedOnCmHandles       | Watchdog process to register CM Handles.                  |
 +--------------+------------------------------------+-----------------------------------------------------------+
 | cps-ncmp     | dataSyncSemaphores                 | Watchdog process to sync data from the nodes.             |
 +--------------+------------------------------------+-----------------------------------------------------------+
 | cps-ncmp     | moduleSyncWorkQueue                | Queue used internally for workers to pick the task.       |
 +--------------+------------------------------------+-----------------------------------------------------------+
-| cps-ncmp     | trustLevelPerCmHandle              | Stores the trust level per cm handle id                   |
+| cps-ncmp     | trustLevelPerCmHandle              | Stores the trust level per CM Handle id                   |
 +--------------+------------------------------------+-----------------------------------------------------------+
 | cps-ncmp     | trustLevelPerDmiPlugin             | Stores the trust level for the dmi-plugins.               |
 +--------------+------------------------------------+-----------------------------------------------------------+
index 7ebf6fe..65e4aa9 100644 (file)
@@ -1,7 +1,7 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
 .. Copyright (C) 2021 Pantheon.tech
-.. Modifications Copyright (C) 2021-2023 Nordix Foundation
+.. Modifications Copyright (C) 2021-2025 Nordix Foundation
 .. _modeling:
 
 .. toctree::
@@ -89,31 +89,31 @@ Note: Although additional-properties are present in the model of the dmi-registr
 Basic Concepts
 --------------
 
-- **CM-Handle** represents an instance a modeled Network Function(node) in ONAP.
+- **CM Handle** represents an instance a modeled Network Function(node) in ONAP.
 
     These are stored as Anchors within CPS-Core.
 
-    - **CM-Handle States** are used to represent the potential states in which a CM-Handle can transition between.
+    - **CM Handle States** are used to represent the potential states in which a CM Handle can transition between.
 
-        The 5 possible CM-Handle states are: ADVISED, READY, LOCKED, DELETING, DELETED
+        The 5 possible CM Handle states are: ADVISED, READY, LOCKED, DELETING, DELETED
 
-        **ADVISED** indicates that a CM-Handle has been registered successfully, and is waiting for the module synchronization process to sync the CM-Handle.
+        **ADVISED** indicates that a CM Handle has been registered successfully, and is waiting for the module synchronization process to sync the CM Handle.
 
-        **READY** indicates that the CM-Handle has been synced successfully.
+        **READY** indicates that the CM Handle has been synced successfully.
 
-        **LOCKED** indicates that the CM-Handle has not synced successfully. A retry mechanism within CPS will set the state back to ADVISED after a set time.
+        **LOCKED** indicates that the CM Handle has not synced successfully. A retry mechanism within CPS will set the state back to ADVISED after a set time.
 
-        **DELETING** indicates that the CM-Handle is currently being deleted.
+        **DELETING** indicates that the CM Handle is currently being deleted.
 
-        **DELETED** indicates that the CM-Handle has been deleted successfully.
+        **DELETED** indicates that the CM Handle has been deleted successfully.
 
-    - **Data-sync state** is the state of the data synchronization process of the CM-Handle
+    - **Data-sync state** is the state of the data synchronization process of the CM Handle
 
         There are 3 possibles states: NONE_REQUESTED, UNSYNCHRONIZED, SYNCHRONIZED
 
         **NONE_REQUESTED** indicates that the data sync is not requested by the user
 
-        **UNSYNCHRONIZED** indicates the cm-handle is waiting for the data sync watchdog operation to carry out the sync process
+        **UNSYNCHRONIZED** indicates the CM Handle is waiting for the data sync watchdog operation to carry out the sync process
 
         **SYNCHRONIZED** indicates the watchdog process has finished the data synchronization successfully
 
index 10c3bfa..e0b7bb8 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2023-2024 Nordix Foundation
+.. Copyright (C) 2023-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _cmHandleDataOperation:
@@ -15,7 +15,7 @@ Data Operations Endpoint
 Introduction
 ============
 
-For all data operations on cm handle(s), we have a post endpoint:
+For all data operations on CM Handle(s), we have a post endpoint:
 
 - /ncmp/v1/data?topic={client-topic-name} forward request to it's dmi plugin service.
 
@@ -50,7 +50,7 @@ This endpoint executes data operation for given array of operations:
     |                          |             | implementation. For ONAP DMI Plugin it will be RESTConf paths but it can|
     |                          |             | really be anything.                                                     |
     +--------------------------+-------------+-------------------------------------------------------------------------+
-    | targetIds                | Yes         | List of cm handle references                                            |
+    | targetIds                | Yes         | List of CM Handle references                                            |
     +--------------------------+-------------+-------------------------------------------------------------------------+
 
 The status codes used in the events resulting from these operations are defined here:
@@ -156,4 +156,4 @@ DMI Service 2 (POST) : `http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-t
 
 Above examples are for illustration purposes only. Please refer to link below for latest schema.
 
-:download:`Data operation event schema <schemas/data-operation-event-schema-1.0.0.json>`
\ No newline at end of file
+:download:`Data operation event schema <schemas/data-operation-event-schema-1.0.0.json>`
index 19ab8b4..bc99214 100644 (file)
@@ -1,6 +1,8 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2021 Pantheon.tech, Nordix Foundation
+.. Copyright (C) 2021 Pantheon.tech
+.. Modifications Copyright (C) 2021-2025 Nordix Foundation
+
 .. _overview:
 
 CPS Overview
@@ -45,7 +47,7 @@ even though CPS-Core could be deployed without the NCMP extension.
 NCMP-DMI-Plugin
 ---------------
 
-The Data-Model-Inventory (DMI) Plugin is a rest interface used to synchronize CM-Handles data between CPS and DMI through the DMI-Plugin.
+The Data-Model-Inventory (DMI) Plugin is a rest interface used to synchronize CM Handles data between CPS and DMI through the DMI-Plugin.
 This is built previously from the CPS-NF-Proxy component.
 
 CPS Project
index 9c825e4..76d75cd 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2021-2024 Nordix Foundation
+.. Copyright (C) 2021-2025 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _release_notes:
@@ -71,7 +71,7 @@ Bug Fixes
 3.5.5
     - `CPS-2509 <https://lf-onap.atlassian.net/browse/CPS-2509>`_ Fix module endpoints using alternate identifier.
     - `CPS-2517 <https://lf-onap.atlassian.net/browse/CPS-2517>`_ Make Content-Type header default to JSON for CPS APIs.
-    - `CPS-2530 <https://lf-onap.atlassian.net/browse/CPS-2530>`_ NCMP Modules API giving empty response on READY cm handles if two sub systems discovered in parallel.
+    - `CPS-2530 <https://lf-onap.atlassian.net/browse/CPS-2530>`_ NCMP Modules API giving empty response on READY CM Handles if two sub systems discovered in parallel.
 
 Features
 --------
@@ -82,7 +82,7 @@ Features
     - `CPS-2436 <https://lf-onap.atlassian.net/browse/CPS-2436>`_ CM Avc Event to publish source key to target key while forwarding.
     - `CPS-2445 <https://lf-onap.atlassian.net/browse/CPS-2445>`_ Expose CPS and NCMP version information using git plugin.
     - `CPS-2451 <https://lf-onap.atlassian.net/browse/CPS-2451>`_ Removing oparent from CPS-NCMP and ONAP DMI Plugin repository.
-    - `CPS-2478 <https://lf-onap.atlassian.net/browse/CPS-2478>`_ Optimized Cm Handle Registration and De-Registration use case.
+    - `CPS-2478 <https://lf-onap.atlassian.net/browse/CPS-2478>`_ Optimized CM Handle Registration and De-Registration use case.
     - `CPS-2507 <https://lf-onap.atlassian.net/browse/CPS-2507>`_ Upgrade liquibase to 4.30.0 version.
 
 Performance
@@ -112,7 +112,7 @@ Release Data
 Bug Fixes
 ---------
 3.5.4
-    - `CPS-2403 <https://lf-onap.atlassian.net/browse/CPS-2403>`_ Improve lock handling and queue management during CM-handle Module Sync.
+    - `CPS-2403 <https://lf-onap.atlassian.net/browse/CPS-2403>`_ Improve lock handling and queue management during CM Handle Module Sync.
 
 Features
 --------
@@ -220,7 +220,7 @@ Features
 --------
 3.5.1
     - `CPS-2121 <https://lf-onap.atlassian.net/browse/CPS-2121>`_ Enabled http client prometheus metrics and manage high cardinality using URL template.
-    - `CPS-2289 <https://lf-onap.atlassian.net/browse/CPS-2289>`_ Support for CPS Path Query in NCMP Inventory Cm Handle Search.
+    - `CPS-2289 <https://lf-onap.atlassian.net/browse/CPS-2289>`_ Support for CPS Path Query in NCMP Inventory CM Handle Search.
 
 Version: 3.5.0
 ==============
@@ -530,7 +530,7 @@ Known Limitations, Issues and Workarounds
 For upgrading, CPS uses Liquibase for database upgrades. In order to enable Hibernate write batching
 (`CPS-1795 <https://lf-onap.atlassian.net/browse/CPS-1795>`_), a change to the database entity ID generation is required.
 As such, *this release does not fully support In-Service Software Upgrade* - CPS will not store new DataNodes and
-NCMP will not register new CM-handles during an upgrade with old and new versions of CPS running concurrently.
+NCMP will not register new CM Handles during an upgrade with old and new versions of CPS running concurrently.
 Other operations (read, update, delete) are not impacted.
 
 
@@ -805,7 +805,7 @@ Bug Fixes
 
 Features
 --------
-    - `CPS-1515 <https://lf-onap.atlassian.net/browse/CPS-1515>`_ Support Multiple CM-Handles for NCMP Get Operation
+    - `CPS-1515 <https://lf-onap.atlassian.net/browse/CPS-1515>`_ Support Multiple CM Handles for NCMP Get Operation
     - `CPS-1675 <https://lf-onap.atlassian.net/browse/CPS-1675>`_ Persistence write performance improvement(s)
     - `CPS-1745 <https://lf-onap.atlassian.net/browse/CPS-1745>`_ Upgrade to Openapi 3.0.3
 
@@ -1265,7 +1265,7 @@ Features
    - `CPS-869 <https://lf-onap.atlassian.net/browse/CPS-869>`_  Apply Standardized logging fields to adhere to ONAP Best practice REQ-1072
    - `CPS-870 <https://lf-onap.atlassian.net/browse/CPS-870>`_  Align CPS-Core output with SDN-C output (add module name)
    - `CPS-875 <https://lf-onap.atlassian.net/browse/CPS-875>`_  CM Handle State: Watchdog-process that syncs 'ADVISED' CM Handles
-   - `CPS-877 <https://lf-onap.atlassian.net/browse/CPS-877>`_  CM Handle State: Exclude any CM-Handles from queries/operations that are not in state 'READY'
+   - `CPS-877 <https://lf-onap.atlassian.net/browse/CPS-877>`_  CM Handle State: Exclude any CM Handles from queries/operations that are not in state 'READY'
    - `CPS-899 <https://lf-onap.atlassian.net/browse/CPS-899>`_  Start and stop sessions on Java API
    - `CPS-909 <https://lf-onap.atlassian.net/browse/CPS-909>`_  Separate NCMP endpoint for ch/{cm-handle}/properties and ch/{cm-handle}/state
    - `CPS-917 <https://lf-onap.atlassian.net/browse/CPS-917>`_  Structured Errors response for passthrough use-cases in NCMP
@@ -1278,7 +1278,7 @@ Features
    - `CPS-1099 <https://lf-onap.atlassian.net/browse/CPS-1099>`_  Expose simplified 'external' lock reason enum state over REST interface
    - `CPS-1101 <https://lf-onap.atlassian.net/browse/CPS-1101>`_  Introducing the DELETING and DELETED Cmhandle State
    - `CPS-1102 <https://lf-onap.atlassian.net/browse/CPS-1102>`_  Register the Cmhandle Sends Advised State notification.
-   - `CPS-1133 <https://lf-onap.atlassian.net/browse/CPS-1133>`_  Enable/Disable Data Sync for Cm Handle
+   - `CPS-1133 <https://lf-onap.atlassian.net/browse/CPS-1133>`_  Enable/Disable Data Sync for CM Handle
    - `CPS-1136 <https://lf-onap.atlassian.net/browse/CPS-1136>`_  DMI Audit Support (get all CM Handles for a registered DMI)
 
 
@@ -1379,27 +1379,27 @@ Features
    - `CPS-559 <https://lf-onap.atlassian.net/browse/CPS-559>`_  Define response objects (schemas) in cps-ncmp
    - `CPS-636 <https://lf-onap.atlassian.net/browse/CPS-636>`_  Update operation for datastore pass through running
    - `CPS-638 <https://lf-onap.atlassian.net/browse/CPS-638>`_  Delete operation for datastore pass through running
-   - `CPS-677 <https://lf-onap.atlassian.net/browse/CPS-677>`_  Support 'public' Cm Handle Properties
-   - `CPS-741 <https://lf-onap.atlassian.net/browse/CPS-741>`_  Re sync after removing cm handles
+   - `CPS-677 <https://lf-onap.atlassian.net/browse/CPS-677>`_  Support 'public' CM Handle Properties
+   - `CPS-741 <https://lf-onap.atlassian.net/browse/CPS-741>`_  Re sync after removing CM Handles
    - `CPS-777 <https://lf-onap.atlassian.net/browse/CPS-777>`_  Ensure all DMI operations use POST method
    - `CPS-780 <https://lf-onap.atlassian.net/browse/CPS-780>`_  Add examples for parameters, request and response in openapi yaml for cps-core
    - `CPS-789 <https://lf-onap.atlassian.net/browse/CPS-789>`_ CPS Data Updated Event Schema V2 to support delete operation
    - `CPS-791 <https://lf-onap.atlassian.net/browse/CPS-791>`_ CPS-Core sends delete notification event
-   - `CPS-817 <https://lf-onap.atlassian.net/browse/CPS-817>`_  Create Endpoint For Get Cm Handles (incl. public properties) By Name
+   - `CPS-817 <https://lf-onap.atlassian.net/browse/CPS-817>`_  Create Endpoint For Get CM Handles (incl. public properties) By Name
    - `CPS-837 <https://lf-onap.atlassian.net/browse/CPS-837>`_  Add Remove and Update properties (DMI and Public) as part of CM Handle Registration update
 
 Bug Fixes
 ---------
 
-   - `CPS-762 <https://lf-onap.atlassian.net/browse/CPS-762>`_ Query cm handles for module names returns incorrect cm handle identifiers
+   - `CPS-762 <https://lf-onap.atlassian.net/browse/CPS-762>`_ Query CM Handles for module names returns incorrect CM Handle identifiers
    - `CPS-788 <https://lf-onap.atlassian.net/browse/CPS-788>`_ Yang Resource formatting is incorrect
-   - `CPS-783 <https://lf-onap.atlassian.net/browse/CPS-783>`_ Remove cm handle does not completely remove all cm handle information
+   - `CPS-783 <https://lf-onap.atlassian.net/browse/CPS-783>`_ Remove CM Handle does not completely remove all CM Handle information
    - `CPS-841 <https://lf-onap.atlassian.net/browse/CPS-841>`_ Upgrade log4j to 2.17.1 as recommended by ONAP SECCOM
    - `CPS-856 <https://lf-onap.atlassian.net/browse/CPS-856>`_ Retry mechanism not working for concurrent CmHandle registration
    - `CPS-867 <https://lf-onap.atlassian.net/browse/CPS-867>`_ Database port made configurable through env variable DB_PORT
    - `CPS-886 <https://lf-onap.atlassian.net/browse/CPS-886>`_ Fragment handling decreasing performance for large number of cmHandles
    - `CPS-887 <https://lf-onap.atlassian.net/browse/CPS-887>`_ Increase performance of cmHandle registration for large number of schema sets in DB
-   - `CPS-892 <https://lf-onap.atlassian.net/browse/CPS-892>`_ Fixed the response code during CM-Handle Registration from 201 CREATED to 204 NO_CONTENT
+   - `CPS-892 <https://lf-onap.atlassian.net/browse/CPS-892>`_ Fixed the response code during CM Handle Registration from 201 CREATED to 204 NO_CONTENT
    - `CPS-893 <https://lf-onap.atlassian.net/browse/CPS-893>`_ NCMP Java API depends on NCMP-Rest-API (cyclic) through json properties on Java API
 
 Known Limitations, Issues and Workarounds
@@ -1407,9 +1407,9 @@ Known Limitations, Issues and Workarounds
 
 *System Limitations*
 
-Null can no longer be passed within the dmi plugin service names when registering a cm handle, as part of
+Null can no longer be passed within the dmi plugin service names when registering a CM Handle, as part of
 `CPS-837 <https://lf-onap.atlassian.net/browse/CPS-837>`_ null is now used to indicate if a property should be removed as part
-of cm handle registration.
+of CM Handle registration.
 
 The Absolute path to list with integer key will not work. Please refer `CPS-961 <https://lf-onap.atlassian.net/browse/CPS-961>`_
 for more information.
index 2402c1b..75cb3cd 100644 (file)
@@ -164,7 +164,6 @@ abstract class CpsIntegrationSpecBase extends Specification {
         if (!initialized) {
             cpsDataspaceService.createDataspace(GENERAL_TEST_DATASPACE)
             createStandardBookStoreSchemaSet(GENERAL_TEST_DATASPACE)
-            cpsAnchorService.createAnchor(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET, 'owner-of-bookstore-schema-set-do-not-delete')
             initialized = true
         }
         mockDmiServer1.setDispatcher(dmiDispatcher1)
@@ -184,7 +183,7 @@ abstract class CpsIntegrationSpecBase extends Specification {
         mockDmiServer1.shutdown()
         mockDmiServer2.shutdown()
         mockPolicyServer.shutdown()
-        cpsModuleService.deleteAllUnusedYangModuleData()
+        cpsModuleService.deleteAllUnusedYangModuleData('NFP-Operational')
     }
 
     def static readResourceDataFile(filename) {
index 2bd5a4a..ca32111 100644 (file)
@@ -59,17 +59,17 @@ class AnchorServiceIntegrationSpec extends FunctionalSpecBase {
         and: '1 anchor with "other" schema set is created'
             createStandardBookStoreSchemaSet(GENERAL_TEST_DATASPACE, 'otherSchemaSet')
             objectUnderTest.createAnchor(GENERAL_TEST_DATASPACE, 'otherSchemaSet', 'anchor3')
-        then: 'there are 4 anchors in the general test database'
-            assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE).size() == 4
-        and: 'there are 3 anchors associated with bookstore schema set'
-            assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET).size() == 3
+        then: 'there are 3 anchors in the general test database'
+            assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE).size() == 3
+        and: 'there are 2 anchors associated with bookstore schema set'
+            assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET).size() == 2
         and: 'there is 1 anchor associated with other schema set'
             assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, 'otherSchemaSet').size() == 1
     }
 
     def 'Querying anchor(name)s (depends on previous test!).'() {
-        expect: 'there are now 4 anchors using the "stores" module (both schema sets use the same modules) '
-            assert objectUnderTest.queryAnchorNames(GENERAL_TEST_DATASPACE, ['stores', 'bookstore-types']).size() == 4
+        expect: 'there are now 3 anchors using the "stores" module (both schema sets use the same modules)'
+            assert objectUnderTest.queryAnchorNames(GENERAL_TEST_DATASPACE, ['stores', 'bookstore-types']).size() == 3
         and: 'there are no anchors using both "stores" and a "unused-model"'
             assert objectUnderTest.queryAnchorNames(GENERAL_TEST_DATASPACE, ['stores', 'unused-model']).size() == 0
     }
index 178b022..47a332a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2023 Nordix Foundation
+ *  Copyright (C) 2023-2025 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -32,8 +32,6 @@ class DataspaceServiceIntegrationSpec extends FunctionalSpecBase {
 
     def setup() { objectUnderTest = cpsDataspaceService }
 
-    def cleanup() { cpsModuleService.deleteAllUnusedYangModuleData() }
-
     def 'Dataspace CRUD operations.'() {
         when: 'a dataspace is created'
             objectUnderTest.createDataspace('newDataspace')
index d801087..c787b42 100644 (file)
@@ -61,8 +61,6 @@ class ModuleServiceIntegrationSpec extends FunctionalSpecBase {
 
     def setup() { objectUnderTest = cpsModuleService }
 
-    def cleanup() { objectUnderTest.deleteAllUnusedYangModuleData() }
-
     /*
         C R E A T E   S C H E M A   S E T   U S E - C A S E S
      */
index 28714fd..097a043 100644 (file)
@@ -79,7 +79,6 @@ class CmHandleUpgradeSpec extends CpsIntegrationSpecBase {
 
         cleanup: 'deregister CM-handle and remove all associated module resources'
             deregisterCmHandle(DMI1_URL, cmHandleId)
-            cpsModuleService.deleteAllUnusedYangModuleData()
 
         where: 'following module set tags are used'
             initialModuleSetTag | updatedModuleSetTag
index d1353b8..9cb8c29 100644 (file)
@@ -114,7 +114,6 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
             def stopWatch = new StopWatch()
             stopWatch.start()
             deregisterSequenceOfCmHandles(DMI1_URL, totalCmHandles, 1)
-            cpsModuleService.deleteAllUnusedYangModuleData()
             stopWatch.stop()
             println "*** CPS-2478, Deletion of $totalCmHandles cm handles took ${stopWatch.getTotalTimeMillis()} milliseconds"
     }
index 613f760..e52d3f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ class ModuleQueryPerfTest extends CpsPerfTestBase {
                 cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, (i..i+100).collect {SCHEMA_SET_PREFIX + it})
             }
             cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, [SCHEMA_SET_PREFIX + '0'])
-            cpsModuleService.deleteAllUnusedYangModuleData()
+            cpsModuleService.deleteAllUnusedYangModuleData(CPS_PERFORMANCE_TEST_DATASPACE)
     }
 
     // This makes a Yang module of approximately target length in bytes by padding the description field with many '*'