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