d5358cc5d45943642691257f8af1fa467a93940c
[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
42 nodesByCmHandleAndCpsPath:
43   get:
44     description: Query nodes for the given cps path and cm Handle
45     tags:
46       - network-cm-proxy
47     summary: Query data nodes
48     operationId: queryNodesByCmHandleAndCpsPath
49     parameters:
50       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
51       - $ref: 'components.yaml#/components/parameters/cpsPathInQuery'
52       - $ref: 'components.yaml#/components/parameters/includeDescendantsOptionInQuery'
53     responses:
54       200:
55         $ref: 'components.yaml#/components/responses/Ok'
56       400:
57         $ref: 'components.yaml#/components/responses/BadRequest'
58       401:
59         $ref: 'components.yaml#/components/responses/Unauthorized'
60       403:
61         $ref: 'components.yaml#/components/responses/Forbidden'
62       404:
63         $ref: 'components.yaml#/components/responses/NotFound'
64
65 nodesByCmHandleAndXpath:
66   post:
67     description: Create a node with descendants for the given CM Handle; top level or under existing node (requires xpath)
68     tags:
69       - network-cm-proxy
70     summary: Create a node with descendants
71     operationId: createNode
72     parameters:
73       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
74       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
75     requestBody:
76       required: true
77       content:
78         application/json:
79           schema:
80             type: string
81     responses:
82       201:
83         $ref: 'components.yaml#/components/responses/Created'
84       400:
85         $ref: 'components.yaml#/components/responses/BadRequest'
86       401:
87         $ref: 'components.yaml#/components/responses/Unauthorized'
88       403:
89         $ref: 'components.yaml#/components/responses/Forbidden'
90       404:
91         $ref: 'components.yaml#/components/responses/NotFound'
92
93   patch:
94     description: Update node leaves for the given cps path and cm Handle
95     tags:
96       - network-cm-proxy
97     summary: Update node leaves
98     operationId: updateNodeLeaves
99     parameters:
100       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
101       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
102     requestBody:
103       required: true
104       content:
105         application/json:
106           schema:
107             type: string
108     responses:
109       200:
110         $ref: 'components.yaml#/components/responses/Ok'
111       400:
112         $ref: 'components.yaml#/components/responses/BadRequest'
113       401:
114         $ref: 'components.yaml#/components/responses/Unauthorized'
115       403:
116         $ref: 'components.yaml#/components/responses/Forbidden'
117       404:
118         $ref: 'components.yaml#/components/responses/NotFound'
119
120   put:
121     description: Replace a node with descendants for the given cps path and cm Handle
122     tags:
123       - network-cm-proxy
124     summary: Replace a node with descendants
125     operationId: replaceNode
126     parameters:
127       - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
128       - $ref: 'components.yaml#/components/parameters/xpathInQuery'
129     requestBody:
130       required: true
131       content:
132         application/json:
133           schema:
134             type: string
135     responses:
136       200:
137         $ref: 'components.yaml#/components/responses/Ok'
138       400:
139         $ref: 'components.yaml#/components/responses/BadRequest'
140       401:
141         $ref: 'components.yaml#/components/responses/Unauthorized'
142       403:
143         $ref: 'components.yaml#/components/responses/Forbidden'
144       404:
145         $ref: 'components.yaml#/components/responses/NotFound'