14e2cfe047447f15ddc0c18edf6a9f201c77c03c
[cps.git] / cps-rest / docs / openapi / cpsAdminV2.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2022 TechMahindra Ltd.
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: createDataspaceV2
26     parameters:
27       - $ref: 'components.yml#/components/parameters/dataspaceNameInQuery'
28     responses:
29       '201':
30         $ref: 'components.yml#/components/responses/CreatedV2'
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       '409':
38         $ref: 'components.yml#/components/responses/Conflict'
39       '500':
40         $ref: 'components.yml#/components/responses/InternalServerError'
41
42 anchorsByDataspace:
43   post:
44     description: Create a new anchor in the given dataspace
45     tags:
46       - cps-admin
47     summary: Create an anchor
48     operationId: createAnchorV2
49     parameters:
50       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
51       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
52       - $ref: 'components.yml#/components/parameters/anchorNameInQuery'
53     responses:
54       '201':
55         $ref: 'components.yml#/components/responses/CreatedV2'
56       '400':
57         $ref: 'components.yml#/components/responses/BadRequest'
58       '401':
59         $ref: 'components.yml#/components/responses/Unauthorized'
60       '403':
61         $ref: 'components.yml#/components/responses/Forbidden'
62       '409':
63         $ref: 'components.yml#/components/responses/Conflict'
64       '500':
65         $ref: 'components.yml#/components/responses/InternalServerError'
66
67 schemaSet:
68   post:
69     description: Create a new schema set in the given dataspace
70     tags:
71       - cps-admin
72     summary: Create a schema set
73     operationId: createSchemaSetV2
74     parameters:
75       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
76       - $ref: 'components.yml#/components/parameters/schemaSetNameInQuery'
77     requestBody:
78       required: true
79       content:
80         multipart/form-data:
81           schema:
82             $ref: 'components.yml#/components/schemas/MultipartFile'
83     responses:
84       '201':
85         $ref: 'components.yml#/components/responses/CreatedV2'
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       '409':
93         $ref: 'components.yml#/components/responses/Conflict'
94       '500':
95         $ref: 'components.yml#/components/responses/InternalServerError'