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