Merge "Delete list-node p2 rest layer"
[cps.git] / cps-rest / src / main / resources / static / cpsData.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 nodeByDataspaceAndAnchor:
18   get:
19     description: Get a node with an option to retrieve all the children for a given anchor and dataspace
20     tags:
21       - cps-data
22     summary: Get a node
23     operationId: getNodeByDataspaceAndAnchor
24     parameters:
25       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
26       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
27       - $ref: 'components.yml#/components/parameters/xpathInQuery'
28       - $ref: 'components.yml#/components/parameters/includeDescendantsOptionInQuery'
29     responses:
30       '200':
31         description: OK
32         content:
33           application/json:
34             schema:
35               type: object
36             example: { "child": my_child,"leafList": "leafListElement1, leafListElement2", "leaf": my_leaf }
37       '400':
38         $ref: 'components.yml#/components/responses/BadRequest'
39       '401':
40         $ref: 'components.yml#/components/responses/Unauthorized'
41       '403':
42         $ref: 'components.yml#/components/responses/Forbidden'
43       '404':
44         $ref: 'components.yml#/components/responses/NotFound'
45     x-codegen-request-body-name: xpath
46
47 listNodeByDataspaceAndAnchor:
48   post:
49     description: Add list-node child elements to existing node for a given anchor and dataspace
50     tags:
51       - cps-data
52     summary: Add list-node child element(s) under existing parent node
53     operationId: addListNodeElements
54     parameters:
55       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
56       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
57       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
58     requestBody:
59       required: true
60       content:
61         application/json:
62           schema:
63             type: string
64     responses:
65       '201':
66         $ref: 'components.yml#/components/responses/Created'
67       '400':
68         $ref: 'components.yml#/components/responses/BadRequest'
69       '401':
70         $ref: 'components.yml#/components/responses/Unauthorized'
71       '403':
72         $ref: 'components.yml#/components/responses/Forbidden'
73
74   patch:
75     description: Replace list-node child elements under existing node for a given anchor and dataspace
76     tags:
77       - cps-data
78     summary: Replace list-node child element(s) under existing parent node
79     operationId: replaceListNodeElements
80     parameters:
81       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
82       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
83       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
84     requestBody:
85       required: true
86       content:
87         application/json:
88           schema:
89             type: string
90     responses:
91       '200':
92         $ref: 'components.yml#/components/responses/Created'
93       '400':
94         $ref: 'components.yml#/components/responses/BadRequest'
95       '401':
96         $ref: 'components.yml#/components/responses/Unauthorized'
97       '403':
98         $ref: 'components.yml#/components/responses/Forbidden'
99
100   delete:
101     description: Delete list-node child elements under existing node for a given anchor and dataspace
102     tags:
103       - cps-data
104     summary: Delete list-node child element(s) under existing parent node
105     operationId: deleteListNodeElements
106     parameters:
107       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
108       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
109       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
110     responses:
111       '204':
112         $ref: 'components.yml#/components/responses/NoContent'
113       '400':
114         $ref: 'components.yml#/components/responses/BadRequest'
115       '401':
116         $ref: 'components.yml#/components/responses/Unauthorized'
117       '403':
118         $ref: 'components.yml#/components/responses/Forbidden'
119
120 nodesByDataspaceAndAnchor:
121   post:
122     description: Create a node for a given anchor and dataspace
123     tags:
124       - cps-data
125     summary: Create a node
126     operationId: createNode
127     parameters:
128       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
129       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
130       - $ref: 'components.yml#/components/parameters/xpathInQuery'
131     requestBody:
132       required: true
133       content:
134         application/json:
135           schema:
136             type: string
137     responses:
138       '201':
139         $ref: 'components.yml#/components/responses/Created'
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
147   patch:
148     description: Update a data node leaves for a given dataspace and anchor and a parent node xpath
149     tags:
150       - cps-data
151     summary: Update node leaves
152     operationId: updateNodeLeaves
153     parameters:
154       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
155       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
156       - $ref: 'components.yml#/components/parameters/xpathInQuery'
157     requestBody:
158       required: true
159       content:
160         application/json:
161           schema:
162             type: string
163     responses:
164       '200':
165         $ref: 'components.yml#/components/responses/Ok'
166       '400':
167         $ref: 'components.yml#/components/responses/BadRequest'
168       '401':
169         $ref: 'components.yml#/components/responses/Unauthorized'
170       '403':
171         $ref: 'components.yml#/components/responses/Forbidden'
172
173   put:
174     description: Replace a node with descendants for a given dataspace, anchor and a parent node xpath
175     tags:
176       - cps-data
177     summary: Replace a node with descendants
178     operationId: replaceNode
179     parameters:
180       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
181       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
182       - $ref: 'components.yml#/components/parameters/xpathInQuery'
183     requestBody:
184       required: true
185       content:
186         application/json:
187           schema:
188             type: string
189     responses:
190       '200':
191         $ref: 'components.yml#/components/responses/Ok'
192       '400':
193         $ref: 'components.yml#/components/responses/BadRequest'
194       '401':
195         $ref: 'components.yml#/components/responses/Unauthorized'
196       '403':
197         $ref: 'components.yml#/components/responses/Forbidden'
198
199
200 nodesByDataspace:
201   get:
202     description: Get all nodes for a given dataspace using an xpath or schema node identifier - DRAFT
203     tags:
204       - cps-data
205     summary: Get nodes
206     operationId: getNodesByDataspace
207     parameters:
208       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
209     responses:
210       '200':
211         $ref: 'components.yml#/components/responses/Ok'
212       '400':
213         $ref: 'components.yml#/components/responses/BadRequest'
214       '401':
215         $ref: 'components.yml#/components/responses/Unauthorized'
216       '403':
217         $ref: 'components.yml#/components/responses/Forbidden'
218       '404':
219         $ref: 'components.yml#/components/responses/NotFound'
220     x-codegen-request-body-name: requestBody