Implement DMI Registration (NCMP-Side)
[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 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'