blob: cda6ca3ac559a7b4101b5f5523d92a21923221d1 [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
JosephKeenan20b4f9c2021-11-23 12:18:28 +000041 dmiDataPlugin:
42 type: string
emaclee844cab32021-12-01 09:42:37 +000043 example: my-dmi-data-plugin
JosephKeenan20b4f9c2021-11-23 12:18:28 +000044 dmiModelPlugin:
45 type: string
emaclee844cab32021-12-01 09:42:37 +000046 example: my-dmi-model-plugin
DylanB95EST4f4178c2021-07-02 13:30:42 +010047 createdCmHandles:
48 type: array
49 items:
50 $ref: '#/components/schemas/RestCmHandle'
DylanB95EST31facc82021-08-18 17:12:25 +010051 updatedCmHandles:
52 type: array
mpriyanka15c0e52022-01-28 16:33:56 +053053 example:
54 cmHandle: my-cm-handle
55 cmHandleProperties:
56 add-my-property: add-property
57 update-my-property: updated-property
58 delete-my-property: '~'
59 publicCmHandleProperties:
60 add-my-property: add-property
61 update-my-property: updated-property
62 delete-my-property: '~'
DylanB95EST31facc82021-08-18 17:12:25 +010063 items:
64 $ref: '#/components/schemas/RestCmHandle'
DylanB95ESTe999b022021-08-24 16:56:40 +010065 removedCmHandles:
66 type: array
67 items:
68 type: string
emaclee844cab32021-12-01 09:42:37 +000069 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
DylanB95EST4f4178c2021-07-02 13:30:42 +010070
71 RestCmHandle:
72 required:
73 - cmHandle
74 type: object
75 properties:
76 cmHandle:
77 type: string
emaclee844cab32021-12-01 09:42:37 +000078 example: my-cm-handle
DylanB95EST4f4178c2021-07-02 13:30:42 +010079 cmHandleProperties:
DylanB95EST63132ce2021-12-14 16:34:38 +000080 $ref: '#/components/schemas/RestCmHandleProperties'
81 publicCmHandleProperties:
82 $ref: '#/components/schemas/RestCmHandleProperties'
83 RestCmHandleProperties:
DylanB95EST4f4178c2021-07-02 13:30:42 +010084 type: object
85 additionalProperties:
86 type: string
DylanB95EST63132ce2021-12-14 16:34:38 +000087 example: my-property
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020088
niamhcore66017b42021-10-19 11:07:02 +010089 Conditions:
90 type: object
91 properties:
92 conditions:
93 $ref: '#/components/schemas/ConditionsData'
94 ConditionsData:
95 type: array
96 items:
97 type: object
98 $ref: '#/components/schemas/ConditionProperties'
99 ConditionProperties:
100 properties:
101 name:
102 type: string
103 example: hasAllModules
104 conditionParameters:
niamhcoreb0d93072021-10-28 13:39:24 +0100105 $ref: '#/components/schemas/ModuleNamesAsJsonArray'
106 ModuleNamesAsJsonArray:
niamhcore66017b42021-10-19 11:07:02 +0100107 type: array
108 items:
109 type: object
niamhcoreb0d93072021-10-28 13:39:24 +0100110 $ref: '#/components/schemas/ModuleNameAsJsonObject'
emaclee844cab32021-12-01 09:42:37 +0000111 example: [my-module-1, my-module-2, my-module-3]
niamhcoreb0d93072021-10-28 13:39:24 +0100112 ModuleNameAsJsonObject:
niamhcore66017b42021-10-19 11:07:02 +0100113 properties:
114 moduleName:
115 type: string
emaclee844cab32021-12-01 09:42:37 +0000116 example: my-module
niamhcore66017b42021-10-19 11:07:02 +0100117
118 #Response Schemas
119 CmHandles:
120 type: object
121 properties:
122 cmHandles:
123 $ref: '#/components/schemas/CmHandleProperties'
124 CmHandleProperties:
125 type: array
126 items:
127 type: object
128 $ref: '#/components/schemas/CmHandleProperty'
129 CmHandleProperty:
130 properties:
131 cmHandleId:
132 type: string
emaclee844cab32021-12-01 09:42:37 +0000133 example: my-cm-handle-id
134
puthuparambil.adityad0007332021-12-08 18:53:39 +0000135 ModuleReference:
136 type: object
137 title: Module reference details
138 properties:
139 moduleName:
140 type: string
141 example: my-module-name
142 revision:
143 type: string
144 example: my-module-revision
145
emaclee844cab32021-12-01 09:42:37 +0000146 examples:
147 dataSampleRequest:
148 summary: Sample request
149 description: Sample request body
150 value:
151 test:bookstore:
152 bookstore-name: Chapters
153 categories:
154 - code: '01'
155 name: SciFi
156 books:
157 - authors:
158 - Iain M. Banks
emaclee844cab32021-12-01 09:42:37 +0000159 - Ursula K. Le Guin
160 - code: '02'
161 name: kids
162 books:
163 - authors:
164 - Philip Pullman
165
tragaitecd7f5e2022-01-13 13:15:14 +0000166 dataSamplePatchRequest:
167 summary: Sample patch request
168 description: Sample patch request body
169 value:
170 ietf-restconf:yang-patch:
171 patch-id: patch-1
172 edit:
173 - edit-id: edit1
174 operation: merge
175 target: /
176 value:
177 test:bookstore:
178 bookstore-name: Chapters
179 categories:
180 - code: '01'
181 name: Science
182 books:
183 - authors:
184 - Author1
185 - Author2
186 - code: '02'
187 name: Arts
188 books:
189 - authors:
190 - Author3
191 - edit-id: edit2
192 operation: merge
193 target: /
194 value:
195 test:bookstore:
196 bookstore-name: Novels
197 categories:
198 - code: '03'
199 name: History
200 books:
201 - authors:
202 - Iain M. Banks
203 - Ursula K. Le Guin
204 - code: '04'
205 name: Fiction
206 books:
207 - authors:
208 - Philip Pullman
209
emaclee844cab32021-12-01 09:42:37 +0000210 dataSampleResponse:
211 summary: Sample response
212 description: Sample response for selecting 'sample 1'.
213 value:
214 bookstore:
215 categories:
216 - code: '01'
217 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000218 - authors:
219 - Iain M. Banks
220 - Ursula K. Le Guin
emaclee844cab32021-12-01 09:42:37 +0000221 name: SciFi
222 - code: '02'
223 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000224 - authors:
225 - Philip Pullman
emaclee844cab32021-12-01 09:42:37 +0000226 name: kids
niamhcore66017b42021-10-19 11:07:02 +0100227
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200228 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100229 cmHandleInPath:
230 name: cm-handle
231 in: path
tragait34a94b92021-03-30 12:02:27 +0100232 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 +0100233 required: true
234 schema:
235 type: string
emaclee844cab32021-12-01 09:42:37 +0000236 example: my-cm-handle
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100237 xpathInQuery:
238 name: xpath
239 in: query
240 description: xpath
241 required: false
242 schema:
243 type: string
244 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300245 requiredXpathInQuery:
246 name: xpath
247 in: query
248 description: xpath
249 required: true
250 schema:
251 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100252 includeDescendantsOptionInQuery:
253 name: include-descendants
254 in: query
255 description: include-descendants
256 required: false
257 schema:
258 type: boolean
259 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000260 cpsPathInQuery:
261 name: cps-path
262 in: query
263 description: cps-path
264 required: false
265 schema:
266 type: string
267 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100268 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100269 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100270 in: query
271 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 +0100272 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100273 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100274 schema:
275 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100276 examples:
emaclee844cab32021-12-01 09:42:37 +0000277 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100278 value:
emaclee844cab32021-12-01 09:42:37 +0000279 resourceIdentifier: \shops\bookstore
280 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100281 value:
emaclee844cab32021-12-01 09:42:37 +0000282 resourceIdentifier: \shops\bookstore\categories[@code=1]
283 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100284 value:
emaclee844cab32021-12-01 09:42:37 +0000285 resourceIdentifier: parent=shops,child=bookstore
tragaitc3285512021-08-16 15:12:36 +0100286 acceptParamInHeader:
tragaitc584bf22021-08-20 15:45:58 +0100287 name: Accept
tragaitc3285512021-08-16 15:12:36 +0100288 in: header
289 required: false
290 description: Accept parameter for response, if accept parameter is null, that means client can accept any format.
291 schema:
292 type: string
293 enum: [ application/json, application/yang-data+json ]
tragaitabdff1b2021-10-06 11:04:18 +0100294 optionsParamInQuery:
295 name: options
tragaitc3285512021-08-16 15:12:36 +0100296 in: query
emaclee844cab32021-12-01 09:42:37 +0000297 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 +0100298 required: false
299 schema:
300 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100301 allowReserved: true
302 examples:
emaclee844cab32021-12-01 09:42:37 +0000303 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100304 value:
emaclee844cab32021-12-01 09:42:37 +0000305 options: (depth=3)
306 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100307 value:
emaclee844cab32021-12-01 09:42:37 +0000308 options: (fields=book)
309 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100310 value:
emaclee844cab32021-12-01 09:42:37 +0000311 options: (depth=2,fields=book/authors)
tragaitc584bf22021-08-20 15:45:58 +0100312 contentParamInHeader:
313 name: Content-Type
314 in: header
315 required: false
316 description: Content parameter for request, if content parameter is null, default value is application/json.
317 schema:
318 type: string
319 default: application/json
emaclee844cab32021-12-01 09:42:37 +0000320 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200321
322 responses:
323 NotFound:
324 description: The specified resource was not found
325 content:
326 application/json:
327 schema:
328 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000329 example:
330 status: 400
331 message: Not found error message
332 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200333 Unauthorized:
334 description: Unauthorized
335 content:
336 application/json:
337 schema:
338 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000339 example:
340 status: 401
341 message: Unauthorized error message
342 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200343 Forbidden:
344 description: Forbidden
345 content:
346 application/json:
347 schema:
348 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000349 example:
350 status: 403
351 message: Forbidden error message
352 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200353 BadRequest:
354 description: Bad Request
355 content:
356 application/json:
357 schema:
358 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000359 example:
360 status: 400 BAD_REQUEST
361 message: Bad request error message
362 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200363 Conflict:
364 description: Conflict
365 content:
366 application/json:
367 schema:
368 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000369 example:
370 status: 409 CONFLICT
371 message: Conflict error message
372 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100373 NotImplemented:
374 description: The given path has not been implemented
375 content:
376 application/json:
377 schema:
378 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000379 example:
380 status: 501
381 message: Not implemented error message
382 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200383 Ok:
384 description: OK
385 content:
386 application/json:
387 schema:
388 type: object
389 Created:
390 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100391 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200392 NoContent:
393 description: No Content
394 content: {}
JosephKeenane0873dd2022-01-28 11:22:22 +0000395 InternalServerError:
396 description: Internal Server Error
397 content:
398 application/json:
399 schema:
400 $ref: "#/components/schemas/ErrorMessage"
401 example:
402 status: 500
403 message: Internal Server Error
404 details: Internal Server Error occurred