Merge "Align dependencies with CPS/NCMP"
[cps/ncmp-dmi-plugin.git] / openapi / components.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021-2023 Nordix Foundation
3 #  Modifications Copyright (C) 2022 Bell Canada
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 components:
21   securitySchemes:
22     basicAuth:
23       type: http
24       scheme: basic
25   schemas:
26     ErrorMessage:
27       type: object
28       title: Error
29       properties:
30         status:
31           type: string
32         message:
33           type: string
34         details:
35           type: string
36
37     CmHandles:
38       type: object
39       properties:
40         cmHandles:
41           type: array
42           example: ["cmHandleId1","cmHandleId2","cmHandleId3"]
43           items:
44             type: string
45
46     ModuleReferencesRequest:
47       type: object
48       properties:
49         cmHandleProperties:
50           $ref: '#/components/schemas/cmHandleProperties'
51
52     ModuleResourcesReadRequest:
53       type: object
54       properties:
55         data:
56           type: object
57           properties:
58             modules:
59               type: array
60               items:
61                 type: object
62                 properties:
63                   name:
64                     type: string
65                     example: my-name
66                   revision:
67                     type: string
68                     example: my-revision
69         cmHandleProperties:
70           $ref: '#/components/schemas/cmHandleProperties'
71
72     ModuleSet:
73       type: object
74       properties:
75         schemas:
76           type: array
77           items:
78             type: object
79             properties:
80               moduleName:
81                 type: string
82                 example: my-module-name
83               revision:
84                 type: string
85                 example: my-revision
86               namespace:
87                 type: string
88                 example: my-namespace
89
90     YangResources:
91       type: array
92       items:
93         type: object
94         $ref: '#/components/schemas/YangResource'
95
96     YangResource:
97       properties:
98         yangSource:
99           type: string
100           example: my-yang-source
101         moduleName:
102           type: string
103           example: my-module-name
104         revision:
105           type: string
106           example: my-revision
107
108     DataAccessRequest:
109       type: object
110       properties:
111         operation:
112           type: string
113           enum: [ read, create, update, patch, delete ]
114           example: read
115         dataType:
116           type: string
117           example: my-data-type
118         data:
119           type: string
120           example: my-data
121         cmHandleProperties:
122           $ref: '#/components/schemas/cmHandleProperties'
123         requestId:
124           type: string
125           example: 3a9ce55c-e365-4dc9-8da3-a06f07cbc6d7
126
127     cmHandleProperties:
128       type: object
129       additionalProperties:
130         type: string
131         example: {"prop1":"value1","prop2":"value2"}
132
133   responses:
134     NoContent:
135       description: No Content
136       content: {}
137     BadRequest:
138       description: Bad Request
139       content:
140         application/json:
141           schema:
142             $ref: '#/components/schemas/ErrorMessage'
143           example:
144             status: 400
145             message: Bad Request
146             details: The provided request is not valid
147     NotFound:
148       description: The specified resource was not found
149       content:
150         application/json:
151           schema:
152             $ref: '#/components/schemas/ErrorMessage'
153           example:
154             status: 404
155             message: Resource Not Found
156             details: The requested resource is not found
157     ServerError:
158       description: Internal Server Error
159       content:
160         application/json:
161           schema:
162             $ref: '#/components/schemas/ErrorMessage'
163           example:
164             status: 500
165             message: Internal Server Error
166             details: Internal Server Error occured
167     NotImplemented:
168       description: Not Implemented
169       content:
170         application/json:
171           schema:
172             $ref: '#/components/schemas/ErrorMessage'
173           example:
174             status: 501
175             message: Not Implemented
176             details: Method Not Implemented
177   parameters:
178     cmHandleInPath:
179       name: cmHandle
180       in: path
181       description: The identifier for a network function, network element, subnetwork, or any other cm object by managed Network CM Proxy
182       required: true
183       schema:
184         type: string
185         example: my-cm-handle
186
187     resourceIdentifierInQuery:
188       name: resourceIdentifier
189       in: query
190       description: Resource identifier to get/set the resource data
191       required: true
192       allowReserved: true
193       schema:
194         type: string
195         example: my-schema:my-node
196
197     optionsParamInQuery:
198       name: options
199       in: query
200       description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'.
201       required: false
202       schema:
203         type: string
204       allowReserved: true
205       examples:
206         sample1:
207           value:
208             options: (key1=value1,key2=value2)
209         sample2:
210           value:
211             options: (key1=value1,key2=value1/value2)
212         sample3:
213           value:
214             options: (key1=10,key2=value2,key3=val31,val32)
215     topicParamInQuery:
216       name: topic
217       in: query
218       description: topic name passed from client(NCMP).
219       required: false
220       schema:
221         type: string
222       allowReserved: true
223       examples:
224         sample1:
225           value: my-topic-name
226     datastoreName:
227       name: datastore-name
228       in: path
229       description: The type of the requested data
230       required: true
231       schema:
232         type: string
233         example: ncmp-datastore:passthrough-operational or ncmp-datastore:passthrough-running
234
235 security:
236   - basicAuth: []