diff options
-rwxr-xr-x | .gitignore | 1 | ||||
-rw-r--r-- | cps-ncmp-rest/docs/openapi/components.yaml | 47 | ||||
-rwxr-xr-x | cps-ncmp-rest/docs/openapi/ncmp.yml | 29 | ||||
-rwxr-xr-x | cps-ncmp-rest/docs/openapi/openapi.yml | 5 | ||||
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | 7 | ||||
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 8 | ||||
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 2 | ||||
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/notification/CpsDataUpdatedEventFactory.java | 4 | ||||
-rw-r--r-- | docs/admin-guide.rst | 8 | ||||
-rwxr-xr-x | docs/conf.py | 5 | ||||
-rw-r--r-- | docs/deployment.rst | 3 | ||||
-rwxr-xr-x | docs/index.rst | 4 |
12 files changed, 109 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore index 3da7d4a057..58f1b2b12f 100755 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.jar *.war *.log +*.log.zip cps-application/archunit_store target/ diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index d35919da4b..1f55ce1998 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -19,6 +19,7 @@ components: schemas: + # Common Schemas ErrorMessage: type: object title: Error @@ -30,6 +31,7 @@ components: details: type: string + # Request Schemas RestDmiPluginRegistration: type: object properties: @@ -65,6 +67,51 @@ components: type: string example: system-001 + Conditions: + type: object + properties: + conditions: + $ref: '#/components/schemas/ConditionsData' + ConditionsData: + type: array + items: + type: object + $ref: '#/components/schemas/ConditionProperties' + ConditionProperties: + properties: + name: + type: string + example: hasAllModules + conditionParameters: + $ref: '#/components/schemas/ConditionParameters' + ConditionParameters: + type: array + items: + type: object + $ref: '#/components/schemas/ConditionParameter' + ConditionParameter: + properties: + moduleName: + type: string + example: someModuleName + + #Response Schemas + CmHandles: + type: object + properties: + cmHandles: + $ref: '#/components/schemas/CmHandleProperties' + CmHandleProperties: + type: array + items: + type: object + $ref: '#/components/schemas/CmHandleProperty' + CmHandleProperty: + properties: + cmHandleId: + type: string + example: someCmHandleId + parameters: cmHandleInPath: name: cm-handle diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml index 52245c3cc0..9e3560a2fa 100755 --- a/cps-ncmp-rest/docs/openapi/ncmp.yml +++ b/cps-ncmp-rest/docs/openapi/ncmp.yml @@ -283,4 +283,31 @@ fetchModuleReferencesByCmHandle: 403: $ref: 'components.yaml#/components/responses/Forbidden' 404: - $ref: 'components.yaml#/components/responses/NotFound'
\ No newline at end of file + $ref: 'components.yaml#/components/responses/NotFound' + +executeCmHandleSearch: + post: + description: Execute cm handle searches using 'hasAllModules' condition to get all cm handles for the given module names + tags: + - network-cm-proxy + summary: Execute cm handle search using the available conditions + operationId: executeCmHandleSearch + requestBody: + required: true + content: + application/json: + schema: + $ref: 'components.yaml#/components/schemas/Conditions' + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: 'components.yaml#/components/schemas/CmHandles' + 400: + $ref: 'components.yaml#/components/responses/BadRequest' + 401: + $ref: 'components.yaml#/components/responses/Unauthorized' + 403: + $ref: 'components.yaml#/components/responses/Forbidden'
\ No newline at end of file diff --git a/cps-ncmp-rest/docs/openapi/openapi.yml b/cps-ncmp-rest/docs/openapi/openapi.yml index 69c2a117d6..64a74c5933 100755 --- a/cps-ncmp-rest/docs/openapi/openapi.yml +++ b/cps-ncmp-rest/docs/openapi/openapi.yml @@ -45,4 +45,7 @@ paths: $ref: 'ncmp.yml#/resourceDataForPassthroughRunning' /v1/ch/{cm-handle}/modules: - $ref: 'ncmp.yml#/fetchModuleReferencesByCmHandle'
\ No newline at end of file + $ref: 'ncmp.yml#/fetchModuleReferencesByCmHandle' + + /v1/ch/searches: + $ref: 'ncmp.yml#/executeCmHandleSearch'
\ No newline at end of file diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 9b15a7890d..14f33d1e24 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -29,6 +29,8 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; import org.onap.cps.ncmp.rest.api.NetworkCmProxyApi; +import org.onap.cps.ncmp.rest.model.CmHandles; +import org.onap.cps.ncmp.rest.model.Conditions; import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.DataNode; import org.onap.cps.spi.model.ModuleReference; @@ -194,6 +196,11 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { } @Override + public ResponseEntity<CmHandles> executeCmHandleSearch(final Conditions conditions) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } + + @Override public ResponseEntity<Object> getModuleReferencesByCmHandle(final String cmHandle) { final Collection<ModuleReference> moduleReferences = networkCmProxyDataService.getYangResourcesModuleReferences(cmHandle); diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index d6aaf36d3a..11d1a89652 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -388,11 +388,11 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService prepareModuleSubsets(moduleReferencesFromCmHandle, existingModuleReferences, unknownModuleReferences); final Map<String, String> newYangResourcesModuleNameToContentMap; - if (unknownModuleReferences.size() > 0) { - newYangResourcesModuleNameToContentMap = getNewYangResourcesFromDmi(persistenceCmHandle, - unknownModuleReferences, cmHandlePropertiesAsMap); - } else { + if (unknownModuleReferences.isEmpty()) { newYangResourcesModuleNameToContentMap = new HashMap<>(); + } else { + newYangResourcesModuleNameToContentMap = getNewYangResourcesFromDmi(persistenceCmHandle, + unknownModuleReferences, cmHandlePropertiesAsMap); } cpsModuleService.createSchemaSetFromModules(NF_PROXY_DATASPACE_NAME, persistenceCmHandle.getId(), newYangResourcesModuleNameToContentMap, existingModuleReferences); diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index f924c70453..2397d31792 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -303,7 +303,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService final Map<String, FragmentEntity> existingChildrenByXpath = existingFragmentEntity.getChildFragments() .stream().collect(Collectors.toMap(FragmentEntity::getXpath, childFragmentEntity -> childFragmentEntity)); - final Collection updatedChildFragments = new HashSet<FragmentEntity>(); + final Collection<FragmentEntity> updatedChildFragments = new HashSet<>(); for (final DataNode submittedChildDataNode : submittedDataNode.getChildDataNodes()) { final FragmentEntity childFragment; diff --git a/cps-service/src/main/java/org/onap/cps/notification/CpsDataUpdatedEventFactory.java b/cps-service/src/main/java/org/onap/cps/notification/CpsDataUpdatedEventFactory.java index 85e5abab0d..2985ed53bb 100644 --- a/cps-service/src/main/java/org/onap/cps/notification/CpsDataUpdatedEventFactory.java +++ b/cps-service/src/main/java/org/onap/cps/notification/CpsDataUpdatedEventFactory.java @@ -34,6 +34,7 @@ import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.Anchor; import org.onap.cps.spi.model.DataNode; import org.onap.cps.utils.DataMapUtils; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; @Component @@ -58,7 +59,8 @@ public class CpsDataUpdatedEventFactory { private final CpsDataService cpsDataService; private final CpsAdminService cpsAdminService; - public CpsDataUpdatedEventFactory(final CpsDataService cpsDataService, final CpsAdminService cpsAdminService) { + public CpsDataUpdatedEventFactory(@Lazy final CpsDataService cpsDataService, + final CpsAdminService cpsAdminService) { this.cpsDataService = cpsDataService; this.cpsAdminService = cpsAdminService; } diff --git a/docs/admin-guide.rst b/docs/admin-guide.rst index 3a6f8e2559..7689ee5b6d 100644 --- a/docs/admin-guide.rst +++ b/docs/admin-guide.rst @@ -12,6 +12,9 @@ CPS Admin Guide .. toctree:: :maxdepth: 1 +.. Below Label is used by documentation for other CPS components to link here, do not remove even if it gives a warning +.. _cps_common_logging: + Logging & Diagnostics ===================== @@ -44,6 +47,9 @@ Logger configuration is provided as a chart resource : | ncmp-dmi-plugin | Not yet applicable to DMI-Plugin | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +.. Below Label is used by documentation for other CPS components to link here, do not remove even if it gives a warning +.. _cps_common_monitoring: + Monitoring ========== Once CPS-Core is deployed, information related to the running instance of the application is available @@ -69,4 +75,4 @@ Prometheus Metrics can be checked at the following endpoint .. code:: - http://<cps-component-service-name>:8081/manage/prometheus
\ No newline at end of file + http://<cps-component-service-name>:8081/manage/prometheus diff --git a/docs/conf.py b/docs/conf.py index 3aaddd194f..84dac1ea21 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,14 +20,15 @@ from docutils.parsers.rst import directives from docs_conf.conf import * +#change 'latest' to relevant branch-name once branch has been created branch = 'latest' doc_url = 'https://docs.onap.org/projects' master_doc = 'index' intersphinx_mapping = {} -# Latest (change to branch) -intersphinx_mapping['onap-cps'] = ('{}/onap-cps/en/%s'.format(doc_url) % branch, None) +intersphinx_mapping['onap-cps-ncmp-dmi-plugin'] = ('{}/onap-cps-ncmp-dmi-plugin/en/%s'.format(doc_url) % branch, None) +intersphinx_mapping['onap-cps-cps-temporal'] = ('{}/onap-cps-cps-temporal/en/%s'.format(doc_url) % branch, None) linkcheck_ignore = [ 'http://localhost', diff --git a/docs/deployment.rst b/docs/deployment.rst index 61f9ad2943..b1839cbb88 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -98,7 +98,8 @@ Each cps component can be restarted independently by issuing the following comma kubectl delete pod <cps-component-pod-name> -n <namespace> -.. _credentials_retrieval: +.. Below Label is used by documentation for other CPS components to link here, do not remove even if it gives a warning +.. _cps_common_credentials_retrieval: Credentials Retrieval --------------------- diff --git a/docs/index.rst b/docs/index.rst index cbe1b69d08..b749604eeb 100755 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,9 +25,9 @@ CPS Documentation DMI-Plugin Documentation ----------------------------- -* `DMI-Plugin <https://docs.onap.org/projects/onap-cps-ncmp-dmi-plugin/en/latest/index.html>`_ +* :ref:`DMI-Plugin<onap-cps-ncmp-dmi-plugin:master_index>` CPS-Temporal Documentation -------------------------- -* `CPS-Temporal <https://docs.onap.org/projects/onap-cps-cps-temporal/en/latest/index.html>`_ +* :ref:`CPS-Temporal<onap-cps-cps-temporal:master_index>` |