Have event schema objects serializable
[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 nodesByDataspaceAndAnchor:
101   post:
102     description: Create a node for a given anchor and dataspace
103     tags:
104       - cps-data
105     summary: Create a node
106     operationId: createNode
107     parameters:
108       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
109       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
110       - $ref: 'components.yml#/components/parameters/xpathInQuery'
111     requestBody:
112       required: true
113       content:
114         application/json:
115           schema:
116             type: string
117     responses:
118       '201':
119         $ref: 'components.yml#/components/responses/Created'
120       '400':
121         $ref: 'components.yml#/components/responses/BadRequest'
122       '401':
123         $ref: 'components.yml#/components/responses/Unauthorized'
124       '403':
125         $ref: 'components.yml#/components/responses/Forbidden'
126
127   patch:
128     description: Update a data node leaves for a given dataspace and anchor and a parent node xpath
129     tags:
130       - cps-data
131     summary: Update node leaves
132     operationId: updateNodeLeaves
133     parameters:
134       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
135       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
136       - $ref: 'components.yml#/components/parameters/xpathInQuery'
137     requestBody:
138       required: true
139       content:
140         application/json:
141           schema:
142             type: string
143     responses:
144       '200':
145         $ref: 'components.yml#/components/responses/Ok'
146       '400':
147         $ref: 'components.yml#/components/responses/BadRequest'
148       '401':
149         $ref: 'components.yml#/components/responses/Unauthorized'
150       '403':
151         $ref: 'components.yml#/components/responses/Forbidden'
152
153   put:
154     description: Replace a node with descendants for a given dataspace, anchor and a parent node xpath
155     tags:
156       - cps-data
157     summary: Replace a node with descendants
158     operationId: replaceNode
159     parameters:
160       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
161       - $ref: 'components.yml#/components/parameters/anchorNameInPath'
162       - $ref: 'components.yml#/components/parameters/xpathInQuery'
163     requestBody:
164       required: true
165       content:
166         application/json:
167           schema:
168             type: string
169     responses:
170       '200':
171         $ref: 'components.yml#/components/responses/Ok'
172       '400':
173         $ref: 'components.yml#/components/responses/BadRequest'
174       '401':
175         $ref: 'components.yml#/components/responses/Unauthorized'
176       '403':
177         $ref: 'components.yml#/components/responses/Forbidden'
178
179
180 nodesByDataspace:
181   get:
182     description: Get all nodes for a given dataspace using an xpath or schema node identifier - DRAFT
183     tags:
184       - cps-data
185     summary: Get nodes
186     operationId: getNodesByDataspace
187     parameters:
188       - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
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       '404':
199         $ref: 'components.yml#/components/responses/NotFound'
200     x-codegen-request-body-name: requestBody