diff options
Diffstat (limited to 'cps-rest/docs')
-rw-r--r-- | cps-rest/docs/openapi/components.yml | 37 | ||||
-rw-r--r-- | cps-rest/docs/openapi/cpsData.yml | 39 | ||||
-rw-r--r-- | cps-rest/docs/openapi/cpsDataV2.yml | 66 | ||||
-rw-r--r-- | cps-rest/docs/openapi/openapi.yml | 14 |
4 files changed, 129 insertions, 27 deletions
diff --git a/cps-rest/docs/openapi/components.yml b/cps-rest/docs/openapi/components.yml index c1b111bfab..728295fd31 100644 --- a/cps-rest/docs/openapi/components.yml +++ b/cps-rest/docs/openapi/components.yml @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # Copyright (c) 2021-2022 Bell Canada. # Modifications Copyright (C) 2021-2023 Nordix Foundation -# Modifications Copyright (C) 2022-2023 TechMahindra Ltd. +# Modifications Copyright (C) 2022-2024 TechMahindra Ltd. # Modifications Copyright (C) 2022 Deutsche Telekom AG # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -114,6 +114,8 @@ components: <categories> <code>1</code> <name>SciFi</name> + <code>2</code> + <name>kids</name> </categories> </bookstore> </stores> @@ -139,17 +141,17 @@ components: name: kids deltaReportSample: value: - - action: "ADD" + - action: "create" xpath: "/bookstore/categories/[@code=3]" target-data: code: 3, name: "kidz" - - action: "REMOVE" + - action: "remove" xpath: "/bookstore/categories/[@code=1]" source-data: code: 1, name: "Fiction" - - action: "UPDATE" + - action: "replace" xpath: "/bookstore/categories/[@code=2]" source-data: name: "Funny" @@ -181,6 +183,14 @@ components: schema: type: string example: my-anchor + sourceAnchorNameInPath: + name: source-anchor-name + in: path + description: source-anchor-name + required: true + schema: + type: string + example: my-anchor schemaSetNameInQuery: name: schema-set-name in: query @@ -277,13 +287,15 @@ components: type: string enum: [v1, v2] default: v2 - contentTypeHeader: + contentTypeInHeader: name: Content-Type in: header - description: Content type header + description: Content type in header schema: type: string - example: 'application/json' + enum: + - application/json + - application/xml required: true descendantsInQuery: name: descendants @@ -310,6 +322,15 @@ components: schema: type: integer example: 10 + dryRunInQuery: + name: dry-run + in: query + description: Boolean flag to validate data, without persisting it. Default value is set to false. + required: false + schema: + type: boolean + default: false + example: false responses: NotFound: @@ -374,7 +395,7 @@ components: Created: description: Created content: - text/plain: + application/json: schema: type: string example: my-resource diff --git a/cps-rest/docs/openapi/cpsData.yml b/cps-rest/docs/openapi/cpsData.yml index b9d2e5940e..daf59bbfbf 100644 --- a/cps-rest/docs/openapi/cpsData.yml +++ b/cps-rest/docs/openapi/cpsData.yml @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # Copyright (c) 2021-2022 Bell Canada. # Modifications Copyright (C) 2021-2022 Nordix Foundation -# Modifications Copyright (C) 2022-2023 TechMahindra Ltd. +# Modifications Copyright (C) 2022-2024 TechMahindra Ltd. # Modifications Copyright (C) 2022 Deutsche Telekom AG # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,15 +32,24 @@ listElementByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/anchorNameInPath' - $ref: 'components.yml#/components/parameters/requiredXpathInQuery' - $ref: 'components.yml#/components/parameters/observedTimestampInQuery' + - $ref: 'components.yml#/components/parameters/contentTypeInHeader' requestBody: required: true content: application/json: schema: - type: object + type: string examples: dataSample: $ref: 'components.yml#/components/examples/dataSample' + application/xml: + schema: + type: object + xml: + name: stores + examples: + dataSample: + $ref: 'components.yml#/components/examples/dataSampleXml' responses: '201': $ref: 'components.yml#/components/responses/Created' @@ -93,8 +102,9 @@ nodesByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/dataspaceNameInPath' - $ref: 'components.yml#/components/parameters/anchorNameInPath' - $ref: 'components.yml#/components/parameters/xpathInQuery' + - $ref: 'components.yml#/components/parameters/dryRunInQuery' - $ref: 'components.yml#/components/parameters/observedTimestampInQuery' - - $ref: 'components.yml#/components/parameters/contentTypeHeader' + - $ref: 'components.yml#/components/parameters/contentTypeInHeader' requestBody: required: true content: @@ -112,7 +122,6 @@ nodesByDataspaceAndAnchor: examples: dataSample: $ref: 'components.yml#/components/examples/dataSampleXml' - responses: '201': $ref: 'components.yml#/components/responses/Created' @@ -137,15 +146,24 @@ nodesByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/anchorNameInPath' - $ref: 'components.yml#/components/parameters/xpathInQuery' - $ref: 'components.yml#/components/parameters/observedTimestampInQuery' + - $ref: 'components.yml#/components/parameters/contentTypeInHeader' requestBody: required: true content: application/json: schema: - type: object + type: string examples: dataSample: $ref: 'components.yml#/components/examples/dataSample' + application/xml: + schema: + type: object + xml: + name: stores + examples: + dataSample: + $ref: 'components.yml#/components/examples/dataSampleXml' responses: '200': $ref: 'components.yml#/components/responses/Ok' @@ -188,15 +206,24 @@ nodesByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/anchorNameInPath' - $ref: 'components.yml#/components/parameters/xpathInQuery' - $ref: 'components.yml#/components/parameters/observedTimestampInQuery' + - $ref: 'components.yml#/components/parameters/contentTypeInHeader' requestBody: required: true content: application/json: schema: - type: object + type: string examples: dataSample: $ref: 'components.yml#/components/examples/dataSample' + application/xml: + schema: + type: object + xml: + name: stores + examples: + dataSample: + $ref: 'components.yml#/components/examples/dataSampleXml' responses: '200': $ref: 'components.yml#/components/responses/Ok' diff --git a/cps-rest/docs/openapi/cpsDataV2.yml b/cps-rest/docs/openapi/cpsDataV2.yml index cbb5ce4104..999c5b2c19 100644 --- a/cps-rest/docs/openapi/cpsDataV2.yml +++ b/cps-rest/docs/openapi/cpsDataV2.yml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2022-2023 TechMahindra Ltd. +# Copyright (c) 2022-2024 TechMahindra Ltd. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ nodeByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/anchorNameInPath' - $ref: 'components.yml#/components/parameters/xpathInQuery' - $ref: 'components.yml#/components/parameters/descendantsInQuery' + - $ref: 'components.yml#/components/parameters/contentTypeInHeader' responses: '200': description: OK @@ -38,6 +39,14 @@ nodeByDataspaceAndAnchor: examples: dataSample: $ref: 'components.yml#/components/examples/dataSample' + application/xml: + schema: + type: object + xml: + name: stores + examples: + dataSample: + $ref: 'components.yml#/components/examples/dataSampleXml' '400': $ref: 'components.yml#/components/responses/BadRequest' '403': @@ -46,7 +55,7 @@ nodeByDataspaceAndAnchor: $ref: 'components.yml#/components/responses/InternalServerError' x-codegen-request-body-name: xpath -deltaByDataspaceAndAnchors: +delta: get: description: Get delta between two anchors within a given dataspace tags: @@ -55,7 +64,7 @@ deltaByDataspaceAndAnchors: operationId: getDeltaByDataspaceAndAnchors parameters: - $ref: 'components.yml#/components/parameters/dataspaceNameInPath' - - $ref: 'components.yml#/components/parameters/anchorNameInPath' + - $ref: 'components.yml#/components/parameters/sourceAnchorNameInPath' - $ref: 'components.yml#/components/parameters/targetAnchorNameInQuery' - $ref: 'components.yml#/components/parameters/xpathInQuery' - $ref: 'components.yml#/components/parameters/descendantsInQuery' @@ -75,4 +84,53 @@ deltaByDataspaceAndAnchors: $ref: 'components.yml#/components/responses/Forbidden' '500': $ref: 'components.yml#/components/responses/InternalServerError' - x-codegen-request-body-name: xpath
\ No newline at end of file + x-codegen-request-body-name: xpath + post: + description: Get delta between an anchor in a dataspace and JSON payload + tags: + - cps-data + summary: Get delta between an anchor and JSON payload + operationId: getDeltaByDataspaceAnchorAndPayload + parameters: + - $ref: 'components.yml#/components/parameters/dataspaceNameInPath' + - $ref: 'components.yml#/components/parameters/sourceAnchorNameInPath' + - $ref: 'components.yml#/components/parameters/xpathInQuery' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + json: + type: object + example: + test:bookstore: + bookstore-name: Chapters + categories: + - code: 01 + name: SciFi + - code: 02 + name: kids + file: + type: string + format: binary + required: + - json + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + examples: + dataSample: + $ref: 'components.yml#/components/examples/deltaReportSample' + '400': + $ref: 'components.yml#/components/responses/BadRequest' + '401': + $ref: 'components.yml#/components/responses/Unauthorized' + '403': + $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/openapi.yml b/cps-rest/docs/openapi/openapi.yml index f29335a0a9..95c32312cf 100644 --- a/cps-rest/docs/openapi/openapi.yml +++ b/cps-rest/docs/openapi/openapi.yml @@ -1,8 +1,8 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2021-2023 Nordix Foundation +# Copyright (C) 2021-2024 Nordix Foundation # Modifications Copyright (C) 2021 Pantheon.tech # Modifications Copyright (C) 2021 Bell Canada. -# Modifications Copyright (C) 2022-2023 TechMahindra Ltd. +# Modifications Copyright (C) 2022-2024 TechMahindra Ltd. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ openapi: 3.0.3 info: title: ONAP Open API v3 Configuration Persistence Service description: Configuration Persistence Service is a Model Driven Generic Database - version: "1.0.0" + version: "3.5.4" contact: name: ONAP url: "https://onap.readthedocs.io" @@ -31,10 +31,6 @@ info: license: name: "Apache 2.0" url: "http://www.apache.org/licenses/LICENSE-2.0" - x-planned-retirement-date: "202212" - x-component: "Modeling" - x-logo: - url: "cps_logo.png" servers: - url: /cps/api @@ -104,8 +100,8 @@ paths: /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes: $ref: 'cpsData.yml#/listElementByDataspaceAndAnchor' - /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/delta: - $ref: 'cpsDataV2.yml#/deltaByDataspaceAndAnchors' + /v2/dataspaces/{dataspace-name}/anchors/{source-anchor-name}/delta: + $ref: 'cpsDataV2.yml#/delta' /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query: $ref: 'cpsQueryV1Deprecated.yml#/nodesByDataspaceAndAnchorAndCpsPath' |