From ec674c778a0db04491c75f837cea92dd8ed4f2ff Mon Sep 17 00:00:00 2001 From: JosephKeenan Date: Thu, 20 Jan 2022 16:30:18 +0000 Subject: [TECHDEBT] Align CPS NCMP REST API Specification and Implementation - Updated ncmp.yml to align implementation with specification - Added new Exception classes to differentiate between server NCMP issues and client based NCMP issues - Added 500 error to specification - Added org.onap.cps.utils to list of packages in LayeredArchitectureTest as build was failing Issue-ID: CPS-823 Signed-off-by: JosephKeenan Change-Id: Ic646db5cc4dfc8d14106c8374b7c62cc9f9ab6e7 --- cps-ncmp-rest/docs/openapi/components.yaml | 12 +++++++++- cps-ncmp-rest/docs/openapi/ncmp-inventory.yml | 3 +++ cps-ncmp-rest/docs/openapi/ncmp.yml | 33 ++++++++++++++------------- 3 files changed, 31 insertions(+), 17 deletions(-) (limited to 'cps-ncmp-rest/docs') diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index e63f9c0b8..36338d8d4 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2021 Nordix Foundation +# Copyright (C) 2021-2022 Nordix Foundation # Modifications Copyright (C) 2021 Pantheon.tech # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -374,6 +374,16 @@ components: application/json: schema: type: object + InternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorMessage" + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occured Created: description: Created content: {} diff --git a/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml b/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml index b0a50aa83..f3f84fed9 100755 --- a/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml +++ b/cps-ncmp-rest/docs/openapi/ncmp-inventory.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. @@ -38,3 +39,5 @@ updateDmiRegistration: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml index d80ec6508..c9d9b5778 100755 --- a/cps-ncmp-rest/docs/openapi/ncmp.yml +++ b/cps-ncmp-rest/docs/openapi/ncmp.yml @@ -17,6 +17,7 @@ # # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= + getResourceDataForPassthroughOperational: get: tags: @@ -45,8 +46,8 @@ getResourceDataForPassthroughOperational: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' - 404: - $ref: 'components.yaml#/components/responses/NotFound' + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' resourceDataForPassthroughRunning: get: @@ -76,8 +77,8 @@ resourceDataForPassthroughRunning: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' - 404: - $ref: 'components.yaml#/components/responses/NotFound' + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' post: tags: - network-cm-proxy @@ -112,9 +113,8 @@ resourceDataForPassthroughRunning: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' - 404: - $ref: 'components.yaml#/components/responses/NotFound' - + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' put: tags: - network-cm-proxy @@ -149,9 +149,8 @@ resourceDataForPassthroughRunning: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' - 404: - $ref: 'components.yaml#/components/responses/NotFound' - + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' patch: tags: - network-cm-proxy @@ -180,9 +179,8 @@ resourceDataForPassthroughRunning: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' - 404: - $ref: 'components.yaml#/components/responses/NotFound' - + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' delete: tags: - network-cm-proxy @@ -204,7 +202,8 @@ resourceDataForPassthroughRunning: $ref: 'components.yaml#/components/responses/Forbidden' 404: $ref: 'components.yaml#/components/responses/NotFound' - + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' fetchModuleReferencesByCmHandle: get: @@ -230,8 +229,8 @@ fetchModuleReferencesByCmHandle: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' - 404: - $ref: 'components.yaml#/components/responses/NotFound' + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' executeCmHandleSearch: post: @@ -259,3 +258,5 @@ executeCmHandleSearch: $ref: 'components.yaml#/components/responses/Unauthorized' 403: $ref: 'components.yaml#/components/responses/Forbidden' + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' -- cgit 1.2.3-korg