Added depth parameter in query nodes API.
[cps.git] / cps-rest / docs / openapi / components.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 components:
23   schemas:
24
25     AnchorDetails:
26       type: object
27       title: Anchor details by anchor Name
28       properties:
29         name:
30           type: string
31           example: my-anchor
32         dataspaceName:
33           type: string
34           example: my-dataspace
35         schemaSetName:
36           type: string
37           example: my-schema-set
38
39     DataspaceDetails:
40       type: object
41       title: Dataspace details by dataspace Name
42       properties:
43         name:
44           type: string
45           example: my-dataspace
46
47     ErrorMessage:
48       type: object
49       title: Error
50       properties:
51         status:
52           type: string
53         message:
54           type: string
55         details:
56           type: string
57
58     MultipartFile:
59       type: object
60       required:
61         - file
62       properties:
63         file:
64           type: string
65           description: multipartFile
66           format: binary
67           example:  'https://github.com/onap/cps/blob/master/cps-service/src/test/resources/bookstore.yang'
68
69     ModuleReferences:
70       type: object
71       title: Module reference object
72       properties:
73         name:
74           type: string
75           example: my-module-reference-name
76         namespace:
77           type: string
78           example: my-module-reference-namespace
79         revision:
80           type: string
81           example: my-module-reference-revision
82
83     SchemaSetDetails:
84       type: object
85       title: Schema set details by dataspace and schemasetName
86       required:
87         - "moduleReferences"
88       properties:
89         dataspaceName:
90           type: string
91           example: my-dataspace
92         moduleReferences:
93           type: array
94           items:
95             $ref: '#/components/schemas/ModuleReferences'
96         name:
97           type: string
98           example: my-schema-set
99
100   examples:
101     dataSample:
102       value:
103         test:bookstore:
104           bookstore-name: Chapters
105           categories:
106             - code: 01
107               name: SciFi
108             - code: 02
109               name: kids
110     dataSampleXml:
111         value:
112           <stores xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
113             <bookstore xmlns="org:onap:ccsdk:sample">
114               <bookstore-name>Chapters</bookstore-name>
115               <categories>
116                 <code>1</code>
117                 <name>SciFi</name>
118               </categories>
119             </bookstore>
120           </stores>
121
122   parameters:
123     dataspaceNameInQuery:
124       name: dataspace-name
125       in: query
126       description: dataspace-name
127       required: true
128       schema:
129         type: string
130         example: my-dataspace
131     dataspaceNameInPath:
132       name: dataspace-name
133       in: path
134       description: dataspace-name
135       required: true
136       schema:
137         type: string
138         example: my-dataspace
139     anchorNameInPath:
140       name: anchor-name
141       in: path
142       description: anchor-name
143       required: true
144       schema:
145         type: string
146         example: my-anchor
147     schemaSetNameInQuery:
148       name: schema-set-name
149       in: query
150       description: schema-set-name
151       required: true
152       schema:
153         type: string
154         example: my-schema-set
155     schemaSetNameInPath:
156       name: schema-set-name
157       in: path
158       description: schema-set-name
159       required: true
160       schema:
161         type: string
162         example: my-schema-set
163     anchorNameInQuery:
164       name: anchor-name
165       in: query
166       description: anchor-name
167       required: true
168       schema:
169         type: string
170         example: my-anchor
171     xpathInQuery:
172       name: xpath
173       in: query
174       description: For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
175       required: false
176       schema:
177         type: string
178         default: /
179       examples:
180         container xpath:
181           value: /shops/bookstore
182         list attributes xpath:
183           value: /shops/bookstore/categories[@code=1]
184     requiredXpathInQuery:
185       name: xpath
186       in: query
187       description: For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
188       required: true
189       schema:
190         type: string
191       examples:
192         container xpath:
193           value: /shops/bookstore
194         list attributes xpath:
195           value: /shops/bookstore/categories[@code=1]
196     cpsPathInQuery:
197       name: cps-path
198       in: query
199       description: For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
200       required: false
201       schema:
202         type: string
203         default: /
204       examples:
205         container cps path:
206           value: //bookstore
207         list attributes cps path:
208           value: //categories[@code=1]
209     includeDescendantsOptionInQuery:
210       name: include-descendants
211       in: query
212       description: include-descendants
213       required: false
214       schema:
215         type: boolean
216         default: false
217         example: false
218     observedTimestampInQuery:
219       name: observed-timestamp
220       in: query
221       description: observed-timestamp
222       required: false
223       schema:
224         type: string
225         example: '2021-03-21T00:10:34.030-0100'
226     apiVersionInPath:
227       name: apiVersion
228       in: path
229       description: apiVersion
230       required: true
231       schema:
232         type: string
233         enum: [v1, v2]
234         default: v2
235     contentTypeHeader:
236       name: Content-Type
237       in: header
238       description: Content type header
239       schema:
240         type: string
241         example: 'application/json'
242       required: true
243     descendantsInQuery:
244       name: descendants
245       in: query
246       description: descendents to query depth of children. allowed values are none, all, any number starting from -1
247       required: false
248       schema:
249         type: string
250         default: none
251         example: 3
252
253   responses:
254     NotFound:
255       description: The specified resource was not found
256       content:
257         application/json:
258           schema:
259             $ref: '#/components/schemas/ErrorMessage'
260           example:
261             status: 404
262             message: Resource Not Found
263             details: The requested resource is not found
264     Unauthorized:
265       description: Unauthorized
266       content:
267         application/json:
268           schema:
269             $ref: '#/components/schemas/ErrorMessage'
270           example:
271             status: 401
272             message: Unauthorized request
273             details: This request is unauthorized
274     Forbidden:
275       description: Forbidden
276       content:
277         application/json:
278           schema:
279             $ref: '#/components/schemas/ErrorMessage'
280           example:
281             status: 403
282             message: Request Forbidden
283             details: This request is forbidden
284     BadRequest:
285       description: Bad Request
286       content:
287         application/json:
288           schema:
289             $ref: '#/components/schemas/ErrorMessage'
290           example:
291             status: 400
292             message: Bad Request
293             details: The provided request is not valid
294     Conflict:
295       description: Conflict
296       content:
297         application/json:
298           schema:
299             $ref: '#/components/schemas/ErrorMessage'
300           example:
301             status: 409
302             message: Conflicting request
303             details: The request cannot be processed as the resource is in use.
304     Ok:
305       description: OK
306       content:
307         application/json:
308           schema:
309             type: object
310           examples:
311             dataSample:
312               value: ""
313     Created:
314       description: Created
315       content:
316         text/plain:
317           schema:
318             type: string
319             example: my-resource
320     CreatedV2:
321       description: Created without response body
322     InternalServerError:
323       description: Internal Server Error
324       content:
325         application/json:
326           schema:
327             $ref: "#/components/schemas/ErrorMessage"
328           example:
329             status: 500
330             message: Internal Server Error
331             details: Internal Server Error occurred
332     NoContent:
333       description: No Content
334       content: {}