Remove Http Status 401 for cps core and NCMP(CPS-2126 #3)
[cps.git] / cps-rest / docs / openapi / cpsData.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2021-2022 Bell Canada.
3 # Modifications Copyright (C) 2021-2022 Nordix Foundation
4 # Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
5 # Modifications Copyright (C) 2022 Deutsche Telekom AG
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 # SPDX-License-Identifier: Apache-2.0
20 # ============LICENSE_END=========================================================
21
22 listElementByDataspaceAndAnchor:
23   post:
24     description: Add list element(s) to a list for a given anchor and dataspace
25     tags:
26       - cps-data
27     summary: Add list element(s)
28     operationId: addListElements
29     parameters:
30       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
31       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
32       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
33       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
34       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
35     requestBody:
36       required: true
37       content:
38         application/json:
39           schema:
40             type: object
41           examples:
42             dataSample:
43               $ref: 'components.yml#/components/examples/dataSample'
44     responses:
45       '201':
46         $ref: 'components.yml#/components/responses/Created'
47       '400':
48         $ref: 'components.yml#/components/responses/BadRequest'
49       '403':
50         $ref: 'components.yml#/components/responses/Forbidden'
51       '500':
52         $ref: 'components.yml#/components/responses/InternalServerError'
53   put:
54     description: Replace list content under a given parent, anchor and dataspace
55     tags:
56       - cps-data
57     summary: Replace list content
58     operationId: replaceListContent
59     parameters:
60       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
61       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
62       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
63       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
64       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
65     requestBody:
66       required: true
67       content:
68         application/json:
69           schema:
70             type: object
71           examples:
72             dataSample:
73               $ref: 'components.yml#/components/examples/dataSample'
74     responses:
75       '200':
76         $ref: 'components.yml#/components/responses/Ok'
77       '400':
78         $ref: 'components.yml#/components/responses/BadRequest'
79       '403':
80         $ref: 'components.yml#/components/responses/Forbidden'
81       '500':
82         $ref: 'components.yml#/components/responses/InternalServerError'
83
84 nodesByDataspaceAndAnchor:
85   post:
86     description: Create a node for a given anchor and dataspace
87     tags:
88       - cps-data
89     summary: Create a node
90     operationId: createNode
91     parameters:
92       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
93       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
94       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
95       - $ref: 'components.yml#/components/parameters/xpathInQuery'
96       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
97       - $ref: 'components.yml#/components/parameters/contentTypeHeader'
98     requestBody:
99       required: true
100       content:
101         application/json:
102           schema:
103             type: string
104           examples:
105             dataSample:
106               $ref: 'components.yml#/components/examples/dataSample'
107         application/xml:
108           schema:
109             type: object   # Workaround to show example
110             xml:
111               name: stores
112           examples:
113             dataSample:
114               $ref: 'components.yml#/components/examples/dataSampleXml'
115
116     responses:
117       '201':
118         $ref: 'components.yml#/components/responses/Created'
119       '400':
120         $ref: 'components.yml#/components/responses/BadRequest'
121       '403':
122         $ref: 'components.yml#/components/responses/Forbidden'
123       '409':
124         $ref: 'components.yml#/components/responses/Conflict'
125       '500':
126         $ref: 'components.yml#/components/responses/InternalServerError'
127   patch:
128     description: Update a data node leaves for a given dataspace and anchor and a parent node xpath. This operation
129                   is currently supported for one top level data node only.
130     tags:
131       - cps-data
132     summary: Update node leaves
133     operationId: updateNodeLeaves
134     parameters:
135       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
136       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
137       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
138       - $ref: 'components.yml#/components/parameters/xpathInQuery'
139       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
140     requestBody:
141       required: true
142       content:
143         application/json:
144           schema:
145             type: object
146           examples:
147             dataSample:
148               $ref: 'components.yml#/components/examples/dataSample'
149     responses:
150       '200':
151         $ref: 'components.yml#/components/responses/Ok'
152       '400':
153         $ref: 'components.yml#/components/responses/BadRequest'
154       '403':
155         $ref: 'components.yml#/components/responses/Forbidden'
156       '500':
157         $ref: 'components.yml#/components/responses/InternalServerError'
158   delete:
159     description: Delete a datanode for a given dataspace and anchor given a node xpath.
160     tags:
161       - cps-data
162     summary: Delete a data node
163     operationId: deleteDataNode
164     parameters:
165       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
166       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
167       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
168       - $ref: 'components.yml#/components/parameters/xpathInQuery'
169       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
170     responses:
171       '204':
172         $ref: 'components.yml#/components/responses/NoContent'
173       '400':
174         $ref: 'components.yml#/components/responses/BadRequest'
175       '403':
176         $ref: 'components.yml#/components/responses/Forbidden'
177       '500':
178         $ref: 'components.yml#/components/responses/InternalServerError'
179   put:
180     description: Replace a node with descendants for a given dataspace, anchor and a parent node xpath
181     tags:
182       - cps-data
183     summary: Replace a node with descendants
184     operationId: replaceNode
185     parameters:
186       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
187       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
188       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
189       - $ref: 'components.yml#/components/parameters/xpathInQuery'
190       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
191     requestBody:
192       required: true
193       content:
194         application/json:
195           schema:
196             type: object
197           examples:
198             dataSample:
199               $ref: 'components.yml#/components/examples/dataSample'
200     responses:
201       '200':
202         $ref: 'components.yml#/components/responses/Ok'
203       '400':
204         $ref: 'components.yml#/components/responses/BadRequest'
205       '403':
206         $ref: 'components.yml#/components/responses/Forbidden'
207       '500':
208         $ref: 'components.yml#/components/responses/InternalServerError'