Create child data node (part 2): NCMP service + REST
[cps.git] / cps-ncmp-rest / docs / openapi / ncmproxy.yml
1 #  ============LICENSE_START=======================================================
2 #  Modification (C) 2021 Nordix Foundation
3 #  Modification (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 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15 #
16 #  SPDX-License-Identifier: Apache-2.0
17 #  ============LICENSE_END=========================================================
18
19 nodeByCmHandleAndXpath:
20   get:
21     description: Get a node with an option to retrieve all the children for a given cm Handle
22     tags:
23       - network-cm-proxy
24     summary: Get a node given a cm Handle and xpath
25     operationId: getNodeByCmHandleAndXpath
26     parameters:
27       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
28       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
29       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
30     responses:
31       200:
32         $ref: 'components.yaml#/components/responses/Ok'
33       400:
34         $ref: 'components.yaml#/components/responses/BadRequest'
35       401:
36         $ref: 'components.yaml#/components/responses/Unauthorized'
37       403:
38         $ref: 'components.yaml#/components/responses/Forbidden'
39       404:
40         $ref: 'components.yaml#/components/responses/NotFound'
41       501:
42         $ref: 'components.yaml#/components/responses/NotImplemented'
43
44 nodesByCmHandleAndCpsPath:
45   get:
46     description: Query nodes for the given cps path and cm Handle
47     tags:
48       - network-cm-proxy
49     summary: Query data nodes
50     operationId: queryNodesByCmHandleAndCpsPath
51     parameters:
52       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
53       - $ref: 'components.yaml#/components/parameters/cpsPathInQuery'
54       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
55     responses:
56       200:
57         $ref: 'components.yaml#/components/responses/Ok'
58       400:
59         $ref: 'components.yaml#/components/responses/BadRequest'
60       401:
61         $ref: 'components.yaml#/components/responses/Unauthorized'
62       403:
63         $ref: 'components.yaml#/components/responses/Forbidden'
64       404:
65         $ref: 'components.yaml#/components/responses/NotFound'
66
67 nodesByCmHandleAndXpath:
68   post:
69     description: Create a node with descendants for the given CM Handle; top level or under existing node (requires xpath)
70     tags:
71       - network-cm-proxy
72     summary: Create a node with descendants
73     operationId: createNode
74     parameters:
75       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
76       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
77     requestBody:
78       required: true
79       content:
80         application/json:
81           schema:
82             type: string
83     responses:
84       201:
85         $ref: 'components.yaml#/components/responses/Created'
86       400:
87         $ref: 'components.yaml#/components/responses/BadRequest'
88       401:
89         $ref: 'components.yaml#/components/responses/Unauthorized'
90       403:
91         $ref: 'components.yaml#/components/responses/Forbidden'
92       404:
93         $ref: 'components.yaml#/components/responses/NotFound'
94
95   patch:
96     description: Update node leaves for the given cps path and cm Handle
97     tags:
98       - network-cm-proxy
99     summary: Update node leaves
100     operationId: updateNodeLeaves
101     parameters:
102       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
103       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
104     requestBody:
105       required: true
106       content:
107         application/json:
108           schema:
109             type: string
110     responses:
111       200:
112         $ref: 'components.yaml#/components/responses/Ok'
113       400:
114         $ref: 'components.yaml#/components/responses/BadRequest'
115       401:
116         $ref: 'components.yaml#/components/responses/Unauthorized'
117       403:
118         $ref: 'components.yaml#/components/responses/Forbidden'
119       404:
120         $ref: 'components.yaml#/components/responses/NotFound'
121
122   put:
123     description: Replace a node with descendants for the given cps path and cm Handle
124     tags:
125       - network-cm-proxy
126     summary: Replace a node with descendants
127     operationId: replaceNode
128     parameters:
129       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
130       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
131     requestBody:
132       required: true
133       content:
134         application/json:
135           schema:
136             type: string
137     responses:
138       200:
139         $ref: 'components.yaml#/components/responses/Ok'
140       400:
141         $ref: 'components.yaml#/components/responses/BadRequest'
142       401:
143         $ref: 'components.yaml#/components/responses/Unauthorized'
144       403:
145         $ref: 'components.yaml#/components/responses/Forbidden'
146       404:
147         $ref: 'components.yaml#/components/responses/NotFound'