Added depth parameter in query nodes API.
[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       '401':
50         $ref: 'components.yml#/components/responses/Unauthorized'
51       '403':
52         $ref: 'components.yml#/components/responses/Forbidden'
53       '500':
54         $ref: 'components.yml#/components/responses/InternalServerError'
55   put:
56     description: Replace list content under a given parent, anchor and dataspace
57     tags:
58       - cps-data
59     summary: Replace list content
60     operationId: replaceListContent
61     parameters:
62       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
63       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
64       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
65       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
66       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
67     requestBody:
68       required: true
69       content:
70         application/json:
71           schema:
72             type: object
73           examples:
74             dataSample:
75               $ref: 'components.yml#/components/examples/dataSample'
76     responses:
77       '200':
78         $ref: 'components.yml#/components/responses/Ok'
79       '400':
80         $ref: 'components.yml#/components/responses/BadRequest'
81       '401':
82         $ref: 'components.yml#/components/responses/Unauthorized'
83       '403':
84         $ref: 'components.yml#/components/responses/Forbidden'
85       '500':
86         $ref: 'components.yml#/components/responses/InternalServerError'
87
88 nodesByDataspaceAndAnchor:
89   post:
90     description: Create a node for a given anchor and dataspace
91     tags:
92       - cps-data
93     summary: Create a node
94     operationId: createNode
95     parameters:
96       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
97       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
98       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
99       - $ref: 'components.yml#/components/parameters/xpathInQuery'
100       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
101       - $ref: 'components.yml#/components/parameters/contentTypeHeader'
102     requestBody:
103       required: true
104       content:
105         application/json:
106           schema:
107             type: string
108           examples:
109             dataSample:
110               $ref: 'components.yml#/components/examples/dataSample'
111         application/xml:
112           schema:
113             type: object   # Workaround to show example
114             xml:
115               name: stores
116           examples:
117             dataSample:
118               $ref: 'components.yml#/components/examples/dataSampleXml'
119
120     responses:
121       '201':
122         $ref: 'components.yml#/components/responses/Created'
123       '400':
124         $ref: 'components.yml#/components/responses/BadRequest'
125       '401':
126         $ref: 'components.yml#/components/responses/Unauthorized'
127       '403':
128         $ref: 'components.yml#/components/responses/Forbidden'
129       '409':
130         $ref: 'components.yml#/components/responses/Conflict'
131       '500':
132         $ref: 'components.yml#/components/responses/InternalServerError'
133   patch:
134     description: Update a data node leaves for a given dataspace and anchor and a parent node xpath
135     tags:
136       - cps-data
137     summary: Update node leaves
138     operationId: updateNodeLeaves
139     parameters:
140       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
141       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
142       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
143       - $ref: 'components.yml#/components/parameters/xpathInQuery'
144       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
145     requestBody:
146       required: true
147       content:
148         application/json:
149           schema:
150             type: object
151           examples:
152             dataSample:
153               $ref: 'components.yml#/components/examples/dataSample'
154     responses:
155       '200':
156         $ref: 'components.yml#/components/responses/Ok'
157       '400':
158         $ref: 'components.yml#/components/responses/BadRequest'
159       '401':
160         $ref: 'components.yml#/components/responses/Unauthorized'
161       '403':
162         $ref: 'components.yml#/components/responses/Forbidden'
163       '500':
164         $ref: 'components.yml#/components/responses/InternalServerError'
165   delete:
166     description: Delete a datanode for a given dataspace and anchor given a node xpath.
167     tags:
168       - cps-data
169     summary: Delete a data node
170     operationId: deleteDataNode
171     parameters:
172       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
173       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
174       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
175       - $ref: 'components.yml#/components/parameters/xpathInQuery'
176       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
177     responses:
178       '204':
179         $ref: 'components.yml#/components/responses/NoContent'
180       '400':
181         $ref: 'components.yml#/components/responses/BadRequest'
182       '401':
183         $ref: 'components.yml#/components/responses/Unauthorized'
184       '403':
185         $ref: 'components.yml#/components/responses/Forbidden'
186       '500':
187         $ref: 'components.yml#/components/responses/InternalServerError'
188   put:
189     description: Replace a node with descendants for a given dataspace, anchor and a parent node xpath
190     tags:
191       - cps-data
192     summary: Replace a node with descendants
193     operationId: replaceNode
194     parameters:
195       - $ref: 'components.yml#/components/parameters/apiVersionInPath'
196       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
197       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
198       - $ref: 'components.yml#/components/parameters/xpathInQuery'
199       - $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
200     requestBody:
201       required: true
202       content:
203         application/json:
204           schema:
205             type: object
206           examples:
207             dataSample:
208               $ref: 'components.yml#/components/examples/dataSample'
209     responses:
210       '200':
211         $ref: 'components.yml#/components/responses/Ok'
212       '400':
213         $ref: 'components.yml#/components/responses/BadRequest'
214       '401':
215         $ref: 'components.yml#/components/responses/Unauthorized'
216       '403':
217         $ref: 'components.yml#/components/responses/Forbidden'
218       '500':
219         $ref: 'components.yml#/components/responses/InternalServerError'