diff options
author | JosephKeenan <joseph.keenan@est.tech> | 2022-01-14 12:37:45 +0000 |
---|---|---|
committer | JosephKeenan <joseph.keenan@est.tech> | 2022-01-27 13:16:43 +0000 |
commit | 9ae554ff421bdcee332b32d9d83a8213d4e20d3d (patch) | |
tree | 229499283eefdb033d6ac814881977355d509746 | |
parent | db1e983f40be1db7bca5acacf5a3369d74a29c95 (diff) |
[TECHDEBT] Align CPS Core REST API Specification and Implementationmr/822/126608/10
Issue-ID: CPS-822
Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
Change-Id: I3179194fb6d7d7416d4f7e75ef51f05b6de89c10
-rw-r--r-- | cps-rest/docs/openapi/components.yml | 11 | ||||
-rw-r--r-- | cps-rest/docs/openapi/cpsAdmin.yml | 37 | ||||
-rw-r--r-- | cps-rest/docs/openapi/cpsData.yml | 25 | ||||
-rw-r--r-- | cps-rest/docs/openapi/cpsQuery.yml | 6 |
4 files changed, 57 insertions, 22 deletions
diff --git a/cps-rest/docs/openapi/components.yml b/cps-rest/docs/openapi/components.yml index ff2816af6d..694c2207af 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 occured NoContent: description: No Content content: {} diff --git a/cps-rest/docs/openapi/cpsAdmin.yml b/cps-rest/docs/openapi/cpsAdmin.yml index 869cb6e724..df0b0a7f9c 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,8 +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 @@ -128,6 +135,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,8 +162,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 @@ -175,6 +184,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,8 +212,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 @@ -219,4 +232,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..61956f7882 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 @@ -161,7 +164,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 +197,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 +219,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 +250,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..3049afbdf0 100644 --- a/cps-rest/docs/openapi/cpsQuery.yml +++ b/cps-rest/docs/openapi/cpsQuery.yml @@ -1,5 +1,5 @@ # ============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 +44,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 |