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