Set CPS Project Status to 'Mature'
[cps.git] / cps-rest / docs / openapi / components.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2021-2022 Bell Canada.
3 # Modifications Copyright (C) 2021-2023 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
68     ModuleReferences:
69       type: object
70       title: Module reference object
71       properties:
72         name:
73           type: string
74           example: my-module-reference-name
75         namespace:
76           type: string
77           example: my-module-reference-namespace
78         revision:
79           type: string
80           example: my-module-reference-revision
81
82     SchemaSetDetails:
83       type: object
84       title: Schema set details by dataspace and schemasetName
85       required:
86         - "moduleReferences"
87       properties:
88         dataspaceName:
89           type: string
90           example: my-dataspace
91         moduleReferences:
92           type: array
93           items:
94             $ref: '#/components/schemas/ModuleReferences'
95         name:
96           type: string
97           example: my-schema-set
98
99   examples:
100     dataSample:
101       value:
102         test:bookstore:
103           bookstore-name: Chapters
104           categories:
105             - code: 01
106               name: SciFi
107             - code: 02
108               name: kids
109     dataSampleXml:
110         value:
111           <stores xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
112             <bookstore xmlns="org:onap:ccsdk:sample">
113               <bookstore-name>Chapters</bookstore-name>
114               <categories>
115                 <code>1</code>
116                 <name>SciFi</name>
117               </categories>
118             </bookstore>
119           </stores>
120     dataSampleAcrossAnchors:
121       value:
122         - anchorName: bookstore1
123           dataNode:
124             test:bookstore:
125               bookstore-name: Chapters
126               categories:
127                 - code: 01
128                   name: SciFi
129                 - code: 02
130                   name: kids
131         - anchorName: bookstore2
132           dataNode:
133             test:bookstore:
134               bookstore-name: Chapters
135               categories:
136                 - code: 01
137                   name: SciFi
138                 - code: 02
139                   name: kids
140     deltaReportSample:
141       value:
142         - action: "ADD"
143           xpath: "/bookstore/categories/[@code=3]"
144           target-data:
145             code: 3,
146             name: "kidz"
147         - action: "REMOVE"
148           xpath: "/bookstore/categories/[@code=1]"
149           source-data:
150             code: 1,
151             name: "Fiction"
152         - action: "UPDATE"
153           xpath: "/bookstore/categories/[@code=2]"
154           source-data:
155             name: "Funny"
156           target-data:
157             name: "Comic"
158
159   parameters:
160     dataspaceNameInQuery:
161       name: dataspace-name
162       in: query
163       description: dataspace-name
164       required: true
165       schema:
166         type: string
167         example: my-dataspace
168     dataspaceNameInPath:
169       name: dataspace-name
170       in: path
171       description: dataspace-name
172       required: true
173       schema:
174         type: string
175         example: my-dataspace
176     anchorNameInPath:
177       name: anchor-name
178       in: path
179       description: anchor-name
180       required: true
181       schema:
182         type: string
183         example: my-anchor
184     schemaSetNameInQuery:
185       name: schema-set-name
186       in: query
187       description: schema-set-name
188       required: true
189       schema:
190         type: string
191         example: my-schema-set
192     schemaSetNameInPath:
193       name: schema-set-name
194       in: path
195       description: schema-set-name
196       required: true
197       schema:
198         type: string
199         example: my-schema-set
200     anchorNameInQuery:
201       name: anchor-name
202       in: query
203       description: anchor-name
204       required: true
205       schema:
206         type: string
207         example: my-anchor
208     targetAnchorNameInQuery:
209       name: target-anchor-name
210       in: query
211       description: target-anchor-name
212       required: true
213       schema:
214         type: string
215         example: my-anchor
216     xpathInQuery:
217       name: xpath
218       in: query
219       description: For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html
220       required: false
221       schema:
222         type: string
223         default: /
224       examples:
225         container xpath:
226           value: /shops/bookstore
227         list attributes xpath:
228           value: /shops/bookstore/categories[@code=1]
229     requiredXpathInQuery:
230       name: xpath
231       in: query
232       description: For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html
233       required: true
234       schema:
235         type: string
236       examples:
237         container xpath:
238           value: /shops/bookstore
239         list attributes xpath:
240           value: /shops/bookstore/categories[@code=1]
241     cpsPathInQuery:
242       name: cps-path
243       in: query
244       description: For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html
245       required: false
246       schema:
247         type: string
248         default: /
249       examples:
250         container cps path:
251           value: //bookstore
252         list attributes cps path:
253           value: //categories[@code=1]
254     includeDescendantsOptionInQuery:
255       name: include-descendants
256       in: query
257       description: include-descendants
258       required: false
259       schema:
260         type: boolean
261         default: false
262         example: false
263     observedTimestampInQuery:
264       name: observed-timestamp
265       in: query
266       description: observed-timestamp
267       required: false
268       schema:
269         type: string
270         example: '2021-03-21T00:10:34.030-0100'
271     apiVersionInPath:
272       name: apiVersion
273       in: path
274       description: apiVersion
275       required: true
276       schema:
277         type: string
278         enum: [v1, v2]
279         default: v2
280     contentTypeHeader:
281       name: Content-Type
282       in: header
283       description: Content type header
284       schema:
285         type: string
286         example: 'application/json'
287       required: true
288     descendantsInQuery:
289       name: descendants
290       in: query
291       description: Number of descendants to query. Allowed values are 'none', 'all', 'direct', 1 (for direct), -1 (for all), 0 (for none) and any positive number.
292       required: false
293       schema:
294         type: string
295         default: none
296         example: 3
297     pageIndexInQuery:
298       name: pageIndex
299       in: query
300       description: page index for pagination over anchors. It must be greater then zero if provided.
301       required: false
302       schema:
303         type: integer
304         example: 1
305     pageSizeInQuery:
306       name: pageSize
307       in: query
308       description: number of records (anchors) per page. It must be greater then zero if provided.
309       required: false
310       schema:
311         type: integer
312         example: 10
313
314   responses:
315     NotFound:
316       description: The specified resource was not found
317       content:
318         application/json:
319           schema:
320             $ref: '#/components/schemas/ErrorMessage'
321           example:
322             status: 404
323             message: Resource Not Found
324             details: The requested resource is not found
325     Unauthorized:
326       description: Unauthorized
327       content:
328         application/json:
329           schema:
330             $ref: '#/components/schemas/ErrorMessage'
331           example:
332             status: 401
333             message: Unauthorized request
334             details: This request is unauthorized
335     Forbidden:
336       description: Forbidden
337       content:
338         application/json:
339           schema:
340             $ref: '#/components/schemas/ErrorMessage'
341           example:
342             status: 403
343             message: Request Forbidden
344             details: This request is forbidden
345     BadRequest:
346       description: Bad Request
347       content:
348         application/json:
349           schema:
350             $ref: '#/components/schemas/ErrorMessage'
351           example:
352             status: 400
353             message: Bad Request
354             details: The provided request is not valid
355     Conflict:
356       description: Conflict
357       content:
358         application/json:
359           schema:
360             $ref: '#/components/schemas/ErrorMessage'
361           example:
362             status: 409
363             message: Conflicting request
364             details: The request cannot be processed as the resource is in use.
365     Ok:
366       description: OK
367       content:
368         application/json:
369           schema:
370             type: object
371           examples:
372             dataSample:
373               value: ""
374     Created:
375       description: Created
376       content:
377         text/plain:
378           schema:
379             type: string
380             example: my-resource
381     CreatedV2:
382       description: Created without response body
383     InternalServerError:
384       description: Internal Server Error
385       content:
386         application/json:
387           schema:
388             $ref: "#/components/schemas/ErrorMessage"
389           example:
390             status: 500
391             message: Internal Server Error
392             details: Internal Server Error occurred
393     NoContent:
394       description: No Content
395       content: {}