From: Renu Kumari Date: Wed, 2 Feb 2022 15:16:19 +0000 (+0000) Subject: Merge "Refactored Delete SchemaSet functionality" X-Git-Tag: 3.0.0~34 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=cdc85a32069485641b0c8c37f8d7c4e6727e336a;hp=5427ef054effb1aadfaaab300282545c99c37a61;p=cps.git Merge "Refactored Delete SchemaSet functionality" --- diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml index d615e995c6..723e2ca196 100644 --- a/cps-application/src/main/resources/application.yml +++ b/cps-application/src/main/resources/application.yml @@ -41,7 +41,7 @@ spring: dialect: org.hibernate.dialect.PostgreSQLDialect datasource: - url: jdbc:postgresql://${DB_HOST}:5432/cpsdb + url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/cpsdb username: ${DB_USERNAME} password: ${DB_PASSWORD} driverClassName: org.postgresql.Driver diff --git a/cps-application/src/test/java/org/onap/cps/architecture/LayeredArchitectureTest.java b/cps-application/src/test/java/org/onap/cps/architecture/LayeredArchitectureTest.java index bc5ad18963..817bd58351 100644 --- a/cps-application/src/test/java/org/onap/cps/architecture/LayeredArchitectureTest.java +++ b/cps-application/src/test/java/org/onap/cps/architecture/LayeredArchitectureTest.java @@ -42,6 +42,7 @@ public class LayeredArchitectureTest { private static final String SPI_REPOSITORY_PACKAGE = "org.onap.cps.spi.repository.."; private static final String YANG_SCHEMA_PACKAGE = "org.onap.cps.yang.."; private static final String NOTIFICATION_PACKAGE = "org.onap.cps.notification.."; + private static final String CPS_UTILS_PACKAGE = "org.onap.cps.utils.."; @ArchTest static final ArchRule restControllerShouldOnlyDependOnRestController = @@ -49,11 +50,11 @@ public class LayeredArchitectureTest { .resideInAPackage(REST_CONTROLLER_PACKAGE); @ArchTest - static final ArchRule apiOrSpiServiceShouldOnlyBeDependedOnByControllerAndServices = + static final ArchRule apiOrSpiServiceShouldOnlyBeDependedOnByControllerAndServicesAndCommonUtilityPackages = freeze(classes().that().resideInAPackage(API_SERVICE_PACKAGE) .or().resideInAPackage(SPI_SERVICE_PACKAGE).should().onlyHaveDependentClassesThat() .resideInAnyPackage(REST_CONTROLLER_PACKAGE, API_SERVICE_PACKAGE, SPI_SERVICE_PACKAGE, NCMP_REST_PACKAGE, - NCMP_SERVICE_PACKAGE, YANG_SCHEMA_PACKAGE, NOTIFICATION_PACKAGE)); + NCMP_SERVICE_PACKAGE, YANG_SCHEMA_PACKAGE, NOTIFICATION_PACKAGE, CPS_UTILS_PACKAGE)); @ArchTest static final ArchRule repositoryShouldOnlyBeDependedOnByServicesAndRepository = diff --git a/cps-rest/docs/openapi/components.yml b/cps-rest/docs/openapi/components.yml index ff2816af6d..5f31569c9a 100644 --- a/cps-rest/docs/openapi/components.yml +++ b/cps-rest/docs/openapi/components.yml @@ -1,5 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (c) 2021 Bell Canada. +# Modifications Copyright (C) 2021-2022 Nordix Foundation # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -277,6 +278,16 @@ components: schema: type: string example: my-resource + InternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorMessage" + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred NoContent: description: No Content content: {} diff --git a/cps-rest/docs/openapi/cpsAdmin.yml b/cps-rest/docs/openapi/cpsAdmin.yml index 869cb6e724..a25f81eafc 100644 --- a/cps-rest/docs/openapi/cpsAdmin.yml +++ b/cps-rest/docs/openapi/cpsAdmin.yml @@ -1,5 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (c) 2021 Bell Canada. +# Modifications Copyright (C) 2021-2022 Nordix Foundation # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,13 +29,14 @@ dataspaces: responses: '201': $ref: 'components.yml#/components/responses/Created' - '400': - $ref: 'components.yml#/components/responses/BadRequest' '401': $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - + '409': + $ref: 'components.yml#/components/responses/Conflict' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' delete: description: Delete a dataspace tags: @@ -54,6 +56,8 @@ dataspaces: $ref: 'components.yml#/components/responses/Forbidden' '409': $ref: 'components.yml#/components/responses/Conflict' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' schemaSet: post: @@ -71,7 +75,6 @@ schemaSet: multipart/form-data: schema: $ref: 'components.yml#/components/schemas/MultipartFile' - responses: '201': $ref: 'components.yml#/components/responses/Created' @@ -81,6 +84,10 @@ schemaSet: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' + '409': + $ref: 'components.yml#/components/responses/Conflict' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' schemaSetBySchemaSetName: get: @@ -105,9 +112,8 @@ schemaSetBySchemaSetName: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - '404': - $ref: 'components.yml#/components/responses/NotFound' - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' delete: description: Delete a schema set given a schema set name and a dataspace tags: @@ -128,6 +134,8 @@ schemaSetBySchemaSetName: $ref: 'components.yml#/components/responses/Forbidden' '409': $ref: 'components.yml#/components/responses/Conflict' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' anchorsByDataspace: get: @@ -153,9 +161,8 @@ anchorsByDataspace: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - '404': - $ref: 'components.yml#/components/responses/NotFound' - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' post: description: Create a new anchor in the given dataspace tags: @@ -175,6 +182,10 @@ anchorsByDataspace: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' + '409': + $ref: 'components.yml#/components/responses/Conflict' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' anchorByDataspaceAndAnchorName: get: @@ -199,9 +210,8 @@ anchorByDataspaceAndAnchorName: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - '404': - $ref: 'components.yml#/components/responses/NotFound' - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' delete: description: Delete an anchor given an anchor name and a dataspace tags: @@ -219,4 +229,6 @@ anchorByDataspaceAndAnchorName: '401': $ref: 'components.yml#/components/responses/Unauthorized' '403': - $ref: 'components.yml#/components/responses/Forbidden' \ No newline at end of file + $ref: 'components.yml#/components/responses/Forbidden' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' \ No newline at end of file diff --git a/cps-rest/docs/openapi/cpsData.yml b/cps-rest/docs/openapi/cpsData.yml index 15f8a1c71b..099512d7dc 100644 --- a/cps-rest/docs/openapi/cpsData.yml +++ b/cps-rest/docs/openapi/cpsData.yml @@ -1,5 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (c) 2021 Bell Canada. +# Modifications Copyright (C) 2021-2022 Nordix Foundation # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,8 +45,8 @@ nodeByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - '404': - $ref: 'components.yml#/components/responses/NotFound' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' x-codegen-request-body-name: xpath listElementByDataspaceAndAnchor: @@ -78,7 +79,8 @@ listElementByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' put: description: Replace list content under a given parent, anchor and dataspace tags: @@ -108,7 +110,8 @@ listElementByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' delete: description: Delete one or all list element(s) for a given anchor and dataspace deprecated: true @@ -130,6 +133,8 @@ listElementByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' nodesByDataspaceAndAnchor: post: @@ -161,7 +166,10 @@ nodesByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - + '409': + $ref: 'components.yml#/components/responses/Conflict' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' patch: description: Update a data node leaves for a given dataspace and anchor and a parent node xpath tags: @@ -191,7 +199,8 @@ nodesByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' delete: description: Delete a datanode for a given dataspace and anchor given a node xpath. tags: @@ -212,8 +221,8 @@ nodesByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - - + '500': + $ref: 'components.yml#/components/responses/InternalServerError' put: description: Replace a node with descendants for a given dataspace, anchor and a parent node xpath tags: @@ -243,3 +252,5 @@ nodesByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' diff --git a/cps-rest/docs/openapi/cpsQuery.yml b/cps-rest/docs/openapi/cpsQuery.yml index 4f938aa891..06c9ca2a24 100644 --- a/cps-rest/docs/openapi/cpsQuery.yml +++ b/cps-rest/docs/openapi/cpsQuery.yml @@ -1,5 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (C) 2021 Nordix Foundation +# Copyright (C) 2021-2022 Nordix Foundation # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,6 +45,6 @@ nodesByDataspaceAndAnchorAndCpsPath: $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' - '404': - $ref: 'components.yml#/components/responses/NotFound' + '500': + $ref: 'components.yml#/components/responses/InternalServerError' x-codegen-request-body-name: xpath diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index d0a157e890..44ebd3bc69 100755 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -89,7 +89,7 @@ services: container_name: dbpostgresql image: postgres:13.2-alpine ports: - - '5432:5432' + - ${DB_PORT:-5432}:5432 environment: POSTGRES_DB: cpsdb POSTGRES_USER: ${DB_USERNAME:-cps} diff --git a/docs/release-notes.rst b/docs/release-notes.rst index d080b037f1..058f6baaeb 100755 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -40,6 +40,7 @@ Bug Fixes - `CPS-788 `_ Yang Resource formatting is incorrect - `CPS-783 `_ Remove cm handle does not completely remove all cm handle information - `CPS-841 `_ Upgrade log4j to 2.17.1 as recommended by ONAP SECCOM + - `CPS-867 `_ Database port made configurable through env variable DB_PORT Known Limitations, Issues and Workarounds -----------------------------------------