blob: 69225aed2d5750ea356cffc2d1aacab8e43f83f9 [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
tragait34a94b92021-03-30 12:02:27 +01004# ================================================================================
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
lukegleeson15b93e72021-07-07 15:25:30 +010010#
tragait34a94b92021-03-30 12:02:27 +010011# 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
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020020components:
21 schemas:
niamhcore66017b42021-10-19 11:07:02 +010022 # Common Schemas
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020023 ErrorMessage:
24 type: object
25 title: Error
26 properties:
27 status:
28 type: string
29 message:
30 type: string
31 details:
32 type: string
DylanB95EST4f4178c2021-07-02 13:30:42 +010033
niamhcore66017b42021-10-19 11:07:02 +010034 # Request Schemas
DylanB95EST4f4178c2021-07-02 13:30:42 +010035 RestDmiPluginRegistration:
36 type: object
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020037 properties:
DylanB95EST4f4178c2021-07-02 13:30:42 +010038 dmiPlugin:
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020039 type: string
emaclee844cab32021-12-01 09:42:37 +000040 example: my-dmi-plugin
DylanB95ESTd042fcd2022-02-21 12:57:08 +000041 default: ""
JosephKeenan20b4f9c2021-11-23 12:18:28 +000042 dmiDataPlugin:
43 type: string
emaclee844cab32021-12-01 09:42:37 +000044 example: my-dmi-data-plugin
DylanB95ESTd042fcd2022-02-21 12:57:08 +000045 default: ""
JosephKeenan20b4f9c2021-11-23 12:18:28 +000046 dmiModelPlugin:
47 type: string
emaclee844cab32021-12-01 09:42:37 +000048 example: my-dmi-model-plugin
DylanB95ESTd042fcd2022-02-21 12:57:08 +000049 default: ""
DylanB95EST4f4178c2021-07-02 13:30:42 +010050 createdCmHandles:
51 type: array
52 items:
DylanB95ESTe5573382022-01-27 17:12:52 +000053 $ref: '#/components/schemas/RestInputCmHandle'
DylanB95EST31facc82021-08-18 17:12:25 +010054 updatedCmHandles:
55 type: array
56 items:
DylanB95ESTe5573382022-01-27 17:12:52 +000057 $ref: '#/components/schemas/RestInputCmHandle'
Renu Kumari2c963172022-03-10 16:02:55 -050058 example:
59 cmHandle: my-cm-handle
60 cmHandleProperties:
61 add-my-property: add-property
62 update-my-property: updated-property
63 delete-my-property: '~'
64 publicCmHandleProperties:
65 add-my-property: add-property
66 update-my-property: updated-property
67 delete-my-property: '~'
DylanB95ESTe999b022021-08-24 16:56:40 +010068 removedCmHandles:
69 type: array
70 items:
71 type: string
Renu Kumari2c963172022-03-10 16:02:55 -050072 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
DylanB95EST4f4178c2021-07-02 13:30:42 +010073
DylanB95ESTe5573382022-01-27 17:12:52 +000074 RestInputCmHandle:
DylanB95EST4f4178c2021-07-02 13:30:42 +010075 required:
76 - cmHandle
77 type: object
78 properties:
79 cmHandle:
80 type: string
emaclee844cab32021-12-01 09:42:37 +000081 example: my-cm-handle
DylanB95EST4f4178c2021-07-02 13:30:42 +010082 cmHandleProperties:
DylanB95EST63132ce2021-12-14 16:34:38 +000083 $ref: '#/components/schemas/RestCmHandleProperties'
84 publicCmHandleProperties:
85 $ref: '#/components/schemas/RestCmHandleProperties'
86 RestCmHandleProperties:
DylanB95EST4f4178c2021-07-02 13:30:42 +010087 type: object
88 additionalProperties:
89 type: string
DylanB95EST63132ce2021-12-14 16:34:38 +000090 example: my-property
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020091
niamhcore66017b42021-10-19 11:07:02 +010092 Conditions:
93 type: object
94 properties:
95 conditions:
96 $ref: '#/components/schemas/ConditionsData'
97 ConditionsData:
98 type: array
99 items:
100 type: object
101 $ref: '#/components/schemas/ConditionProperties'
102 ConditionProperties:
103 properties:
104 name:
105 type: string
106 example: hasAllModules
107 conditionParameters:
niamhcoreb0d93072021-10-28 13:39:24 +0100108 $ref: '#/components/schemas/ModuleNamesAsJsonArray'
109 ModuleNamesAsJsonArray:
niamhcore66017b42021-10-19 11:07:02 +0100110 type: array
111 items:
112 type: object
niamhcoreb0d93072021-10-28 13:39:24 +0100113 $ref: '#/components/schemas/ModuleNameAsJsonObject'
emaclee844cab32021-12-01 09:42:37 +0000114 example: [my-module-1, my-module-2, my-module-3]
niamhcoreb0d93072021-10-28 13:39:24 +0100115 ModuleNameAsJsonObject:
niamhcore66017b42021-10-19 11:07:02 +0100116 properties:
117 moduleName:
118 type: string
emaclee844cab32021-12-01 09:42:37 +0000119 example: my-module
niamhcore66017b42021-10-19 11:07:02 +0100120
121 #Response Schemas
122 CmHandles:
123 type: object
124 properties:
125 cmHandles:
126 $ref: '#/components/schemas/CmHandleProperties'
127 CmHandleProperties:
128 type: array
129 items:
130 type: object
131 $ref: '#/components/schemas/CmHandleProperty'
132 CmHandleProperty:
133 properties:
134 cmHandleId:
135 type: string
emaclee844cab32021-12-01 09:42:37 +0000136 example: my-cm-handle-id
137
lukegleesond5bda882022-03-02 14:32:47 +0000138 RestModuleReference:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000139 type: object
140 title: Module reference details
141 properties:
142 moduleName:
143 type: string
144 example: my-module-name
145 revision:
146 type: string
147 example: my-module-revision
148
DylanB95ESTe5573382022-01-27 17:12:52 +0000149 RestOutputCmHandle:
150 type: object
151 title: CM handle Details
152 properties:
153 cmHandle:
154 type: string
155 example: my-cm-handle1
156 publicCmHandleProperties:
157 $ref: '#/components/schemas/CmHandlePublicProperties'
158 CmHandlePublicProperties:
159 type: array
160 items:
161 type: object
162 additionalProperties:
163 type: string
164 example: Book Type
165
emaclee844cab32021-12-01 09:42:37 +0000166 examples:
167 dataSampleRequest:
168 summary: Sample request
169 description: Sample request body
170 value:
171 test:bookstore:
172 bookstore-name: Chapters
173 categories:
174 - code: '01'
175 name: SciFi
176 books:
177 - authors:
178 - Iain M. Banks
emaclee844cab32021-12-01 09:42:37 +0000179 - Ursula K. Le Guin
180 - code: '02'
181 name: kids
182 books:
183 - authors:
184 - Philip Pullman
185
tragaitecd7f5e2022-01-13 13:15:14 +0000186 dataSamplePatchRequest:
187 summary: Sample patch request
188 description: Sample patch request body
189 value:
190 ietf-restconf:yang-patch:
191 patch-id: patch-1
192 edit:
193 - edit-id: edit1
194 operation: merge
195 target: /
196 value:
197 test:bookstore:
198 bookstore-name: Chapters
199 categories:
200 - code: '01'
201 name: Science
202 books:
203 - authors:
204 - Author1
205 - Author2
206 - code: '02'
207 name: Arts
208 books:
209 - authors:
210 - Author3
211 - edit-id: edit2
212 operation: merge
213 target: /
214 value:
215 test:bookstore:
216 bookstore-name: Novels
217 categories:
218 - code: '03'
219 name: History
220 books:
221 - authors:
222 - Iain M. Banks
223 - Ursula K. Le Guin
224 - code: '04'
225 name: Fiction
226 books:
227 - authors:
228 - Philip Pullman
229
emaclee844cab32021-12-01 09:42:37 +0000230 dataSampleResponse:
231 summary: Sample response
232 description: Sample response for selecting 'sample 1'.
233 value:
234 bookstore:
235 categories:
236 - code: '01'
237 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000238 - authors:
239 - Iain M. Banks
240 - Ursula K. Le Guin
emaclee844cab32021-12-01 09:42:37 +0000241 name: SciFi
242 - code: '02'
243 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000244 - authors:
245 - Philip Pullman
emaclee844cab32021-12-01 09:42:37 +0000246 name: kids
niamhcore66017b42021-10-19 11:07:02 +0100247
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200248 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100249 cmHandleInPath:
250 name: cm-handle
251 in: path
tragait34a94b92021-03-30 12:02:27 +0100252 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 +0100253 required: true
254 schema:
255 type: string
emaclee844cab32021-12-01 09:42:37 +0000256 example: my-cm-handle
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100257 xpathInQuery:
258 name: xpath
259 in: query
260 description: xpath
261 required: false
262 schema:
263 type: string
264 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300265 requiredXpathInQuery:
266 name: xpath
267 in: query
268 description: xpath
269 required: true
270 schema:
271 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100272 includeDescendantsOptionInQuery:
273 name: include-descendants
274 in: query
275 description: include-descendants
276 required: false
277 schema:
278 type: boolean
279 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000280 cpsPathInQuery:
281 name: cps-path
282 in: query
283 description: cps-path
284 required: false
285 schema:
286 type: string
287 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100288 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100289 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100290 in: query
291 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 +0100292 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100293 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100294 schema:
295 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100296 examples:
emaclee844cab32021-12-01 09:42:37 +0000297 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100298 value:
emaclee844cab32021-12-01 09:42:37 +0000299 resourceIdentifier: \shops\bookstore
300 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100301 value:
emaclee844cab32021-12-01 09:42:37 +0000302 resourceIdentifier: \shops\bookstore\categories[@code=1]
303 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100304 value:
emaclee844cab32021-12-01 09:42:37 +0000305 resourceIdentifier: parent=shops,child=bookstore
tragaitc3285512021-08-16 15:12:36 +0100306 acceptParamInHeader:
tragaitc584bf22021-08-20 15:45:58 +0100307 name: Accept
tragaitc3285512021-08-16 15:12:36 +0100308 in: header
309 required: false
310 description: Accept parameter for response, if accept parameter is null, that means client can accept any format.
311 schema:
312 type: string
313 enum: [ application/json, application/yang-data+json ]
tragaitabdff1b2021-10-06 11:04:18 +0100314 optionsParamInQuery:
315 name: options
tragaitc3285512021-08-16 15:12:36 +0100316 in: query
emaclee844cab32021-12-01 09:42:37 +0000317 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 +0100318 required: false
319 schema:
320 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100321 allowReserved: true
322 examples:
emaclee844cab32021-12-01 09:42:37 +0000323 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100324 value:
emaclee844cab32021-12-01 09:42:37 +0000325 options: (depth=3)
326 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100327 value:
emaclee844cab32021-12-01 09:42:37 +0000328 options: (fields=book)
329 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100330 value:
emaclee844cab32021-12-01 09:42:37 +0000331 options: (depth=2,fields=book/authors)
sourabh_sourabh1f2e66e2022-02-16 21:53:41 +0530332 topicParamInQuery:
333 name: topic
334 in: query
335 description: topic parameter in query.
336 required: false
337 schema:
338 type: string
339 allowReserved: true
340 examples:
341 sample 1:
342 value:
343 topic: my-topic-name
tragaitc584bf22021-08-20 15:45:58 +0100344 contentParamInHeader:
345 name: Content-Type
346 in: header
347 required: false
348 description: Content parameter for request, if content parameter is null, default value is application/json.
349 schema:
350 type: string
351 default: application/json
emaclee844cab32021-12-01 09:42:37 +0000352 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200353
354 responses:
355 NotFound:
356 description: The specified resource was not found
357 content:
358 application/json:
359 schema:
360 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000361 example:
362 status: 400
363 message: Not found error message
364 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200365 Unauthorized:
366 description: Unauthorized
367 content:
368 application/json:
369 schema:
370 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000371 example:
372 status: 401
373 message: Unauthorized error message
374 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200375 Forbidden:
376 description: Forbidden
377 content:
378 application/json:
379 schema:
380 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000381 example:
382 status: 403
383 message: Forbidden error message
384 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200385 BadRequest:
386 description: Bad Request
387 content:
388 application/json:
389 schema:
390 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000391 example:
392 status: 400 BAD_REQUEST
393 message: Bad request error message
394 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200395 Conflict:
396 description: Conflict
397 content:
398 application/json:
399 schema:
400 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000401 example:
402 status: 409 CONFLICT
403 message: Conflict error message
404 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100405 NotImplemented:
406 description: The given path has not been implemented
407 content:
408 application/json:
409 schema:
410 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000411 example:
412 status: 501
413 message: Not implemented error message
414 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200415 Ok:
416 description: OK
417 content:
418 application/json:
419 schema:
420 type: object
421 Created:
422 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100423 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200424 NoContent:
425 description: No Content
426 content: {}
JosephKeenane0873dd2022-01-28 11:22:22 +0000427 InternalServerError:
428 description: Internal Server Error
429 content:
430 application/json:
431 schema:
432 $ref: "#/components/schemas/ErrorMessage"
433 example:
434 status: 500
435 message: Internal Server Error
436 details: Internal Server Error occurred