CPS-2187 - #5 Add module Set Tag to dmi (single cm handle) data request
[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         moduleSetTag:
50           type: string
51         cmHandleProperties:
52           $ref: '#/components/schemas/cmHandleProperties'
53
54     ResourceDataOperationRequests:
55       type: array
56       items:
57         type: object
58         title: 'DataOperationRequest'
59         properties:
60           operation:
61             type: string
62             example: 'read'
63           operationId:
64             description: 'it is recommended that the operationId is unique within the scope of the request'
65             type: string
66             example: '12'
67           datastore:
68             type: string
69             example: 'ncmp-datastore:passthrough-operational'
70           options:
71             type: string
72             example: 'some option'
73           resourceIdentifier:
74             type: string
75             example: 'some resource identifier'
76           cmHandles:
77             type: array
78             items:
79               $ref: '#/components/schemas/cmHandle'
80         required:
81           - operation
82           - operationId
83           - datastore
84           - cmHandles
85
86     cmHandle:
87       type: object
88       title: 'cmHandle'
89       properties:
90         id:
91           type: string
92         cmHandleProperties:
93           additionalProperties:
94             type: string
95       example:
96         id: cmHandle123
97         cmHandleProperties:
98           myProp: some value
99           otherProp: other value
100
101     ModuleResourcesReadRequest:
102       type: object
103       properties:
104         moduleSetTag:
105           type: string
106           description: Module set tag of the given cm handle
107           example: Module-set-tag-1
108           required: false
109         data:
110           type: object
111           properties:
112             modules:
113               type: array
114               items:
115                 type: object
116                 properties:
117                   name:
118                     type: string
119                     example: my-name
120                   revision:
121                     type: string
122                     example: my-revision
123         cmHandleProperties:
124           $ref: '#/components/schemas/cmHandleProperties'
125
126     ModuleSet:
127       type: object
128       properties:
129         schemas:
130           type: array
131           items:
132             type: object
133             properties:
134               moduleName:
135                 type: string
136                 example: my-module-name
137               revision:
138                 type: string
139                 example: my-revision
140               namespace:
141                 type: string
142                 example: my-namespace
143
144     YangResources:
145       type: array
146       items:
147         $ref: '#/components/schemas/YangResource'
148
149     YangResource:
150       properties:
151         yangSource:
152           type: string
153           example: my-yang-source
154         moduleName:
155           type: string
156           example: my-module-name
157         revision:
158           type: string
159           example: my-revision
160
161     DataAccessRequest:
162       type: object
163       properties:
164         operation:
165           type: string
166           enum: [ read, create, update, patch, delete ]
167           example: read
168         dataType:
169           type: string
170           example: my-data-type
171         data:
172           type: string
173           example: my-data
174         cmHandleProperties:
175           $ref: '#/components/schemas/cmHandleProperties'
176         requestId:
177           type: string
178           example: 3a9ce55c-e365-4dc9-8da3-a06f07cbc6d7
179
180     cmHandleProperties:
181       type: object
182       nullable: true
183       additionalProperties:
184         type: string
185         example: {"prop1":"value1","prop2":"value2"}
186
187   responses:
188     NoContent:
189       description: No Content
190       content: {}
191
192     BadRequest:
193       description: Bad Request
194       content:
195         application/json:
196           schema:
197             $ref: '#/components/schemas/ErrorMessage'
198           example:
199             status: 400
200             message: Bad Request
201             details: The provided request is not valid
202
203     NotFound:
204       description: The specified resource was not found
205       content:
206         application/json:
207           schema:
208             $ref: '#/components/schemas/ErrorMessage'
209           example:
210             status: 404
211             message: Resource Not Found
212             details: The requested resource is not found
213
214     ServerError:
215       description: Internal Server Error
216       content:
217         application/json:
218           schema:
219             $ref: '#/components/schemas/ErrorMessage'
220           example:
221             status: 500
222             message: Internal Server Error
223             details: Internal Server Error occured
224
225     NotImplemented:
226       description: Not Implemented
227       content:
228         application/json:
229           schema:
230             $ref: '#/components/schemas/ErrorMessage'
231           example:
232             status: 501
233             message: Not Implemented
234             details: Method Not Implemented
235
236   parameters:
237     cmHandleInPath:
238       name: cmHandle
239       in: path
240       description: The identifier for a network function, network element, subnetwork, or any other cm object by managed Network CM Proxy
241       required: true
242       schema:
243         type: string
244         example: my-cm-handle
245
246     resourceIdentifierInQuery:
247       name: resourceIdentifier
248       in: query
249       description: Resource identifier to get/set the resource data
250       required: true
251       allowReserved: true
252       schema:
253         type: string
254         example: my-schema:my-node
255
256     optionsParamInQuery:
257       name: options
258       in: query
259       description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'.
260       required: false
261       schema:
262         type: string
263       allowReserved: true
264       examples:
265         sample1:
266           value:
267             options: (key1=value1,key2=value2)
268         sample2:
269           value:
270             options: (key1=value1,key2=value1/value2)
271         sample3:
272           value:
273             options: (key1=10,key2=value2,key3=val31,val32)
274
275     topicParamInQuery:
276       name: topic
277       in: query
278       description: topic name passed from client(NCMP).
279       required: false
280       schema:
281         type: string
282       allowReserved: true
283       examples:
284         sample1:
285           value: my-topic-name
286
287     requiredTopicParamInQuery:
288       name: topic
289       in: query
290       description: mandatory topic name passed from client(NCMP).
291       required: true
292       schema:
293         type: string
294       allowReserved: true
295       examples:
296         sample1:
297           value:
298             topic: my-topic-name
299
300     moduleSetTagParamInQuery:
301       name: moduleSetTag
302       in: query
303       description: Module set tag of the given cm handle.
304       required: false
305       schema:
306         type: string
307       examples:
308         sample1:
309           value: tag1
310
311     requiredRequestIdParamInQuery:
312       name: requestId
313       in: query
314       description: request Id generated by NCMP and sent as an acknowledgement for the client request the same including here.
315       required: true
316       schema:
317         type: string
318       allowReserved: true
319       examples:
320         sample1:
321           value: 4753fc1f-7de2-449a-b306-a6204b5370b3
322
323     datastoreName:
324       name: datastore-name
325       in: path
326       description: The type of the requested data
327       required: true
328       schema:
329         type: string
330         example: ncmp-datastore:passthrough-operational or ncmp-datastore:passthrough-running
331
332 security:
333   - basicAuth: []