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