Have event schema objects serializable
[cps.git] / cps-rest / docs / openapi / 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         $ref: 'components.yml#/components/responses/Ok'
32       '400':
33         $ref: 'components.yml#/components/responses/BadRequest'
34       '401':
35         $ref: 'components.yml#/components/responses/Unauthorized'
36       '403':
37         $ref: 'components.yml#/components/responses/Forbidden'
38       '404':
39         $ref: 'components.yml#/components/responses/NotFound'
40     x-codegen-request-body-name: xpath
41
42 listNodeByDataspaceAndAnchor:
43   post:
44     description: Add list-node child elements to existing node for a given anchor and dataspace
45     tags:
46       - cps-data
47     summary: Add list-node child element(s) under existing parent node
48     operationId: addListNodeElements
49     parameters:
50       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
51       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
52       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
53     requestBody:
54       required: true
55       content:
56         application/json:
57           schema:
58             type: string
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   patch:
70     description: Replace list-node child elements under existing node for a given anchor and dataspace
71     tags:
72       - cps-data
73     summary: Replace list-node child element(s) under existing parent node
74     operationId: replaceListNodeElements
75     parameters:
76       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
77       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
78       - $ref: 'components.yml#/components/parameters/requiredXpathInQuery'
79     requestBody:
80       required: true
81       content:
82         application/json:
83           schema:
84             type: string
85     responses:
86       '200':
87         $ref: 'components.yml#/components/responses/Created'
88       '400':
89         $ref: 'components.yml#/components/responses/BadRequest'
90       '401':
91         $ref: 'components.yml#/components/responses/Unauthorized'
92       '403':
93         $ref: 'components.yml#/components/responses/Forbidden'
94
95 nodesByDataspaceAndAnchor:
96   post:
97     description: Create a node for a given anchor and dataspace
98     tags:
99       - cps-data
100     summary: Create a node
101     operationId: createNode
102     parameters:
103       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
104       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
105       - $ref: 'components.yml#/components/parameters/xpathInQuery'
106     requestBody:
107       required: true
108       content:
109         application/json:
110           schema:
111             type: string
112     responses:
113       '201':
114         $ref: 'components.yml#/components/responses/Created'
115       '400':
116         $ref: 'components.yml#/components/responses/BadRequest'
117       '401':
118         $ref: 'components.yml#/components/responses/Unauthorized'
119       '403':
120         $ref: 'components.yml#/components/responses/Forbidden'
121
122   patch:
123     description: Update a data node leaves for a given dataspace and anchor and a parent node xpath
124     tags:
125       - cps-data
126     summary: Update node leaves
127     operationId: updateNodeLeaves
128     parameters:
129       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
130       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
131       - $ref: 'components.yml#/components/parameters/xpathInQuery'
132     requestBody:
133       required: true
134       content:
135         application/json:
136           schema:
137             type: string
138     responses:
139       '200':
140         $ref: 'components.yml#/components/responses/Ok'
141       '400':
142         $ref: 'components.yml#/components/responses/BadRequest'
143       '401':
144         $ref: 'components.yml#/components/responses/Unauthorized'
145       '403':
146         $ref: 'components.yml#/components/responses/Forbidden'
147
148   put:
149     description: Replace a node with descendants for a given dataspace, anchor and a parent node xpath
150     tags:
151       - cps-data
152     summary: Replace a node with descendants
153     operationId: replaceNode
154     parameters:
155       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
156       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
157       - $ref: 'components.yml#/components/parameters/xpathInQuery'
158     requestBody:
159       required: true
160       content:
161         application/json:
162           schema:
163             type: string
164     responses:
165       '200':
166         $ref: 'components.yml#/components/responses/Ok'
167       '400':
168         $ref: 'components.yml#/components/responses/BadRequest'
169       '401':
170         $ref: 'components.yml#/components/responses/Unauthorized'
171       '403':
172         $ref: 'components.yml#/components/responses/Forbidden'
173
174
175 nodesByDataspace:
176   get:
177     description: Get all nodes for a given dataspace using an xpath or schema node identifier - DRAFT
178     tags:
179       - cps-data
180     summary: Get nodes
181     operationId: getNodesByDataspace
182     parameters:
183       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
184     responses:
185       '200':
186         $ref: 'components.yml#/components/responses/Ok'
187       '400':
188         $ref: 'components.yml#/components/responses/BadRequest'
189       '401':
190         $ref: 'components.yml#/components/responses/Unauthorized'
191       '403':
192         $ref: 'components.yml#/components/responses/Forbidden'
193       '404':
194         $ref: 'components.yml#/components/responses/NotFound'
195     x-codegen-request-body-name: requestBody