cb5594868654783a35dcdab08a4a3a3313bc22dc
[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 # ============LICENSE_END=========================================================
16
17 dataspaces:
18   post:
19     description: Create a new dataspace
20     tags:
21       - cps-admin
22     summary: Create a dataspace
23     operationId: createDataspace
24     parameters:
25       - $ref: 'components.yml#/components/parameters/dataspaceNameInQuery'
26     responses:
27       '201':
28         $ref: 'components.yml#/components/responses/Created'
29       '400':
30         $ref: 'components.yml#/components/responses/BadRequest'
31       '401':
32         $ref: 'components.yml#/components/responses/Unauthorized'
33       '403':
34         $ref: 'components.yml#/components/responses/Forbidden'
35
36 dataspaceByDataspaceName:
37   delete:
38     description: Delete the given dataspace - DRAFT
39     tags:
40       - cps-admin
41     summary: Delete a dataspace
42     operationId: deleteDataspace
43     parameters:
44       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
45     responses:
46       '200':
47         $ref: 'components.yml#/components/responses/Ok'
48       '204':
49         $ref: 'components.yml#/components/responses/NoContent'
50       '400':
51         $ref: 'components.yml#/components/responses/BadRequest'
52       '401':
53         $ref: 'components.yml#/components/responses/Unauthorized'
54       '403':
55         $ref: 'components.yml#/components/responses/Forbidden'
56
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         $ref: 'components.yml#/components/responses/Ok'
98       '400':
99         $ref: 'components.yml#/components/responses/BadRequest'
100       '401':
101         $ref: 'components.yml#/components/responses/Unauthorized'
102       '403':
103         $ref: 'components.yml#/components/responses/Forbidden'
104       '404':
105         $ref: 'components.yml#/components/responses/NotFound'
106
107   delete:
108     description: Delete a schema set given a schema set name and a dataspace
109     tags:
110       - cps-admin
111     summary: Delete a schema set
112     operationId: deleteSchemaSet
113     parameters:
114       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
115       - $ref: 'components.yml#/components/parameters/schemaSetNameInPath'
116     responses:
117       '204':
118         $ref: 'components.yml#/components/responses/NoContent'
119       '400':
120         $ref: 'components.yml#/components/responses/BadRequest'
121       '401':
122         $ref: 'components.yml#/components/responses/Unauthorized'
123       '403':
124         $ref: 'components.yml#/components/responses/Forbidden'
125       '409':
126         $ref: 'components.yml#/components/responses/Conflict'
127
128 anchorsByDataspace:
129   get:
130     description: Read all anchors, given a dataspace
131     tags:
132       - cps-admin
133     summary: Get anchors
134     operationId: getAnchors
135     parameters:
136       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
137     responses:
138       '200':
139         $ref: 'components.yml#/components/responses/Ok'
140       '400':
141         $ref: 'components.yml#/components/responses/BadRequest'
142       '401':
143         $ref: 'components.yml#/components/responses/Unauthorized'
144       '403':
145         $ref: 'components.yml#/components/responses/Forbidden'
146       '404':
147         $ref: 'components.yml#/components/responses/NotFound'
148
149   post:
150     description: Create a new anchor in the given dataspace
151     tags:
152       - cps-admin
153     summary: Create an anchor
154     operationId: createAnchor
155     parameters:
156       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
157       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
158       - $ref: 'components.yml#/components/parameters/anchorNameInQuery'
159     responses:
160       '201':
161         $ref: 'components.yml#/components/responses/Created'
162       '400':
163         $ref: 'components.yml#/components/responses/BadRequest'
164       '401':
165         $ref: 'components.yml#/components/responses/Unauthorized'
166       '403':
167         $ref: 'components.yml#/components/responses/Forbidden'
168
169 anchorByDataspaceAndAnchorName:
170   get:
171     description: Read an anchor given an anchor name and a dataspace
172     tags:
173       - cps-admin
174     summary: Get an anchor
175     operationId: getAnchor
176     parameters:
177       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
178       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
179     responses:
180       '200':
181         $ref: 'components.yml#/components/responses/Ok'
182       '400':
183         $ref: 'components.yml#/components/responses/BadRequest'
184       '401':
185         $ref: 'components.yml#/components/responses/Unauthorized'
186       '403':
187         $ref: 'components.yml#/components/responses/Forbidden'
188       '404':
189         $ref: 'components.yml#/components/responses/NotFound'
190
191   delete:
192     description: Delete an anchor given an anchor name and a dataspace
193     tags:
194       - cps-admin
195     summary: Delete an anchor
196     operationId: deleteAnchor
197     parameters:
198       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
199       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
200     responses:
201       '204':
202         $ref: 'components.yml#/components/responses/NoContent'
203       '400':
204         $ref: 'components.yml#/components/responses/BadRequest'
205       '401':
206         $ref: 'components.yml#/components/responses/Unauthorized'
207       '403':
208         $ref: 'components.yml#/components/responses/Forbidden'