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