blob: 32d25e39514c815d2c182a27a08e4eaa3491347e [file] [log] [blame]
tragait34a94b92021-03-30 12:02:27 +01001# ============LICENSE_START=======================================================
DylanB95EST63132ce2021-12-14 16:34:38 +00002# Copyright (C) 2021-2022 Nordix Foundation
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +03003# Modifications Copyright (C) 2021 Pantheon.tech
puthuparambil.adityad69742c2022-03-29 11:03:52 +01004# Modifications Copyright (C) 2022 Bell Canada
tragait34a94b92021-03-30 12:02:27 +01005# ================================================================================
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
lukegleeson15b93e72021-07-07 15:25:30 +010011#
tragait34a94b92021-03-30 12:02:27 +010012# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020021components:
22 schemas:
niamhcore66017b42021-10-19 11:07:02 +010023 # Common Schemas
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020024 ErrorMessage:
25 type: object
26 title: Error
27 properties:
28 status:
29 type: string
30 message:
31 type: string
32 details:
33 type: string
mpriyank93afc1e2022-03-28 15:47:47 +053034 # DMI Server Exception Schema
35 DmiErrorMessage:
36 title: DMI Error Message
37 type: object
38 properties:
39 message:
40 type: string
41 example: "Bad Gateway Error Message NCMP"
42 dmi-response:
43 type: object
44 properties:
45 http-code:
46 type: integer
47 example: 400
48 body:
49 type: string
50 example: Bad Request
niamhcore66017b42021-10-19 11:07:02 +010051 # Request Schemas
DylanB95EST4f4178c2021-07-02 13:30:42 +010052 RestDmiPluginRegistration:
53 type: object
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020054 properties:
DylanB95EST4f4178c2021-07-02 13:30:42 +010055 dmiPlugin:
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020056 type: string
emaclee844cab32021-12-01 09:42:37 +000057 example: my-dmi-plugin
DylanB95ESTd042fcd2022-02-21 12:57:08 +000058 default: ""
JosephKeenan20b4f9c2021-11-23 12:18:28 +000059 dmiDataPlugin:
60 type: string
emaclee844cab32021-12-01 09:42:37 +000061 example: my-dmi-data-plugin
DylanB95ESTd042fcd2022-02-21 12:57:08 +000062 default: ""
JosephKeenan20b4f9c2021-11-23 12:18:28 +000063 dmiModelPlugin:
64 type: string
emaclee844cab32021-12-01 09:42:37 +000065 example: my-dmi-model-plugin
DylanB95ESTd042fcd2022-02-21 12:57:08 +000066 default: ""
DylanB95EST4f4178c2021-07-02 13:30:42 +010067 createdCmHandles:
68 type: array
69 items:
DylanB95ESTe5573382022-01-27 17:12:52 +000070 $ref: '#/components/schemas/RestInputCmHandle'
DylanB95EST31facc82021-08-18 17:12:25 +010071 updatedCmHandles:
72 type: array
73 items:
DylanB95ESTe5573382022-01-27 17:12:52 +000074 $ref: '#/components/schemas/RestInputCmHandle'
Renu Kumari2c963172022-03-10 16:02:55 -050075 example:
76 cmHandle: my-cm-handle
77 cmHandleProperties:
78 add-my-property: add-property
79 update-my-property: updated-property
80 delete-my-property: '~'
81 publicCmHandleProperties:
82 add-my-property: add-property
83 update-my-property: updated-property
84 delete-my-property: '~'
DylanB95ESTe999b022021-08-24 16:56:40 +010085 removedCmHandles:
86 type: array
87 items:
88 type: string
Renu Kumari2c963172022-03-10 16:02:55 -050089 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
Renu Kumarib14f04b2022-03-28 10:22:41 -040090 DmiPluginRegistrationErrorResponse:
91 type: object
92 properties:
93 failedCreatedCmHandles:
94 type: array
95 items:
96 $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
Renu Kumarib14f04b2022-03-28 10:22:41 -040097 failedUpdatedCmHandles:
98 type: array
99 items:
100 $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
Renu Kumarib14f04b2022-03-28 10:22:41 -0400101 failedRemovedCmHandles:
102 type: array
103 items:
104 $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
Renu Kumarib14f04b2022-03-28 10:22:41 -0400105 CmHandlerRegistrationErrorResponse:
106 type: object
107 properties:
108 cmHandle:
109 type: string
110 example: my-cm-handle
111 errorCode:
112 type: string
Renu Kumari952603c2022-04-18 12:39:33 -0400113 example: '00'
Renu Kumarib14f04b2022-03-28 10:22:41 -0400114 errorText:
115 type: string
Renu Kumari952603c2022-04-18 12:39:33 -0400116 example: 'Unknown error. <error-details>'
DylanB95EST4f4178c2021-07-02 13:30:42 +0100117
DylanB95ESTe5573382022-01-27 17:12:52 +0000118 RestInputCmHandle:
DylanB95EST4f4178c2021-07-02 13:30:42 +0100119 required:
120 - cmHandle
121 type: object
122 properties:
123 cmHandle:
124 type: string
emaclee844cab32021-12-01 09:42:37 +0000125 example: my-cm-handle
DylanB95EST4f4178c2021-07-02 13:30:42 +0100126 cmHandleProperties:
DylanB95EST63132ce2021-12-14 16:34:38 +0000127 $ref: '#/components/schemas/RestCmHandleProperties'
128 publicCmHandleProperties:
129 $ref: '#/components/schemas/RestCmHandleProperties'
130 RestCmHandleProperties:
DylanB95EST4f4178c2021-07-02 13:30:42 +0100131 type: object
132 additionalProperties:
133 type: string
DylanB95EST63132ce2021-12-14 16:34:38 +0000134 example: my-property
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200135
niamhcore66017b42021-10-19 11:07:02 +0100136 Conditions:
137 type: object
138 properties:
139 conditions:
140 $ref: '#/components/schemas/ConditionsData'
141 ConditionsData:
142 type: array
143 items:
144 type: object
145 $ref: '#/components/schemas/ConditionProperties'
146 ConditionProperties:
147 properties:
148 name:
149 type: string
150 example: hasAllModules
151 conditionParameters:
niamhcoreb0d93072021-10-28 13:39:24 +0100152 $ref: '#/components/schemas/ModuleNamesAsJsonArray'
153 ModuleNamesAsJsonArray:
niamhcore66017b42021-10-19 11:07:02 +0100154 type: array
155 items:
156 type: object
niamhcoreb0d93072021-10-28 13:39:24 +0100157 $ref: '#/components/schemas/ModuleNameAsJsonObject'
emaclee844cab32021-12-01 09:42:37 +0000158 example: [my-module-1, my-module-2, my-module-3]
niamhcoreb0d93072021-10-28 13:39:24 +0100159 ModuleNameAsJsonObject:
niamhcore66017b42021-10-19 11:07:02 +0100160 properties:
161 moduleName:
162 type: string
emaclee844cab32021-12-01 09:42:37 +0000163 example: my-module
niamhcore66017b42021-10-19 11:07:02 +0100164
165 #Response Schemas
166 CmHandles:
167 type: object
168 properties:
169 cmHandles:
170 $ref: '#/components/schemas/CmHandleProperties'
171 CmHandleProperties:
172 type: array
173 items:
174 type: object
175 $ref: '#/components/schemas/CmHandleProperty'
176 CmHandleProperty:
177 properties:
178 cmHandleId:
179 type: string
emaclee844cab32021-12-01 09:42:37 +0000180 example: my-cm-handle-id
181
lukegleesond5bda882022-03-02 14:32:47 +0000182 RestModuleReference:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000183 type: object
184 title: Module reference details
185 properties:
186 moduleName:
187 type: string
188 example: my-module-name
189 revision:
190 type: string
191 example: my-module-revision
192
JosephKeenandeac4772022-03-28 12:26:07 +0100193 CmHandleQueryRestParameters:
194 type: object
195 title: Cm Handle query parameters for executing cm handle search
196 properties:
197 publicCmHandleProperties:
198 type: object
199 additionalProperties:
200 type: string
201 example: Book Type
202
DylanB95ESTe5573382022-01-27 17:12:52 +0000203 RestOutputCmHandle:
204 type: object
205 title: CM handle Details
206 properties:
207 cmHandle:
208 type: string
209 example: my-cm-handle1
210 publicCmHandleProperties:
211 $ref: '#/components/schemas/CmHandlePublicProperties'
212 CmHandlePublicProperties:
213 type: array
214 items:
215 type: object
216 additionalProperties:
217 type: string
218 example: Book Type
219
lukegleesonbed18fd2022-05-06 12:02:42 +0100220 RestOutputCmHandlePublicProperties:
221 type: object
222 properties:
223 publicCmHandleProperties:
224 $ref: '#/components/schemas/CmHandlePublicProperties'
225
emaclee844cab32021-12-01 09:42:37 +0000226 examples:
227 dataSampleRequest:
228 summary: Sample request
229 description: Sample request body
230 value:
231 test:bookstore:
232 bookstore-name: Chapters
233 categories:
234 - code: '01'
235 name: SciFi
236 books:
237 - authors:
238 - Iain M. Banks
emaclee844cab32021-12-01 09:42:37 +0000239 - Ursula K. Le Guin
240 - code: '02'
241 name: kids
242 books:
243 - authors:
244 - Philip Pullman
245
tragaitecd7f5e2022-01-13 13:15:14 +0000246 dataSamplePatchRequest:
247 summary: Sample patch request
248 description: Sample patch request body
249 value:
250 ietf-restconf:yang-patch:
251 patch-id: patch-1
252 edit:
253 - edit-id: edit1
254 operation: merge
255 target: /
256 value:
257 test:bookstore:
258 bookstore-name: Chapters
259 categories:
260 - code: '01'
261 name: Science
262 books:
263 - authors:
264 - Author1
265 - Author2
266 - code: '02'
267 name: Arts
268 books:
269 - authors:
270 - Author3
271 - edit-id: edit2
272 operation: merge
273 target: /
274 value:
275 test:bookstore:
276 bookstore-name: Novels
277 categories:
278 - code: '03'
279 name: History
280 books:
281 - authors:
282 - Iain M. Banks
283 - Ursula K. Le Guin
284 - code: '04'
285 name: Fiction
286 books:
287 - authors:
288 - Philip Pullman
289
emaclee844cab32021-12-01 09:42:37 +0000290 dataSampleResponse:
291 summary: Sample response
292 description: Sample response for selecting 'sample 1'.
293 value:
294 bookstore:
295 categories:
296 - code: '01'
297 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000298 - authors:
299 - Iain M. Banks
300 - Ursula K. Le Guin
emaclee844cab32021-12-01 09:42:37 +0000301 name: SciFi
302 - code: '02'
303 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000304 - authors:
305 - Philip Pullman
emaclee844cab32021-12-01 09:42:37 +0000306 name: kids
niamhcore66017b42021-10-19 11:07:02 +0100307
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200308 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100309 cmHandleInPath:
310 name: cm-handle
311 in: path
tragait34a94b92021-03-30 12:02:27 +0100312 description: The identifier for a network function, network element, subnetwork or any other cm object by managed Network CM Proxy
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100313 required: true
314 schema:
315 type: string
emaclee844cab32021-12-01 09:42:37 +0000316 example: my-cm-handle
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100317 xpathInQuery:
318 name: xpath
319 in: query
320 description: xpath
321 required: false
322 schema:
323 type: string
324 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300325 requiredXpathInQuery:
326 name: xpath
327 in: query
328 description: xpath
329 required: true
330 schema:
331 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100332 includeDescendantsOptionInQuery:
333 name: include-descendants
334 in: query
335 description: include-descendants
336 required: false
337 schema:
338 type: boolean
339 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000340 cpsPathInQuery:
341 name: cps-path
342 in: query
343 description: cps-path
344 required: false
345 schema:
346 type: string
347 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100348 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100349 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100350 in: query
351 description: The format of resource identifier depend on the associated DMI Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but it can really be anything.
tragaitc3285512021-08-16 15:12:36 +0100352 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100353 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100354 schema:
355 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100356 examples:
emaclee844cab32021-12-01 09:42:37 +0000357 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100358 value:
emaclee844cab32021-12-01 09:42:37 +0000359 resourceIdentifier: \shops\bookstore
360 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100361 value:
emaclee844cab32021-12-01 09:42:37 +0000362 resourceIdentifier: \shops\bookstore\categories[@code=1]
363 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100364 value:
emaclee844cab32021-12-01 09:42:37 +0000365 resourceIdentifier: parent=shops,child=bookstore
tragaitabdff1b2021-10-06 11:04:18 +0100366 optionsParamInQuery:
367 name: options
tragaitc3285512021-08-16 15:12:36 +0100368 in: query
emaclee844cab32021-12-01 09:42:37 +0000369 description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'. The format of options parameter depend on the associated DMI Plugin implementation.
tragaitc3285512021-08-16 15:12:36 +0100370 required: false
371 schema:
372 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100373 allowReserved: true
374 examples:
emaclee844cab32021-12-01 09:42:37 +0000375 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100376 value:
emaclee844cab32021-12-01 09:42:37 +0000377 options: (depth=3)
378 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100379 value:
emaclee844cab32021-12-01 09:42:37 +0000380 options: (fields=book)
381 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100382 value:
emaclee844cab32021-12-01 09:42:37 +0000383 options: (depth=2,fields=book/authors)
sourabh_sourabh1f2e66e2022-02-16 21:53:41 +0530384 topicParamInQuery:
385 name: topic
386 in: query
387 description: topic parameter in query.
388 required: false
389 schema:
390 type: string
391 allowReserved: true
392 examples:
393 sample 1:
394 value:
395 topic: my-topic-name
tragaitc584bf22021-08-20 15:45:58 +0100396 contentParamInHeader:
397 name: Content-Type
398 in: header
399 required: false
400 description: Content parameter for request, if content parameter is null, default value is application/json.
401 schema:
402 type: string
403 default: application/json
emaclee844cab32021-12-01 09:42:37 +0000404 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200405
406 responses:
407 NotFound:
408 description: The specified resource was not found
409 content:
410 application/json:
411 schema:
412 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000413 example:
414 status: 400
415 message: Not found error message
416 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200417 Unauthorized:
418 description: Unauthorized
419 content:
420 application/json:
421 schema:
422 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000423 example:
424 status: 401
425 message: Unauthorized error message
426 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200427 Forbidden:
428 description: Forbidden
429 content:
430 application/json:
431 schema:
432 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000433 example:
434 status: 403
435 message: Forbidden error message
436 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200437 BadRequest:
438 description: Bad Request
439 content:
440 application/json:
441 schema:
442 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000443 example:
444 status: 400 BAD_REQUEST
445 message: Bad request error message
446 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200447 Conflict:
448 description: Conflict
449 content:
450 application/json:
451 schema:
452 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000453 example:
454 status: 409 CONFLICT
455 message: Conflict error message
456 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100457 NotImplemented:
458 description: The given path has not been implemented
459 content:
460 application/json:
461 schema:
462 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000463 example:
464 status: 501
465 message: Not implemented error message
466 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200467 Ok:
468 description: OK
469 content:
470 application/json:
471 schema:
472 type: object
473 Created:
474 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100475 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200476 NoContent:
477 description: No Content
478 content: {}
JosephKeenane0873dd2022-01-28 11:22:22 +0000479 InternalServerError:
480 description: Internal Server Error
481 content:
482 application/json:
483 schema:
484 $ref: "#/components/schemas/ErrorMessage"
485 example:
486 status: 500
487 message: Internal Server Error
488 details: Internal Server Error occurred
mpriyank93afc1e2022-03-28 15:47:47 +0530489 BadGateway:
490 description: Bad Gateway
491 content:
492 application/json:
493 schema:
494 $ref: "#/components/schemas/DmiErrorMessage"
495 example:
496 message: "Bad Gateway Error Message NCMP"
497 dmi-response:
498 http-code: 400
499 body: "Bad Request"