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