[OpenAPI] Implemented example as per example wiki page for getting anchors based...
[cps.git] / cps-rest / docs / openapi / cpsAdmin.yml
1 dataspaces:
2   post:
3     description: Create a new dataspace
4     tags:
5       - cps-admin
6     summary: Create a dataspace
7     operationId: createDataspace
8     parameters:
9       - $ref: 'components.yml#/components/parameters/dataspaceNameInQuery'
10     responses:
11       '201':
12         $ref: 'components.yml#/components/responses/Created'
13       '400':
14         $ref: 'components.yml#/components/responses/BadRequest'
15       '401':
16         $ref: 'components.yml#/components/responses/Unauthorized'
17       '403':
18         $ref: 'components.yml#/components/responses/Forbidden'
19
20 dataspaceByDataspaceName:
21   delete:
22     description: Delete the given dataspace - DRAFT
23     tags:
24       - cps-admin
25     summary: Delete a dataspace
26     operationId: deleteDataspace
27     parameters:
28       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
29     responses:
30       '200':
31         $ref: 'components.yml#/components/responses/Ok'
32       '204':
33         $ref: 'components.yml#/components/responses/NoContent'
34       '400':
35         $ref: 'components.yml#/components/responses/BadRequest'
36       '401':
37         $ref: 'components.yml#/components/responses/Unauthorized'
38       '403':
39         $ref: 'components.yml#/components/responses/Forbidden'
40
41
42 schemaSet:
43   post:
44     description: Create a new schema set in the given dataspace
45     tags:
46       - cps-admin
47     summary: Create a schema set
48     operationId: createSchemaSet
49     parameters:
50       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
51       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
52     requestBody:
53       required: true
54       content:
55         multipart/form-data:
56           schema:
57             $ref: 'components.yml#/components/schemas/MultipartFile'
58
59     responses:
60       '201':
61         $ref: 'components.yml#/components/responses/Created'
62       '400':
63         $ref: 'components.yml#/components/responses/BadRequest'
64       '401':
65         $ref: 'components.yml#/components/responses/Unauthorized'
66       '403':
67         $ref: 'components.yml#/components/responses/Forbidden'
68
69 schemaSetBySchemaSetName:
70   get:
71     description: Read a schema set given a schema set name and a dataspace
72     tags:
73       - cps-admin
74     summary: Get a schema set
75     operationId: getSchemaSet
76     parameters:
77       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
78       - $ref: 'components.yml#/components/parameters/schemaSetNameInPath'
79     responses:
80       '200':
81         description: OK
82         content:
83           application/json:
84             schema:
85               $ref: 'components.yml#/components/schemas/SchemaSetDetails'
86       '400':
87         $ref: 'components.yml#/components/responses/BadRequest'
88       '401':
89         $ref: 'components.yml#/components/responses/Unauthorized'
90       '403':
91         $ref: 'components.yml#/components/responses/Forbidden'
92       '404':
93         $ref: 'components.yml#/components/responses/NotFound'
94
95   delete:
96     description: Delete a schema set given a schema set name and a dataspace
97     tags:
98       - cps-admin
99     summary: Delete a schema set
100     operationId: deleteSchemaSet
101     parameters:
102       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
103       - $ref: 'components.yml#/components/parameters/schemaSetNameInPath'
104     responses:
105       '204':
106         $ref: 'components.yml#/components/responses/NoContent'
107       '400':
108         $ref: 'components.yml#/components/responses/BadRequest'
109       '401':
110         $ref: 'components.yml#/components/responses/Unauthorized'
111       '403':
112         $ref: 'components.yml#/components/responses/Forbidden'
113       '409':
114         $ref: 'components.yml#/components/responses/Conflict'
115
116 anchorsByDataspace:
117   get:
118     description: Read all anchors, given a dataspace
119     tags:
120       - cps-admin
121     summary: Get anchors
122     operationId: getAnchors
123     parameters:
124       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
125     responses:
126       '200':
127         description: OK
128         content:
129           application/json:
130             schema:
131               type: array
132               items:
133                 $ref: 'components.yml#/components/schemas/AnchorDetails'
134       '400':
135         $ref: 'components.yml#/components/responses/BadRequest'
136       '401':
137         $ref: 'components.yml#/components/responses/Unauthorized'
138       '403':
139         $ref: 'components.yml#/components/responses/Forbidden'
140       '404':
141         $ref: 'components.yml#/components/responses/NotFound'
142
143   post:
144     description: Create a new anchor in the given dataspace
145     tags:
146       - cps-admin
147     summary: Create an anchor
148     operationId: createAnchor
149     parameters:
150       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
151       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
152       - $ref: 'components.yml#/components/parameters/anchorNameInQuery'
153     responses:
154       '201':
155         $ref: 'components.yml#/components/responses/Created'
156       '400':
157         $ref: 'components.yml#/components/responses/BadRequest'
158       '401':
159         $ref: 'components.yml#/components/responses/Unauthorized'
160       '403':
161         $ref: 'components.yml#/components/responses/Forbidden'
162
163 anchorByDataspaceAndAnchorName:
164   get:
165     description: Read an anchor given an anchor name and a dataspace
166     tags:
167       - cps-admin
168     summary: Get an anchor
169     operationId: getAnchor
170     parameters:
171       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
172       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
173     responses:
174       '200':
175         description: OK
176         content:
177           application/json:
178             schema:
179               $ref: 'components.yml#/components/schemas/AnchorDetails'
180       '400':
181         $ref: 'components.yml#/components/responses/BadRequest'
182       '401':
183         $ref: 'components.yml#/components/responses/Unauthorized'
184       '403':
185         $ref: 'components.yml#/components/responses/Forbidden'
186       '404':
187         $ref: 'components.yml#/components/responses/NotFound'
188
189   delete:
190     description: Delete an anchor given an anchor name and a dataspace
191     tags:
192       - cps-admin
193     summary: Delete an anchor
194     operationId: deleteAnchor
195     parameters:
196       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
197       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
198     responses:
199       '204':
200         $ref: 'components.yml#/components/responses/NoContent'
201       '400':
202         $ref: 'components.yml#/components/responses/BadRequest'
203       '401':
204         $ref: 'components.yml#/components/responses/Unauthorized'
205       '403':
206         $ref: 'components.yml#/components/responses/Forbidden'