Create dataspace
[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:
71     post:
72       tags:
73         - cps-admin
74       summary: Create a new schema set in the given dataspace
75       operationId: createSchemaSet
76       parameters:
77         - name: dataspace-name
78           in: path
79           description: dataspace-name
80           required: true
81           schema:
82             type: string
83       requestBody:
84         required: true
85         content:
86           multipart/form-data:
87             schema:
88               required:
89                 - schemaSetName
90                 - multipartFile
91               properties:
92                 schemaSetName:
93                   type: string
94                 multipartFile:
95                   type: string
96                   description: multipartFile
97                   format: binary
98       responses:
99         201:
100           description: Created
101           content:
102             application/json:
103               schema:
104                 type: string
105         401:
106           description: Unauthorized
107           content: { }
108         403:
109           description: Forbidden
110           content: { }
111   /v1/dataspaces/{dataspace-name}/anchors:
112     get:
113       tags:
114         - cps-admin
115       summary: Read all anchors, given a dataspace
116       operationId: getAnchors
117       parameters:
118         - name: dataspace-name
119           in: path
120           description: dataspace-name
121           required: true
122           schema:
123             type: string
124       responses:
125         200:
126           description: OK
127           content:
128             application/json:
129               schema:
130                 type: object
131         401:
132           description: Unauthorized
133           content: {}
134         400:
135           description: Bad Request
136           content: {}
137         403:
138           description: Forbidden
139         404:
140           description: Not Found
141           content: {}
142         204:
143           description: No Content
144           content: {}
145     post:
146       tags:
147         - cps-admin
148       summary: Create a new anchor in the given dataspace
149       operationId: createAnchor
150       parameters:
151         - name: dataspace-name
152           in: path
153           description: dataspace-name
154           required: true
155           schema:
156             type: string
157         - name: schema-set-name
158           in: query
159           description: schema-set-name
160           required: true
161           schema:
162             type: string
163         - name: anchor-name
164           in: query
165           description: anchor-name
166           required: true
167           schema:
168             type: string
169       responses:
170         201:
171           description: Created
172           content:
173             application/json:
174               schema:
175                 type: string
176         401:
177           description: Unauthorized
178           content: {}
179         403:
180           description: Forbidden
181           content: {}
182         404:
183           description: Not Found
184           content: {}
185   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}:
186     get:
187       tags:
188         - cps-admin
189       summary: Read an anchor given a anchor and a dataspace
190       operationId: getAnchor
191       parameters:
192         - name: dataspace-name
193           in: path
194           description: dataspace-name
195           required: true
196           schema:
197             type: string
198         - name: anchor-name
199           in: path
200           description: anchor-name
201           required: true
202           schema:
203             type: string
204       responses:
205         200:
206           description: OK
207           content:
208             application/json:
209               schema:
210                 type: object
211         401:
212           description: Unauthorized
213           content: {}
214         403:
215           description: Forbidden
216           content: {}
217         404:
218           description: Not Found
219           content: {}
220     delete:
221       tags:
222         - cps-admin
223       summary: Delete an anchor given a anchor and a dataspace
224       operationId: deleteAnchor
225       parameters:
226         - name: dataspace-name
227           in: path
228           description: dataspace-name
229           required: true
230           schema:
231             type: string
232         - name: anchor-name
233           in: path
234           description: anchor-name
235           required: true
236           schema:
237             type: string
238       responses:
239         200:
240           description: OK
241           content:
242             application/json:
243               schema:
244                 type: object
245         204:
246           description: No Content
247           content: {}
248         401:
249           description: Unauthorized
250           content: {}
251         403:
252           description: Forbidden
253           content: {}
254   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
255     get:
256       tags:
257         - cps-data
258       summary: Get a node given an anchor for the given dataspace
259       operationId: getNodeByDataspaceAndAnchor
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         401:
281           description: Unauthorized
282           content: {}
283         403:
284           description: Forbidden
285           content: {}
286         404:
287           description: Not Found
288           content: {}
289       x-codegen-request-body-name: xpath
290   /v1/dataspaces/{dataspace-name}/nodes:
291     get:
292       tags:
293         - cps-data
294       summary: Get all nodes for a given dataspace using an xpath or schema node identifier
295       operationId: getNode
296       parameters:
297         - name: dataspace-name
298           in: path
299           description: dataspace-name
300           required: true
301           schema:
302             type: string
303       responses:
304         200:
305           description: OK
306           content:
307             application/json:
308               schema:
309                 type: object
310         401:
311           description: Unauthorized
312           content: {}
313         403:
314           description: Forbidden
315           content: {}
316         404:
317           description: Not Found
318           content: {}
319       x-codegen-request-body-name: requestBody
320     post:
321       tags:
322         - cps-data
323       summary: Create a node for a given anchor for the given dataspace
324       operationId: createNode
325       parameters:
326         - name: dataspace-name
327           in: path
328           description: dataspace-name
329           required: true
330           schema:
331             type: string
332       requestBody:
333         content:
334           multipart/form-data:
335             schema:
336               required:
337                 - file
338               properties:
339                 multipartFile:
340                   type: string
341                   description: multipartFile
342                   format: binary
343         required: true
344       responses:
345         200:
346           description: OK
347           content:
348             application/json:
349               schema:
350                 type: object
351         201:
352           description: Created
353           content: {}
354         401:
355           description: Unauthorized
356           content: {}
357         403:
358           description: Forbidden
359           content: {}
360         404:
361           description: Not Found
362           content: {}
363 components:
364   schemas:
365     ErrorMessage:
366       type: object
367       title: Error
368       properties:
369         status:
370           type: string
371         message:
372           type: string
373         details:
374           type: string