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