6ed4f0223768df6f7823f3246c4d27ab63a104d0
[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     tags:
24       - network-cm-proxy
25     summary: Get a node given a cm Handle and xpath
26     operationId: getNodeByCmHandleAndXpath
27     parameters:
28       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
29       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
30       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
31     responses:
32       200:
33         $ref: 'components.yaml#/components/responses/Ok'
34       400:
35         $ref: 'components.yaml#/components/responses/BadRequest'
36       401:
37         $ref: 'components.yaml#/components/responses/Unauthorized'
38       403:
39         $ref: 'components.yaml#/components/responses/Forbidden'
40       404:
41         $ref: 'components.yaml#/components/responses/NotFound'
42
43 nodesByCmHandleAndCpsPath:
44   get:
45     description: Query nodes for the given cps path and cm Handle
46     tags:
47       - network-cm-proxy
48     summary: Query data nodes
49     operationId: queryNodesByCmHandleAndCpsPath
50     parameters:
51       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
52       - $ref: 'components.yaml#/components/parameters/cpsPathInQuery'
53       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
54     responses:
55       200:
56         $ref: 'components.yaml#/components/responses/Ok'
57       400:
58         $ref: 'components.yaml#/components/responses/BadRequest'
59       401:
60         $ref: 'components.yaml#/components/responses/Unauthorized'
61       403:
62         $ref: 'components.yaml#/components/responses/Forbidden'
63       404:
64         $ref: 'components.yaml#/components/responses/NotFound'
65
66 nodesByCmHandleAndXpath:
67   post:
68     description: Create a node with descendants for the given CM Handle; top level or under existing node (requires xpath)
69     tags:
70       - network-cm-proxy
71     summary: Create a node with descendants
72     operationId: createNode
73     parameters:
74       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
75       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
76     requestBody:
77       required: true
78       content:
79         application/json:
80           schema:
81             type: string
82     responses:
83       201:
84         $ref: 'components.yaml#/components/responses/Created'
85       400:
86         $ref: 'components.yaml#/components/responses/BadRequest'
87       401:
88         $ref: 'components.yaml#/components/responses/Unauthorized'
89       403:
90         $ref: 'components.yaml#/components/responses/Forbidden'
91       404:
92         $ref: 'components.yaml#/components/responses/NotFound'
93
94   patch:
95     description: Update node leaves for the given cps path and cm Handle
96     tags:
97       - network-cm-proxy
98     summary: Update node leaves
99     operationId: updateNodeLeaves
100     parameters:
101       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
102       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
103     requestBody:
104       required: true
105       content:
106         application/json:
107           schema:
108             type: string
109     responses:
110       200:
111         $ref: 'components.yaml#/components/responses/Ok'
112       400:
113         $ref: 'components.yaml#/components/responses/BadRequest'
114       401:
115         $ref: 'components.yaml#/components/responses/Unauthorized'
116       403:
117         $ref: 'components.yaml#/components/responses/Forbidden'
118       404:
119         $ref: 'components.yaml#/components/responses/NotFound'
120
121   put:
122     description: Replace a node with descendants for the given cps path and cm Handle
123     tags:
124       - network-cm-proxy
125     summary: Replace a node with descendants
126     operationId: replaceNode
127     parameters:
128       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
129       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
130     requestBody:
131       required: true
132       content:
133         application/json:
134           schema:
135             type: string
136     responses:
137       200:
138         $ref: 'components.yaml#/components/responses/Ok'
139       400:
140         $ref: 'components.yaml#/components/responses/BadRequest'
141       401:
142         $ref: 'components.yaml#/components/responses/Unauthorized'
143       403:
144         $ref: 'components.yaml#/components/responses/Forbidden'
145       404:
146         $ref: 'components.yaml#/components/responses/NotFound'
147
148 listNodeByCmHandleAndXpath:
149   post:
150     description: Add one or more list-node child elements under existing node for the given CM Handle
151     tags:
152       - network-cm-proxy
153     summary: Add list-node child element(s)
154     operationId: addListNodeElements
155     parameters:
156       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
157       - $ref: 'components.yaml#/components/parameters/requiredXpathInQuery'
158     requestBody:
159       required: true
160       content:
161         application/json:
162           schema:
163             type: string
164     responses:
165       201:
166         $ref: 'components.yaml#/components/responses/Created'
167       400:
168         $ref: 'components.yaml#/components/responses/BadRequest'
169       401:
170         $ref: 'components.yaml#/components/responses/Unauthorized'
171       403:
172         $ref: 'components.yaml#/components/responses/Forbidden'
173       404:
174         $ref: 'components.yaml#/components/responses/NotFound'