Fixing Merge Issue
[cps.git] / cps-rest / docs / api / swagger / openapi.yml
1 openapi: 3.0.1
2 info:
3   title: CPS API
4   description: Configuration Persistence Service API
5   version: "1.0"
6 servers:
7   - url: //localhost:8088/
8 tags:
9   - name: cps-rest
10     description: cps Resource
11 paths:
12   /v1/dataspaces/{dataspace-name}/:
13     delete:
14       tags:
15         - cps-rest
16       summary: Delete the given dataspace
17       operationId: deleteDataspace
18       parameters:
19         - name: dataspace-name
20           in: path
21           description: dataspace-name
22           required: true
23           schema:
24             type: string
25       responses:
26         200:
27           description: OK
28           content:
29             application/json:
30               schema:
31                 type: object
32         204:
33           description: No Content
34           content: {}
35         401:
36           description: Unauthorized
37           content: {}
38         403:
39           description: Forbidden
40           content: {}
41   /v1/dataspaces/{dataspace-name}/anchors:
42     get:
43       tags:
44         - cps-rest
45       summary: Read all anchors, given a dataspace
46       operationId: getAnchors
47       parameters:
48         - name: dataspace-name
49           in: path
50           description: dataspace-name
51           required: true
52           schema:
53             type: string
54       responses:
55         200:
56           description: OK
57           content:
58             application/json:
59               schema:
60                 type: object
61         401:
62           description: Unauthorized
63           content: {}
64         403:
65           description: Forbidden
66           content: {}
67         404:
68           description: Not Found
69           content: {}
70     post:
71       tags:
72         - cps-rest
73       summary: Create a new anchor in the given dataspace
74       operationId: createAnchor
75       parameters:
76         - name: dataspace-name
77           in: path
78           description: dataspace-name
79           required: true
80           schema:
81             type: string
82       requestBody:
83         content:
84           application/json:
85             schema:
86               title: Anchor
87               description: anchor
88               $ref: '#/components/schemas/Anchor'
89         required: true
90       responses:
91         201:
92           description: Created
93           content:
94             application/json:
95               schema:
96                 type: string
97         401:
98           description: Unauthorized
99           content: {}
100         403:
101           description: Forbidden
102           content: {}
103         404:
104           description: Not Found
105           content: {}
106   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}:
107     get:
108       tags:
109         - cps-rest
110       summary: Read an anchor given a anchor and a dataspace
111       operationId: getAnchor
112       parameters:
113         - name: dataspace-name
114           in: path
115           description: dataspace-name
116           required: true
117           schema:
118             type: string
119         - name: anchor-name
120           in: path
121           description: anchor-name
122           required: true
123           schema:
124             type: string
125       responses:
126         200:
127           description: OK
128           content:
129             application/json:
130               schema:
131                 type: object
132         401:
133           description: Unauthorized
134           content: {}
135         403:
136           description: Forbidden
137           content: {}
138         404:
139           description: Not Found
140           content: {}
141     delete:
142       tags:
143         - cps-rest
144       summary: Delete an anchor given a anchor and a dataspace
145       operationId: deleteAnchor
146       parameters:
147         - name: dataspace-name
148           in: path
149           description: dataspace-name
150           required: true
151           schema:
152             type: string
153         - name: anchor-name
154           in: path
155           description: anchor-name
156           required: true
157           schema:
158             type: string
159       responses:
160         200:
161           description: OK
162           content:
163             application/json:
164               schema:
165                 type: object
166         204:
167           description: No Content
168           content: {}
169         401:
170           description: Unauthorized
171           content: {}
172         403:
173           description: Forbidden
174           content: {}
175   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
176     get:
177       tags:
178         - cps-rest
179       summary: Get a node given an anchor for the given dataspace
180       operationId: getNodeByDataspaceAndAnchor
181       parameters:
182         - name: dataspace-name
183           in: path
184           description: dataspace-name
185           required: true
186           schema:
187             type: string
188         - name: anchor-name
189           in: path
190           description: anchor-name
191           required: true
192           schema:
193             type: string
194       responses:
195         200:
196           description: OK
197           content:
198             application/json:
199               schema:
200                 type: object
201         401:
202           description: Unauthorized
203           content: {}
204         403:
205           description: Forbidden
206           content: {}
207         404:
208           description: Not Found
209           content: {}
210       x-codegen-request-body-name: xpath
211   /v1/dataspaces/{dataspace-name}/modules:
212     get:
213       tags:
214         - cps-rest
215       summary: Read all yang modules in the store
216       operationId: getModule
217       parameters:
218         - name: dataspace-name
219           in: path
220           description: dataspace-name
221           required: true
222           schema:
223             type: string
224         - name: namespace-name
225           in: query
226           description: namespace-name
227           schema:
228             type: string
229         - name: revision
230           in: query
231           description: revision
232           schema:
233             type: string
234       responses:
235         200:
236           description: OK
237           content:
238             application/json:
239               schema:
240                 type: object
241         401:
242           description: Unauthorized
243           content: {}
244         403:
245           description: Forbidden
246           content: {}
247         404:
248           description: Not Found
249           content: {}
250     post:
251       tags:
252         - cps-rest
253       summary: Create modules for the given dataspace
254       operationId: createModules
255       parameters:
256         - name: dataspace-name
257           in: path
258           description: dataspace-name
259           required: true
260           schema:
261             type: string
262       requestBody:
263         content:
264           multipart/form-data:
265             schema:
266               required:
267                 - file
268               properties:
269                 multipartFile:
270                   type: string
271                   description: multipartFile
272                   format: binary
273         required: true
274       responses:
275         200:
276           description: OK
277           content:
278             application/json:
279               schema:
280                 type: object
281         201:
282           description: Created
283           content: {}
284         401:
285           description: Unauthorized
286           content: {}
287         403:
288           description: Forbidden
289           content: {}
290         404:
291           description: Not Found
292           content: {}
293   /v1/dataspaces/{dataspace-name}/nodes:
294     get:
295       tags:
296         - cps-rest
297       summary: Get all nodes for a given dataspace using an xpath or schema node identifier
298       operationId: getNode
299       parameters:
300         - name: dataspace-name
301           in: path
302           description: dataspace-name
303           required: true
304           schema:
305             type: string
306       responses:
307         200:
308           description: OK
309           content:
310             application/json:
311               schema:
312                 type: object
313         401:
314           description: Unauthorized
315           content: {}
316         403:
317           description: Forbidden
318           content: {}
319         404:
320           description: Not Found
321           content: {}
322       x-codegen-request-body-name: requestBody
323     post:
324       tags:
325         - cps-rest
326       summary: Create a node for a given anchor for the given dataspace
327       operationId: createNode
328       parameters:
329         - name: dataspace-name
330           in: path
331           description: dataspace-name
332           required: true
333           schema:
334             type: string
335       requestBody:
336         content:
337           multipart/form-data:
338             schema:
339               required:
340                 - file
341               properties:
342                 multipartFile:
343                   type: string
344                   description: multipartFile
345                   format: binary
346         required: true
347       responses:
348         200:
349           description: OK
350           content:
351             application/json:
352               schema:
353                 type: object
354         201:
355           description: Created
356           content: {}
357         401:
358           description: Unauthorized
359           content: {}
360         403:
361           description: Forbidden
362           content: {}
363         404:
364           description: Not Found
365           content: {}
366 components:
367   schemas:
368     ErrorMessage:
369       type: object
370       title: Error
371       properties:
372         status:
373           type: string
374         message:
375           type: string
376         details:
377           type: string
378     Anchor:
379       type: object
380       title: Anchor
381       required:
382         - anchorName
383         - namespace
384         - revision
385       properties:
386         anchorName:
387           type: string
388         namespace:
389           type: string
390         revision:
391           type: string