blob: fd02b6e564470f8d43dd32368f67a236a5b346b1 [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:
53 $ref: '#/components/schemas/RestCmHandle'
DylanB95EST31facc82021-08-18 17:12:25 +010054 updatedCmHandles:
55 type: array
mpriyanka15c0e52022-01-28 16:33:56 +053056 example:
57 cmHandle: my-cm-handle
58 cmHandleProperties:
59 add-my-property: add-property
60 update-my-property: updated-property
61 delete-my-property: '~'
62 publicCmHandleProperties:
63 add-my-property: add-property
64 update-my-property: updated-property
65 delete-my-property: '~'
DylanB95EST31facc82021-08-18 17:12:25 +010066 items:
67 $ref: '#/components/schemas/RestCmHandle'
DylanB95ESTe999b022021-08-24 16:56:40 +010068 removedCmHandles:
69 type: array
70 items:
71 type: string
emaclee844cab32021-12-01 09:42:37 +000072 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
DylanB95EST4f4178c2021-07-02 13:30:42 +010073
74 RestCmHandle:
75 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
puthuparambil.adityad0007332021-12-08 18:53:39 +0000138 ModuleReference:
139 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
emaclee844cab32021-12-01 09:42:37 +0000149 examples:
150 dataSampleRequest:
151 summary: Sample request
152 description: Sample request body
153 value:
154 test:bookstore:
155 bookstore-name: Chapters
156 categories:
157 - code: '01'
158 name: SciFi
159 books:
160 - authors:
161 - Iain M. Banks
emaclee844cab32021-12-01 09:42:37 +0000162 - Ursula K. Le Guin
163 - code: '02'
164 name: kids
165 books:
166 - authors:
167 - Philip Pullman
168
tragaitecd7f5e2022-01-13 13:15:14 +0000169 dataSamplePatchRequest:
170 summary: Sample patch request
171 description: Sample patch request body
172 value:
173 ietf-restconf:yang-patch:
174 patch-id: patch-1
175 edit:
176 - edit-id: edit1
177 operation: merge
178 target: /
179 value:
180 test:bookstore:
181 bookstore-name: Chapters
182 categories:
183 - code: '01'
184 name: Science
185 books:
186 - authors:
187 - Author1
188 - Author2
189 - code: '02'
190 name: Arts
191 books:
192 - authors:
193 - Author3
194 - edit-id: edit2
195 operation: merge
196 target: /
197 value:
198 test:bookstore:
199 bookstore-name: Novels
200 categories:
201 - code: '03'
202 name: History
203 books:
204 - authors:
205 - Iain M. Banks
206 - Ursula K. Le Guin
207 - code: '04'
208 name: Fiction
209 books:
210 - authors:
211 - Philip Pullman
212
emaclee844cab32021-12-01 09:42:37 +0000213 dataSampleResponse:
214 summary: Sample response
215 description: Sample response for selecting 'sample 1'.
216 value:
217 bookstore:
218 categories:
219 - code: '01'
220 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000221 - authors:
222 - Iain M. Banks
223 - Ursula K. Le Guin
emaclee844cab32021-12-01 09:42:37 +0000224 name: SciFi
225 - code: '02'
226 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000227 - authors:
228 - Philip Pullman
emaclee844cab32021-12-01 09:42:37 +0000229 name: kids
niamhcore66017b42021-10-19 11:07:02 +0100230
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200231 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100232 cmHandleInPath:
233 name: cm-handle
234 in: path
tragait34a94b92021-03-30 12:02:27 +0100235 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 +0100236 required: true
237 schema:
238 type: string
emaclee844cab32021-12-01 09:42:37 +0000239 example: my-cm-handle
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100240 xpathInQuery:
241 name: xpath
242 in: query
243 description: xpath
244 required: false
245 schema:
246 type: string
247 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300248 requiredXpathInQuery:
249 name: xpath
250 in: query
251 description: xpath
252 required: true
253 schema:
254 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100255 includeDescendantsOptionInQuery:
256 name: include-descendants
257 in: query
258 description: include-descendants
259 required: false
260 schema:
261 type: boolean
262 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000263 cpsPathInQuery:
264 name: cps-path
265 in: query
266 description: cps-path
267 required: false
268 schema:
269 type: string
270 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100271 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100272 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100273 in: query
274 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 +0100275 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100276 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100277 schema:
278 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100279 examples:
emaclee844cab32021-12-01 09:42:37 +0000280 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100281 value:
emaclee844cab32021-12-01 09:42:37 +0000282 resourceIdentifier: \shops\bookstore
283 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100284 value:
emaclee844cab32021-12-01 09:42:37 +0000285 resourceIdentifier: \shops\bookstore\categories[@code=1]
286 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100287 value:
emaclee844cab32021-12-01 09:42:37 +0000288 resourceIdentifier: parent=shops,child=bookstore
tragaitc3285512021-08-16 15:12:36 +0100289 acceptParamInHeader:
tragaitc584bf22021-08-20 15:45:58 +0100290 name: Accept
tragaitc3285512021-08-16 15:12:36 +0100291 in: header
292 required: false
293 description: Accept parameter for response, if accept parameter is null, that means client can accept any format.
294 schema:
295 type: string
296 enum: [ application/json, application/yang-data+json ]
tragaitabdff1b2021-10-06 11:04:18 +0100297 optionsParamInQuery:
298 name: options
tragaitc3285512021-08-16 15:12:36 +0100299 in: query
emaclee844cab32021-12-01 09:42:37 +0000300 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 +0100301 required: false
302 schema:
303 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100304 allowReserved: true
305 examples:
emaclee844cab32021-12-01 09:42:37 +0000306 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100307 value:
emaclee844cab32021-12-01 09:42:37 +0000308 options: (depth=3)
309 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100310 value:
emaclee844cab32021-12-01 09:42:37 +0000311 options: (fields=book)
312 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100313 value:
emaclee844cab32021-12-01 09:42:37 +0000314 options: (depth=2,fields=book/authors)
tragaitc584bf22021-08-20 15:45:58 +0100315 contentParamInHeader:
316 name: Content-Type
317 in: header
318 required: false
319 description: Content parameter for request, if content parameter is null, default value is application/json.
320 schema:
321 type: string
322 default: application/json
emaclee844cab32021-12-01 09:42:37 +0000323 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200324
325 responses:
326 NotFound:
327 description: The specified resource was not found
328 content:
329 application/json:
330 schema:
331 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000332 example:
333 status: 400
334 message: Not found error message
335 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200336 Unauthorized:
337 description: Unauthorized
338 content:
339 application/json:
340 schema:
341 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000342 example:
343 status: 401
344 message: Unauthorized error message
345 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200346 Forbidden:
347 description: Forbidden
348 content:
349 application/json:
350 schema:
351 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000352 example:
353 status: 403
354 message: Forbidden error message
355 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200356 BadRequest:
357 description: Bad Request
358 content:
359 application/json:
360 schema:
361 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000362 example:
363 status: 400 BAD_REQUEST
364 message: Bad request error message
365 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200366 Conflict:
367 description: Conflict
368 content:
369 application/json:
370 schema:
371 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000372 example:
373 status: 409 CONFLICT
374 message: Conflict error message
375 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100376 NotImplemented:
377 description: The given path has not been implemented
378 content:
379 application/json:
380 schema:
381 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000382 example:
383 status: 501
384 message: Not implemented error message
385 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200386 Ok:
387 description: OK
388 content:
389 application/json:
390 schema:
391 type: object
392 Created:
393 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100394 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200395 NoContent:
396 description: No Content
397 content: {}
JosephKeenane0873dd2022-01-28 11:22:22 +0000398 InternalServerError:
399 description: Internal Server Error
400 content:
401 application/json:
402 schema:
403 $ref: "#/components/schemas/ErrorMessage"
404 example:
405 status: 500
406 message: Internal Server Error
407 details: Internal Server Error occurred