CPS-314: Delete Dataspace
[cps.git] / cps-rest / docs / openapi / cpsAdmin.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2021 Bell Canada.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
18
19 dataspaces:
20   post:
21     description: Create a new dataspace
22     tags:
23       - cps-admin
24     summary: Create a dataspace
25     operationId: createDataspace
26     parameters:
27       - $ref: 'components.yml#/components/parameters/dataspaceNameInQuery'
28     responses:
29       '201':
30         $ref: 'components.yml#/components/responses/Created'
31       '400':
32         $ref: 'components.yml#/components/responses/BadRequest'
33       '401':
34         $ref: 'components.yml#/components/responses/Unauthorized'
35       '403':
36         $ref: 'components.yml#/components/responses/Forbidden'
37
38   delete:
39     description: Delete a dataspace
40     tags:
41       - cps-admin
42     summary: Delete a dataspace
43     operationId: deleteDataspace
44     parameters:
45       - $ref: 'components.yml#/components/parameters/dataspaceNameInQuery'
46     responses:
47       '204':
48         $ref: 'components.yml#/components/responses/NoContent'
49       '400':
50         $ref: 'components.yml#/components/responses/BadRequest'
51       '401':
52         $ref: 'components.yml#/components/responses/Unauthorized'
53       '403':
54         $ref: 'components.yml#/components/responses/Forbidden'
55       '409':
56         $ref: 'components.yml#/components/responses/Conflict'
57
58 schemaSet:
59   post:
60     description: Create a new schema set in the given dataspace
61     tags:
62       - cps-admin
63     summary: Create a schema set
64     operationId: createSchemaSet
65     parameters:
66       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
67       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
68     requestBody:
69       required: true
70       content:
71         multipart/form-data:
72           schema:
73             $ref: 'components.yml#/components/schemas/MultipartFile'
74
75     responses:
76       '201':
77         $ref: 'components.yml#/components/responses/Created'
78       '400':
79         $ref: 'components.yml#/components/responses/BadRequest'
80       '401':
81         $ref: 'components.yml#/components/responses/Unauthorized'
82       '403':
83         $ref: 'components.yml#/components/responses/Forbidden'
84
85 schemaSetBySchemaSetName:
86   get:
87     description: Read a schema set given a schema set name and a dataspace
88     tags:
89       - cps-admin
90     summary: Get a schema set
91     operationId: getSchemaSet
92     parameters:
93       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
94       - $ref: 'components.yml#/components/parameters/schemaSetNameInPath'
95     responses:
96       '200':
97         description: OK
98         content:
99           application/json:
100             schema:
101               $ref: 'components.yml#/components/schemas/SchemaSetDetails'
102       '400':
103         $ref: 'components.yml#/components/responses/BadRequest'
104       '401':
105         $ref: 'components.yml#/components/responses/Unauthorized'
106       '403':
107         $ref: 'components.yml#/components/responses/Forbidden'
108       '404':
109         $ref: 'components.yml#/components/responses/NotFound'
110
111   delete:
112     description: Delete a schema set given a schema set name and a dataspace
113     tags:
114       - cps-admin
115     summary: Delete a schema set
116     operationId: deleteSchemaSet
117     parameters:
118       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
119       - $ref: 'components.yml#/components/parameters/schemaSetNameInPath'
120     responses:
121       '204':
122         $ref: 'components.yml#/components/responses/NoContent'
123       '400':
124         $ref: 'components.yml#/components/responses/BadRequest'
125       '401':
126         $ref: 'components.yml#/components/responses/Unauthorized'
127       '403':
128         $ref: 'components.yml#/components/responses/Forbidden'
129       '409':
130         $ref: 'components.yml#/components/responses/Conflict'
131
132 anchorsByDataspace:
133   get:
134     description: Read all anchors, given a dataspace
135     tags:
136       - cps-admin
137     summary: Get anchors
138     operationId: getAnchors
139     parameters:
140       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
141     responses:
142       '200':
143         description: OK
144         content:
145           application/json:
146             schema:
147               type: array
148               items:
149                 $ref: 'components.yml#/components/schemas/AnchorDetails'
150       '400':
151         $ref: 'components.yml#/components/responses/BadRequest'
152       '401':
153         $ref: 'components.yml#/components/responses/Unauthorized'
154       '403':
155         $ref: 'components.yml#/components/responses/Forbidden'
156       '404':
157         $ref: 'components.yml#/components/responses/NotFound'
158
159   post:
160     description: Create a new anchor in the given dataspace
161     tags:
162       - cps-admin
163     summary: Create an anchor
164     operationId: createAnchor
165     parameters:
166       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
167       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
168       - $ref: 'components.yml#/components/parameters/anchorNameInQuery'
169     responses:
170       '201':
171         $ref: 'components.yml#/components/responses/Created'
172       '400':
173         $ref: 'components.yml#/components/responses/BadRequest'
174       '401':
175         $ref: 'components.yml#/components/responses/Unauthorized'
176       '403':
177         $ref: 'components.yml#/components/responses/Forbidden'
178
179 anchorByDataspaceAndAnchorName:
180   get:
181     description: Read an anchor given an anchor name and a dataspace
182     tags:
183       - cps-admin
184     summary: Get an anchor
185     operationId: getAnchor
186     parameters:
187       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
188       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
189     responses:
190       '200':
191         description: OK
192         content:
193           application/json:
194             schema:
195               $ref: 'components.yml#/components/schemas/AnchorDetails'
196       '400':
197         $ref: 'components.yml#/components/responses/BadRequest'
198       '401':
199         $ref: 'components.yml#/components/responses/Unauthorized'
200       '403':
201         $ref: 'components.yml#/components/responses/Forbidden'
202       '404':
203         $ref: 'components.yml#/components/responses/NotFound'
204
205   delete:
206     description: Delete an anchor given an anchor name and a dataspace
207     tags:
208       - cps-admin
209     summary: Delete an anchor
210     operationId: deleteAnchor
211     parameters:
212       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
213       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
214     responses:
215       '204':
216         $ref: 'components.yml#/components/responses/NoContent'
217       '400':
218         $ref: 'components.yml#/components/responses/BadRequest'
219       '401':
220         $ref: 'components.yml#/components/responses/Unauthorized'
221       '403':
222         $ref: 'components.yml#/components/responses/Forbidden'