Changing resource identifier to a query param
[cps.git] / cps-ncmp-rest / docs / openapi / ncmproxy.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Nordix Foundation
3 #  Modifications Copyright (C) 2021 Pantheon.tech
4 #  ================================================================================
5 #  Licensed under the Apache License, Version 2.0 (the "License");
6 #  you may not use this file except in compliance with the License.
7 #  You may obtain a copy of the License at
8 #
9 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #  Unless required by applicable law or agreed to in writing, software
12 #  distributed under the License is distributed on an "AS IS" BASIS,
13 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #  See the License for the specific language governing permissions and
15 #  limitations under the License.
16 #
17 #  SPDX-License-Identifier: Apache-2.0
18 #  ============LICENSE_END=========================================================
19
20 nodeByCmHandleAndXpath:
21   get:
22     description: Get a node with an option to retrieve all the children for a given cm Handle
23     deprecated: true
24     tags:
25       - network-cm-proxy
26     summary: Get a node given a cm Handle and xpath
27     operationId: getNodeByCmHandleAndXpath
28     parameters:
29       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
30       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
31       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
32     responses:
33       200:
34         $ref: 'components.yaml#/components/responses/Ok'
35       400:
36         $ref: 'components.yaml#/components/responses/BadRequest'
37       401:
38         $ref: 'components.yaml#/components/responses/Unauthorized'
39       403:
40         $ref: 'components.yaml#/components/responses/Forbidden'
41       404:
42         $ref: 'components.yaml#/components/responses/NotFound'
43
44 nodesByCmHandleAndCpsPath:
45   get:
46     description: Query nodes for the given cps path and cm Handle
47     deprecated: true
48     tags:
49       - network-cm-proxy
50     summary: Query data nodes
51     operationId: queryNodesByCmHandleAndCpsPath
52     parameters:
53       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
54       - $ref: 'components.yaml#/components/parameters/cpsPathInQuery'
55       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
56     responses:
57       200:
58         $ref: 'components.yaml#/components/responses/Ok'
59       400:
60         $ref: 'components.yaml#/components/responses/BadRequest'
61       401:
62         $ref: 'components.yaml#/components/responses/Unauthorized'
63       403:
64         $ref: 'components.yaml#/components/responses/Forbidden'
65       404:
66         $ref: 'components.yaml#/components/responses/NotFound'
67
68 nodesByCmHandleAndXpath:
69   post:
70     description: Create a node with descendants for the given CM Handle; top level or under existing node (requires xpath)
71     deprecated: true
72     tags:
73       - network-cm-proxy
74     summary: Create a node with descendants
75     operationId: createNode
76     parameters:
77       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
78       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
79     requestBody:
80       required: true
81       content:
82         application/json:
83           schema:
84             type: string
85     responses:
86       201:
87         $ref: 'components.yaml#/components/responses/Created'
88       400:
89         $ref: 'components.yaml#/components/responses/BadRequest'
90       401:
91         $ref: 'components.yaml#/components/responses/Unauthorized'
92       403:
93         $ref: 'components.yaml#/components/responses/Forbidden'
94       404:
95         $ref: 'components.yaml#/components/responses/NotFound'
96
97   patch:
98     description: Update node leaves for the given cps path and cm Handle
99     deprecated: true
100     tags:
101       - network-cm-proxy
102     summary: Update node leaves
103     operationId: updateNodeLeaves
104     parameters:
105       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
106       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
107     requestBody:
108       required: true
109       content:
110         application/json:
111           schema:
112             type: string
113     responses:
114       200:
115         $ref: 'components.yaml#/components/responses/Ok'
116       400:
117         $ref: 'components.yaml#/components/responses/BadRequest'
118       401:
119         $ref: 'components.yaml#/components/responses/Unauthorized'
120       403:
121         $ref: 'components.yaml#/components/responses/Forbidden'
122       404:
123         $ref: 'components.yaml#/components/responses/NotFound'
124
125   put:
126     description: Replace a node with descendants for the given cps path and cm Handle
127     deprecated: true
128     tags:
129       - network-cm-proxy
130     summary: Replace a node with descendants
131     operationId: replaceNode
132     parameters:
133       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
134       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
135     requestBody:
136       required: true
137       content:
138         application/json:
139           schema:
140             type: string
141     responses:
142       200:
143         $ref: 'components.yaml#/components/responses/Ok'
144       400:
145         $ref: 'components.yaml#/components/responses/BadRequest'
146       401:
147         $ref: 'components.yaml#/components/responses/Unauthorized'
148       403:
149         $ref: 'components.yaml#/components/responses/Forbidden'
150       404:
151         $ref: 'components.yaml#/components/responses/NotFound'
152
153 listNodeByCmHandleAndXpath:
154   post:
155     description: Add one or more list-node child elements under existing node for the given CM Handle
156     deprecated: true
157     tags:
158       - network-cm-proxy
159     summary: Add list-node child element(s)
160     operationId: addListNodeElements
161     parameters:
162       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
163       - $ref: 'components.yaml#/components/parameters/requiredXpathInQuery'
164     requestBody:
165       required: true
166       content:
167         application/json:
168           schema:
169             type: string
170     responses:
171       201:
172         $ref: 'components.yaml#/components/responses/Created'
173       400:
174         $ref: 'components.yaml#/components/responses/BadRequest'
175       401:
176         $ref: 'components.yaml#/components/responses/Unauthorized'
177       403:
178         $ref: 'components.yaml#/components/responses/Forbidden'
179       404:
180         $ref: 'components.yaml#/components/responses/NotFound'
181
182 updateDmiRegistration:
183   post:
184     description: Register a DMI Plugin with any new, updated or removed CM Handles.
185     tags:
186       - network-cm-proxy
187     summary: DMI notifies NCMP of new CM Handles
188     operationId: updateDmiPluginRegistration
189     requestBody:
190       required: true
191       content:
192         application/json:
193           schema:
194             $ref: 'components.yaml#/components/schemas/RestDmiPluginRegistration'
195     responses:
196       201:
197         $ref: 'components.yaml#/components/responses/Created'
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
205 getResourceDataForPassthroughOperational:
206   get:
207     tags:
208       - network-cm-proxy
209     summary: Get resource data from pass-through operational for cm handle
210     description: Get resource data from pass-through operational for given cm handle
211     operationId: getResourceDataOperationalForCmHandle
212     parameters:
213       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
214       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
215       - $ref: 'components.yaml#/components/parameters/acceptParamInHeader'
216       - $ref: 'components.yaml#/components/parameters/fieldsParamInQuery'
217       - $ref: 'components.yaml#/components/parameters/depthParamInQuery'
218     responses:
219       200:
220         $ref: 'components.yaml#/components/responses/Ok'
221       400:
222         $ref: 'components.yaml#/components/responses/BadRequest'
223       401:
224         $ref: 'components.yaml#/components/responses/Unauthorized'
225       403:
226         $ref: 'components.yaml#/components/responses/Forbidden'
227       404:
228         $ref: 'components.yaml#/components/responses/NotFound'
229
230 resourceDataForPassthroughRunning:
231   get:
232     tags:
233       - network-cm-proxy
234     summary: Get resource data from pass-through running for cm handle
235     description: Get resource data from pass-through running for given cm handle
236     operationId: getResourceDataRunningForCmHandle
237     parameters:
238       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
239       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
240       - $ref: 'components.yaml#/components/parameters/acceptParamInHeader'
241       - $ref: 'components.yaml#/components/parameters/fieldsParamInQuery'
242       - $ref: 'components.yaml#/components/parameters/depthParamInQuery'
243     responses:
244       200:
245         $ref: 'components.yaml#/components/responses/Ok'
246       400:
247         $ref: 'components.yaml#/components/responses/BadRequest'
248       401:
249         $ref: 'components.yaml#/components/responses/Unauthorized'
250       403:
251         $ref: 'components.yaml#/components/responses/Forbidden'
252       404:
253         $ref: 'components.yaml#/components/responses/NotFound'
254   post:
255     tags:
256       - network-cm-proxy
257     summary: create resource data from pass-through running for cm handle
258     description: create resource data from pass-through running for given cm handle
259     operationId: createResourceDataRunningForCmHandle
260     parameters:
261       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
262       - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
263       - $ref: 'components.yaml#/components/parameters/contentParamInHeader'
264     requestBody:
265       required: true
266       content:
267         application/json:
268           schema:
269             type: string
270         application/yang-data+json:
271           schema:
272             type: string
273     responses:
274       201:
275         $ref: 'components.yaml#/components/responses/Created'
276       400:
277         $ref: 'components.yaml#/components/responses/BadRequest'
278       401:
279         $ref: 'components.yaml#/components/responses/Unauthorized'
280       403:
281         $ref: 'components.yaml#/components/responses/Forbidden'
282       404:
283         $ref: 'components.yaml#/components/responses/NotFound'
284
285 fetchModuleReferencesByCmHandle:
286   get:
287     description: fetch all module references (name and revision) for a given cm handle
288     tags:
289       - network-cm-proxy
290     summary: Fetch all module references (name and revision) for a given cm handle
291     operationId: getModuleReferencesByCmHandle
292     parameters:
293       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
294     responses:
295       200:
296         description: OK
297         content:
298           application/json:
299             schema:
300               type: string
301             example: [{"moduleName": "nc-notifications", "revision": "2008-07-14"}]
302         $ref: 'components.yaml#/components/responses/Ok'
303       400:
304         $ref: 'components.yaml#/components/responses/BadRequest'
305       401:
306         $ref: 'components.yaml#/components/responses/Unauthorized'
307       403:
308         $ref: 'components.yaml#/components/responses/Forbidden'
309       404:
310         $ref: 'components.yaml#/components/responses/NotFound'