Patch operation passthrough running
[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   patch:
293     tags:
294       - network-cm-proxy
295     summary: Patch resource data from pass-through running
296     description: Patch resource data from pass-through running for the given cm handle
297     operationId: patchResourceDataRunningForCmHandle
298     parameters:
299       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
300       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
301       - $ref: 'components.yaml#/components/parameters/contentParamInHeader'
302     requestBody:
303       required: true
304       content:
305         application/json:
306           schema:
307             type: object
308     responses:
309       200:
310         $ref: 'components.yaml#/components/responses/Ok'
311       400:
312         $ref: 'components.yaml#/components/responses/BadRequest'
313       401:
314         $ref: 'components.yaml#/components/responses/Unauthorized'
315       403:
316         $ref: 'components.yaml#/components/responses/Forbidden'
317       404:
318         $ref: 'components.yaml#/components/responses/NotFound'
319
320 fetchModuleReferencesByCmHandle:
321   get:
322     description: fetch all module references (name and revision) for a given cm handle
323     tags:
324       - network-cm-proxy
325     summary: Fetch all module references (name and revision) for a given cm handle
326     operationId: getModuleReferencesByCmHandle
327     parameters:
328       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
329     responses:
330       200:
331         description: OK
332         content:
333           application/json:
334             schema:
335               type: string
336             example: [{"moduleName": "nc-notifications", "revision": "2008-07-14"}]
337         $ref: 'components.yaml#/components/responses/Ok'
338       400:
339         $ref: 'components.yaml#/components/responses/BadRequest'
340       401:
341         $ref: 'components.yaml#/components/responses/Unauthorized'
342       403:
343         $ref: 'components.yaml#/components/responses/Forbidden'
344       404:
345         $ref: 'components.yaml#/components/responses/NotFound'
346
347 executeCmHandleSearch:
348   post:
349     description: Execute cm handle searches using 'hasAllModules' condition to get all cm handles for the given module names
350     tags:
351       - network-cm-proxy
352     summary: Execute cm handle search using the available conditions
353     operationId: executeCmHandleSearch
354     requestBody:
355       required: true
356       content:
357         application/json:
358           schema:
359             $ref: 'components.yaml#/components/schemas/Conditions'
360     responses:
361       200:
362         description: OK
363         content:
364           application/json:
365             schema:
366               $ref: 'components.yaml#/components/schemas/CmHandles'
367       400:
368         $ref: 'components.yaml#/components/responses/BadRequest'
369       401:
370         $ref: 'components.yaml#/components/responses/Unauthorized'
371       403:
372         $ref: 'components.yaml#/components/responses/Forbidden'