611e84e01e490047dd6503e017739d236331d0d6
[cps.git] / cps-ncmp-rest / docs / openapi / ncmp.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Nordix Foundation
3 #  Modifications Copyright (C) 2021 Pantheon.tech
4 #  Modifications Copyright (C) 2021 Bell Canada
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 nodeByCmHandleAndXpath:
22   get:
23     description: Get a node with an option to retrieve all the children for a given cm Handle
24     deprecated: true
25     tags:
26       - network-cm-proxy
27     summary: Get a node given a cm Handle and xpath
28     operationId: getNodeByCmHandleAndXpath
29     parameters:
30       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
31       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
32       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
33     responses:
34       200:
35         $ref: 'components.yaml#/components/responses/Ok'
36       400:
37         $ref: 'components.yaml#/components/responses/BadRequest'
38       401:
39         $ref: 'components.yaml#/components/responses/Unauthorized'
40       403:
41         $ref: 'components.yaml#/components/responses/Forbidden'
42       404:
43         $ref: 'components.yaml#/components/responses/NotFound'
44
45 nodesByCmHandleAndCpsPath:
46   get:
47     description: Query nodes for the given cps path and cm Handle
48     deprecated: true
49     tags:
50       - network-cm-proxy
51     summary: Query data nodes
52     operationId: queryNodesByCmHandleAndCpsPath
53     parameters:
54       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
55       - $ref: 'components.yaml#/components/parameters/cpsPathInQuery'
56       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
57     responses:
58       200:
59         $ref: 'components.yaml#/components/responses/Ok'
60       400:
61         $ref: 'components.yaml#/components/responses/BadRequest'
62       401:
63         $ref: 'components.yaml#/components/responses/Unauthorized'
64       403:
65         $ref: 'components.yaml#/components/responses/Forbidden'
66       404:
67         $ref: 'components.yaml#/components/responses/NotFound'
68
69 nodesByCmHandleAndXpath:
70   post:
71     description: Create a node with descendants for the given CM Handle; top level or under existing node (requires xpath)
72     deprecated: true
73     tags:
74       - network-cm-proxy
75     summary: Create a node with descendants
76     operationId: createNode
77     parameters:
78       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
79       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
80     requestBody:
81       required: true
82       content:
83         application/json:
84           schema:
85             type: string
86     responses:
87       201:
88         $ref: 'components.yaml#/components/responses/Created'
89       400:
90         $ref: 'components.yaml#/components/responses/BadRequest'
91       401:
92         $ref: 'components.yaml#/components/responses/Unauthorized'
93       403:
94         $ref: 'components.yaml#/components/responses/Forbidden'
95       404:
96         $ref: 'components.yaml#/components/responses/NotFound'
97
98   patch:
99     description: Update node leaves for the given cps path and cm Handle
100     deprecated: true
101     tags:
102       - network-cm-proxy
103     summary: Update node leaves
104     operationId: updateNodeLeaves
105     parameters:
106       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
107       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
108     requestBody:
109       required: true
110       content:
111         application/json:
112           schema:
113             type: string
114     responses:
115       200:
116         $ref: 'components.yaml#/components/responses/Ok'
117       400:
118         $ref: 'components.yaml#/components/responses/BadRequest'
119       401:
120         $ref: 'components.yaml#/components/responses/Unauthorized'
121       403:
122         $ref: 'components.yaml#/components/responses/Forbidden'
123       404:
124         $ref: 'components.yaml#/components/responses/NotFound'
125
126   put:
127     description: Replace a node with descendants for the given cps path and cm Handle
128     deprecated: true
129     tags:
130       - network-cm-proxy
131     summary: Replace a node with descendants
132     operationId: replaceNode
133     parameters:
134       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
135       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
136     requestBody:
137       required: true
138       content:
139         application/json:
140           schema:
141             type: string
142     responses:
143       200:
144         $ref: 'components.yaml#/components/responses/Ok'
145       400:
146         $ref: 'components.yaml#/components/responses/BadRequest'
147       401:
148         $ref: 'components.yaml#/components/responses/Unauthorized'
149       403:
150         $ref: 'components.yaml#/components/responses/Forbidden'
151       404:
152         $ref: 'components.yaml#/components/responses/NotFound'
153
154 listNodeByCmHandleAndXpath:
155   post:
156     description: Add one or more list-node child elements under existing node for the given CM Handle
157     deprecated: true
158     tags:
159       - network-cm-proxy
160     summary: Add list-node child element(s)
161     operationId: addListNodeElements
162     parameters:
163       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
164       - $ref: 'components.yaml#/components/parameters/requiredXpathInQuery'
165     requestBody:
166       required: true
167       content:
168         application/json:
169           schema:
170             type: string
171     responses:
172       201:
173         $ref: 'components.yaml#/components/responses/Created'
174       400:
175         $ref: 'components.yaml#/components/responses/BadRequest'
176       401:
177         $ref: 'components.yaml#/components/responses/Unauthorized'
178       403:
179         $ref: 'components.yaml#/components/responses/Forbidden'
180       404:
181         $ref: 'components.yaml#/components/responses/NotFound'
182
183 getResourceDataForPassthroughOperational:
184   get:
185     tags:
186       - network-cm-proxy
187     summary: Get resource data from pass-through operational for cm handle
188     description: Get resource data from pass-through operational for given cm handle
189     operationId: getResourceDataOperationalForCmHandle
190     parameters:
191       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
192       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
193       - $ref: 'components.yaml#/components/parameters/acceptParamInHeader'
194       - $ref: 'components.yaml#/components/parameters/optionsParamInQuery'
195     responses:
196       200:
197         $ref: 'components.yaml#/components/responses/Ok'
198       400:
199         $ref: 'components.yaml#/components/responses/BadRequest'
200       401:
201         $ref: 'components.yaml#/components/responses/Unauthorized'
202       403:
203         $ref: 'components.yaml#/components/responses/Forbidden'
204       404:
205         $ref: 'components.yaml#/components/responses/NotFound'
206
207 resourceDataForPassthroughRunning:
208   get:
209     tags:
210       - network-cm-proxy
211     summary: Get resource data from pass-through running for cm handle
212     description: Get resource data from pass-through running for given cm handle
213     operationId: getResourceDataRunningForCmHandle
214     parameters:
215       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
216       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
217       - $ref: 'components.yaml#/components/parameters/acceptParamInHeader'
218       - $ref: 'components.yaml#/components/parameters/optionsParamInQuery'
219     responses:
220       200:
221         $ref: 'components.yaml#/components/responses/Ok'
222       400:
223         $ref: 'components.yaml#/components/responses/BadRequest'
224       401:
225         $ref: 'components.yaml#/components/responses/Unauthorized'
226       403:
227         $ref: 'components.yaml#/components/responses/Forbidden'
228       404:
229         $ref: 'components.yaml#/components/responses/NotFound'
230   post:
231     tags:
232       - network-cm-proxy
233     summary: create resource data from pass-through running for cm handle
234     description: create resource data from pass-through running for given cm handle
235     operationId: createResourceDataRunningForCmHandle
236     parameters:
237       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
238       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
239       - $ref: 'components.yaml#/components/parameters/contentParamInHeader'
240     requestBody:
241       required: true
242       content:
243         application/json:
244           schema:
245             type: string
246         application/yang-data+json:
247           schema:
248             type: string
249     responses:
250       201:
251         $ref: 'components.yaml#/components/responses/Created'
252       400:
253         $ref: 'components.yaml#/components/responses/BadRequest'
254       401:
255         $ref: 'components.yaml#/components/responses/Unauthorized'
256       403:
257         $ref: 'components.yaml#/components/responses/Forbidden'
258       404:
259         $ref: 'components.yaml#/components/responses/NotFound'
260
261   put:
262     tags:
263       - network-cm-proxy
264     summary: Update resource data from pass-through running for a cm handle
265     description: Update resource data from pass-through running for the given cm handle
266     operationId: updateResourceDataRunningForCmHandle
267     parameters:
268       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
269       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
270       - $ref: 'components.yaml#/components/parameters/contentParamInHeader'
271     requestBody:
272       required: true
273       content:
274         application/json:
275           schema:
276             type: string
277         application/yang-data+json:
278           schema:
279             type: string
280     responses:
281       200:
282         $ref: 'components.yaml#/components/responses/Ok'
283       400:
284         $ref: 'components.yaml#/components/responses/BadRequest'
285       401:
286         $ref: 'components.yaml#/components/responses/Unauthorized'
287       403:
288         $ref: 'components.yaml#/components/responses/Forbidden'
289       404:
290         $ref: 'components.yaml#/components/responses/NotFound'
291
292 fetchModuleReferencesByCmHandle:
293   get:
294     description: fetch all module references (name and revision) for a given cm handle
295     tags:
296       - network-cm-proxy
297     summary: Fetch all module references (name and revision) for a given cm handle
298     operationId: getModuleReferencesByCmHandle
299     parameters:
300       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
301     responses:
302       200:
303         description: OK
304         content:
305           application/json:
306             schema:
307               type: string
308             example: [{"moduleName": "nc-notifications", "revision": "2008-07-14"}]
309         $ref: 'components.yaml#/components/responses/Ok'
310       400:
311         $ref: 'components.yaml#/components/responses/BadRequest'
312       401:
313         $ref: 'components.yaml#/components/responses/Unauthorized'
314       403:
315         $ref: 'components.yaml#/components/responses/Forbidden'
316       404:
317         $ref: 'components.yaml#/components/responses/NotFound'
318
319 executeCmHandleSearch:
320   post:
321     description: Execute cm handle searches using 'hasAllModules' condition to get all cm handles for the given module names
322     tags:
323       - network-cm-proxy
324     summary: Execute cm handle search using the available conditions
325     operationId: executeCmHandleSearch
326     requestBody:
327       required: true
328       content:
329         application/json:
330           schema:
331             $ref: 'components.yaml#/components/schemas/Conditions'
332     responses:
333       200:
334         description: OK
335         content:
336           application/json:
337             schema:
338               $ref: 'components.yaml#/components/schemas/CmHandles'
339       400:
340         $ref: 'components.yaml#/components/responses/BadRequest'
341       401:
342         $ref: 'components.yaml#/components/responses/Unauthorized'
343       403:
344         $ref: 'components.yaml#/components/responses/Forbidden'