blob: c1e05876cafb4dab5403b099d5d69715811b036d [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 #Response Schemas
lukegleesond5bda882022-03-02 14:32:47 +0000137 RestModuleReference:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000138 type: object
139 title: Module reference details
140 properties:
141 moduleName:
142 type: string
143 example: my-module-name
144 revision:
145 type: string
146 example: my-module-revision
147
emacleee1f73e22022-06-17 17:42:56 +0100148 RestModuleDefinition:
149 type: object
150 title: Module definitions
151 properties:
152 moduleName:
153 type: string
154 example: my-module-name
155 revision:
156 type: string
157 example: 2020-09-15
158 content:
159 type: string
160 example: |
161 module stores {
162 yang-version 1.1;
163 namespace "org:onap:ccsdk:sample";
164 prefix book-store;
165 revision "2020-09-15" {
166 description
167 "Sample Model";
168 }
169 }
170
171
kissande9ed5812022-05-12 15:59:18 +0200172 CmHandleQueryParameters:
JosephKeenandeac4772022-03-28 12:26:07 +0100173 type: object
174 title: Cm Handle query parameters for executing cm handle search
175 properties:
kissande9ed5812022-05-12 15:59:18 +0200176 cmHandleQueryParameters:
177 type: array
178 items:
179 type: object
180 $ref: '#/components/schemas/ConditionProperties'
181 conditions:
182 deprecated: true
183 type: array
184 items:
185 type: object
186 $ref: '#/components/schemas/OldConditionProperties'
187 description: not necessary, it is just for backward compatibility
lukegleeson82a550f2022-07-11 10:55:53 +0100188
kissande9ed5812022-05-12 15:59:18 +0200189 ConditionProperties:
190 properties:
191 conditionName:
192 type: string
193 conditionParameters:
194 type: array
195 items:
196 type: object
197 additionalProperties:
198 type: string
199 OldConditionProperties:
200 deprecated: true
201 properties:
202 name:
203 type: string
204 conditionParameters:
205 type: array
206 items:
207 type: object
208 $ref: '#/components/schemas/ModuleNameAsJsonObject'
209 ModuleNameAsJsonObject:
210 properties:
211 moduleName:
212 type: string
213 example: my-module
JosephKeenandeac4772022-03-28 12:26:07 +0100214
DylanB95ESTe5573382022-01-27 17:12:52 +0000215 RestOutputCmHandle:
216 type: object
217 title: CM handle Details
218 properties:
219 cmHandle:
220 type: string
221 example: my-cm-handle1
222 publicCmHandleProperties:
223 $ref: '#/components/schemas/CmHandlePublicProperties'
mpriyank4cf49622022-05-20 15:25:15 +0100224 state:
lukegleeson78062a12022-06-02 10:56:43 +0100225 $ref: '#/components/schemas/CmHandleCompositeState'
DylanB95ESTe5573382022-01-27 17:12:52 +0000226 CmHandlePublicProperties:
227 type: array
228 items:
229 type: object
230 additionalProperties:
231 type: string
232 example: Book Type
lukegleeson78062a12022-06-02 10:56:43 +0100233 CmHandleCompositeState:
mpriyank4cf49622022-05-20 15:25:15 +0100234 type: object
235 properties:
236 cmHandleState:
237 type: string
238 example: ADVISED
239 lockReason:
240 $ref: '#/components/schemas/lock-reason'
241 lastUpdateTime:
242 type: string
243 example: 2022-12-31T20:30:40.000+0000
244 dataSyncEnabled:
245 type: boolean
246 example: false
247 dataSyncState:
248 $ref: '#/components/schemas/dataStores'
249
250 lock-reason:
251 type: object
252 properties:
253 reason:
254 type: string
lukegleeson4e596842022-06-28 12:15:33 +0100255 example: LOCKED_MISBEHAVING
mpriyank4cf49622022-05-20 15:25:15 +0100256 details:
257 type: string
lukegleeson4e596842022-06-28 12:15:33 +0100258 example: locked due to failure in module sync
mpriyank4cf49622022-05-20 15:25:15 +0100259
260 dataStores:
261 type: object
262 properties:
263 operational:
264 $ref: '#/components/schemas/sync-state'
265 running:
266 $ref: '#/components/schemas/sync-state'
267
268 sync-state:
269 type: object
270 properties:
lukegleeson82a550f2022-07-11 10:55:53 +0100271 syncState:
mpriyank4cf49622022-05-20 15:25:15 +0100272 type: string
273 example: NONE_REQUESTED
274 lastSyncTime:
275 type: string
276 example: 2022-12-31T20:30:40.000+0000
DylanB95ESTe5573382022-01-27 17:12:52 +0000277
lukegleesonbed18fd2022-05-06 12:02:42 +0100278 RestOutputCmHandlePublicProperties:
279 type: object
280 properties:
281 publicCmHandleProperties:
282 $ref: '#/components/schemas/CmHandlePublicProperties'
283
lukegleeson78062a12022-06-02 10:56:43 +0100284 RestOutputCmHandleCompositeState:
285 type: object
286 properties:
287 state:
288 $ref: '#/components/schemas/CmHandleCompositeState'
289
emaclee844cab32021-12-01 09:42:37 +0000290 examples:
291 dataSampleRequest:
292 summary: Sample request
293 description: Sample request body
294 value:
295 test:bookstore:
296 bookstore-name: Chapters
297 categories:
298 - code: '01'
299 name: SciFi
300 books:
301 - authors:
302 - Iain M. Banks
emaclee844cab32021-12-01 09:42:37 +0000303 - Ursula K. Le Guin
304 - code: '02'
305 name: kids
306 books:
307 - authors:
308 - Philip Pullman
309
tragaitecd7f5e2022-01-13 13:15:14 +0000310 dataSamplePatchRequest:
311 summary: Sample patch request
312 description: Sample patch request body
313 value:
314 ietf-restconf:yang-patch:
315 patch-id: patch-1
316 edit:
317 - edit-id: edit1
318 operation: merge
319 target: /
320 value:
321 test:bookstore:
322 bookstore-name: Chapters
323 categories:
324 - code: '01'
325 name: Science
326 books:
327 - authors:
328 - Author1
329 - Author2
330 - code: '02'
331 name: Arts
332 books:
333 - authors:
334 - Author3
335 - edit-id: edit2
336 operation: merge
337 target: /
338 value:
339 test:bookstore:
340 bookstore-name: Novels
341 categories:
342 - code: '03'
343 name: History
344 books:
345 - authors:
346 - Iain M. Banks
347 - Ursula K. Le Guin
348 - code: '04'
349 name: Fiction
350 books:
351 - authors:
352 - Philip Pullman
353
emaclee844cab32021-12-01 09:42:37 +0000354 dataSampleResponse:
355 summary: Sample response
356 description: Sample response for selecting 'sample 1'.
357 value:
358 bookstore:
359 categories:
360 - code: '01'
361 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000362 - authors:
363 - Iain M. Banks
364 - Ursula K. Le Guin
emaclee844cab32021-12-01 09:42:37 +0000365 name: SciFi
366 - code: '02'
367 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000368 - authors:
369 - Philip Pullman
emaclee844cab32021-12-01 09:42:37 +0000370 name: kids
niamhcore66017b42021-10-19 11:07:02 +0100371
lukegleeson82a550f2022-07-11 10:55:53 +0100372 allCmHandleQueryParameters:
373 value:
374 cmHandleQueryParameters:
375 - conditionName: hasAllModules
376 conditionParameters:
377 - { "moduleName": "my-module-1" }
378 - { "moduleName": "my-module-2" }
379 - { "moduleName": "my-module-3" }
380 - conditionName: hasAllProperties
381 conditionParameters:
382 - { "Color": "yellow" }
383 - { "Shape": "circle" }
384 - { "Size": "small" }
385 - conditionName: cmHandleWithCpsPath
386 conditionParameters:
387 - { "cpsPath": "//state[@cm-handle-state='ADVISED']" }
388 pubPropCmHandleQueryParameters:
389 value:
390 cmHandleQueryParameters:
391 - conditionName: hasAllProperties
392 conditionParameters:
393 - { "Color": "yellow" }
394 - { "Shape": "circle" }
395 - { "Size": "small" }
396 modulesCmHandleQueryParameters:
397 value:
398 cmHandleQueryParameters:
399 - conditionName: hasAllModules
400 conditionParameters:
401 - { "moduleName": "my-module-1" }
402 - { "moduleName": "my-module-2" }
403 - { "moduleName": "my-module-3" }
404 cpsPathCmHandleStateQueryParameters:
405 value:
406 cmHandleQueryParameters:
407 - conditionName: cmHandleWithCpsPath
408 conditionParameters:
409 - { "cpsPath": "//state[@cm-handle-state='LOCKED']" }
410 cpsPathCmHandleDataSyncQueryParameters:
411 value:
412 cmHandleQueryParameters:
413 - conditionName: cmHandleWithCpsPath
414 conditionParameters:
415 - { "cpsPath": "//state[@data-sync-enabled='true']" }
416
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200417 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100418 cmHandleInPath:
419 name: cm-handle
420 in: path
tragait34a94b92021-03-30 12:02:27 +0100421 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 +0100422 required: true
423 schema:
424 type: string
emaclee844cab32021-12-01 09:42:37 +0000425 example: my-cm-handle
DylanB95EST6ddbe4a2022-07-19 11:36:10 +0100426 dataSyncEnabled:
427 name: dataSyncEnabled
428 in: query
429 description: Is used to enable or disable the data synchronization flag
430 required: true
431 schema:
432 type: boolean
433 example: true
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100434 xpathInQuery:
435 name: xpath
436 in: query
437 description: xpath
438 required: false
439 schema:
440 type: string
441 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300442 requiredXpathInQuery:
443 name: xpath
444 in: query
445 description: xpath
446 required: true
447 schema:
448 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100449 includeDescendantsOptionInQuery:
450 name: include-descendants
451 in: query
452 description: include-descendants
453 required: false
454 schema:
455 type: boolean
456 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000457 cpsPathInQuery:
458 name: cps-path
459 in: query
460 description: cps-path
461 required: false
462 schema:
463 type: string
464 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100465 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100466 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100467 in: query
468 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 +0100469 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100470 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100471 schema:
472 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100473 examples:
emaclee844cab32021-12-01 09:42:37 +0000474 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100475 value:
emaclee844cab32021-12-01 09:42:37 +0000476 resourceIdentifier: \shops\bookstore
477 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100478 value:
emaclee844cab32021-12-01 09:42:37 +0000479 resourceIdentifier: \shops\bookstore\categories[@code=1]
480 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100481 value:
emaclee844cab32021-12-01 09:42:37 +0000482 resourceIdentifier: parent=shops,child=bookstore
tragaitabdff1b2021-10-06 11:04:18 +0100483 optionsParamInQuery:
484 name: options
tragaitc3285512021-08-16 15:12:36 +0100485 in: query
emaclee844cab32021-12-01 09:42:37 +0000486 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 +0100487 required: false
488 schema:
489 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100490 allowReserved: true
491 examples:
emaclee844cab32021-12-01 09:42:37 +0000492 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100493 value:
emaclee844cab32021-12-01 09:42:37 +0000494 options: (depth=3)
495 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100496 value:
emaclee844cab32021-12-01 09:42:37 +0000497 options: (fields=book)
498 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100499 value:
emaclee844cab32021-12-01 09:42:37 +0000500 options: (depth=2,fields=book/authors)
sourabh_sourabh1f2e66e2022-02-16 21:53:41 +0530501 topicParamInQuery:
502 name: topic
503 in: query
504 description: topic parameter in query.
505 required: false
506 schema:
507 type: string
508 allowReserved: true
509 examples:
510 sample 1:
511 value:
512 topic: my-topic-name
tragaitc584bf22021-08-20 15:45:58 +0100513 contentParamInHeader:
514 name: Content-Type
515 in: header
516 required: false
517 description: Content parameter for request, if content parameter is null, default value is application/json.
518 schema:
519 type: string
520 default: application/json
emaclee844cab32021-12-01 09:42:37 +0000521 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200522
523 responses:
524 NotFound:
525 description: The specified resource was not found
526 content:
527 application/json:
528 schema:
529 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000530 example:
531 status: 400
532 message: Not found error message
533 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200534 Unauthorized:
535 description: Unauthorized
536 content:
537 application/json:
538 schema:
539 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000540 example:
541 status: 401
542 message: Unauthorized error message
543 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200544 Forbidden:
545 description: Forbidden
546 content:
547 application/json:
548 schema:
549 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000550 example:
551 status: 403
552 message: Forbidden error message
553 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200554 BadRequest:
555 description: Bad Request
556 content:
557 application/json:
558 schema:
559 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000560 example:
561 status: 400 BAD_REQUEST
562 message: Bad request error message
563 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200564 Conflict:
565 description: Conflict
566 content:
567 application/json:
568 schema:
569 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000570 example:
571 status: 409 CONFLICT
572 message: Conflict error message
573 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100574 NotImplemented:
575 description: The given path has not been implemented
576 content:
577 application/json:
578 schema:
579 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000580 example:
581 status: 501
582 message: Not implemented error message
583 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200584 Ok:
585 description: OK
586 content:
587 application/json:
588 schema:
589 type: object
590 Created:
591 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100592 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200593 NoContent:
594 description: No Content
595 content: {}
JosephKeenane0873dd2022-01-28 11:22:22 +0000596 InternalServerError:
597 description: Internal Server Error
598 content:
599 application/json:
600 schema:
601 $ref: "#/components/schemas/ErrorMessage"
602 example:
603 status: 500
604 message: Internal Server Error
605 details: Internal Server Error occurred
mpriyank93afc1e2022-03-28 15:47:47 +0530606 BadGateway:
607 description: Bad Gateway
608 content:
609 application/json:
610 schema:
611 $ref: "#/components/schemas/DmiErrorMessage"
612 example:
613 message: "Bad Gateway Error Message NCMP"
614 dmi-response:
615 http-code: 400
616 body: "Bad Request"