tragait | 34a94b9 | 2021-03-30 12:02:27 +0100 | [diff] [blame] | 1 | # ============LICENSE_START======================================================= |
DylanB95EST | 63132ce | 2021-12-14 16:34:38 +0000 | [diff] [blame] | 2 | # Copyright (C) 2021-2022 Nordix Foundation |
Ruslan Kashapov | 1baf48d | 2021-05-07 10:46:27 +0300 | [diff] [blame] | 3 | # Modifications Copyright (C) 2021 Pantheon.tech |
tragait | 34a94b9 | 2021-03-30 12:02:27 +0100 | [diff] [blame] | 4 | # ================================================================================ |
| 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 |
lukegleeson | 15b93e7 | 2021-07-07 15:25:30 +0100 | [diff] [blame] | 10 | # |
tragait | 34a94b9 | 2021-03-30 12:02:27 +0100 | [diff] [blame] | 11 | # 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 Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 20 | components: |
| 21 | schemas: |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 22 | # Common Schemas |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 23 | ErrorMessage: |
| 24 | type: object |
| 25 | title: Error |
| 26 | properties: |
| 27 | status: |
| 28 | type: string |
| 29 | message: |
| 30 | type: string |
| 31 | details: |
| 32 | type: string |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 33 | |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 34 | # Request Schemas |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 35 | RestDmiPluginRegistration: |
| 36 | type: object |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 37 | properties: |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 38 | dmiPlugin: |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 39 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 40 | example: my-dmi-plugin |
JosephKeenan | 20b4f9c | 2021-11-23 12:18:28 +0000 | [diff] [blame] | 41 | dmiDataPlugin: |
| 42 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 43 | example: my-dmi-data-plugin |
JosephKeenan | 20b4f9c | 2021-11-23 12:18:28 +0000 | [diff] [blame] | 44 | dmiModelPlugin: |
| 45 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 46 | example: my-dmi-model-plugin |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 47 | createdCmHandles: |
| 48 | type: array |
| 49 | items: |
| 50 | $ref: '#/components/schemas/RestCmHandle' |
DylanB95EST | 31facc8 | 2021-08-18 17:12:25 +0100 | [diff] [blame] | 51 | updatedCmHandles: |
| 52 | type: array |
mpriyank | a15c0e5 | 2022-01-28 16:33:56 +0530 | [diff] [blame^] | 53 | 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: '~' |
DylanB95EST | 31facc8 | 2021-08-18 17:12:25 +0100 | [diff] [blame] | 63 | items: |
| 64 | $ref: '#/components/schemas/RestCmHandle' |
DylanB95EST | e999b02 | 2021-08-24 16:56:40 +0100 | [diff] [blame] | 65 | removedCmHandles: |
| 66 | type: array |
| 67 | items: |
| 68 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 69 | example: [my-cm-handle1, my-cm-handle2, my-cm-handle3] |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 70 | |
| 71 | RestCmHandle: |
| 72 | required: |
| 73 | - cmHandle |
| 74 | type: object |
| 75 | properties: |
| 76 | cmHandle: |
| 77 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 78 | example: my-cm-handle |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 79 | cmHandleProperties: |
DylanB95EST | 63132ce | 2021-12-14 16:34:38 +0000 | [diff] [blame] | 80 | $ref: '#/components/schemas/RestCmHandleProperties' |
| 81 | publicCmHandleProperties: |
| 82 | $ref: '#/components/schemas/RestCmHandleProperties' |
| 83 | RestCmHandleProperties: |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 84 | type: object |
| 85 | additionalProperties: |
| 86 | type: string |
DylanB95EST | 63132ce | 2021-12-14 16:34:38 +0000 | [diff] [blame] | 87 | example: my-property |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 88 | |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 89 | 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: |
niamhcore | b0d9307 | 2021-10-28 13:39:24 +0100 | [diff] [blame] | 105 | $ref: '#/components/schemas/ModuleNamesAsJsonArray' |
| 106 | ModuleNamesAsJsonArray: |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 107 | type: array |
| 108 | items: |
| 109 | type: object |
niamhcore | b0d9307 | 2021-10-28 13:39:24 +0100 | [diff] [blame] | 110 | $ref: '#/components/schemas/ModuleNameAsJsonObject' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 111 | example: [my-module-1, my-module-2, my-module-3] |
niamhcore | b0d9307 | 2021-10-28 13:39:24 +0100 | [diff] [blame] | 112 | ModuleNameAsJsonObject: |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 113 | properties: |
| 114 | moduleName: |
| 115 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 116 | example: my-module |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 117 | |
| 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 |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 133 | example: my-cm-handle-id |
| 134 | |
puthuparambil.aditya | d000733 | 2021-12-08 18:53:39 +0000 | [diff] [blame] | 135 | 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 | |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 146 | 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 |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 159 | - Ursula K. Le Guin |
| 160 | - code: '02' |
| 161 | name: kids |
| 162 | books: |
| 163 | - authors: |
| 164 | - Philip Pullman |
| 165 | |
tragait | ecd7f5e | 2022-01-13 13:15:14 +0000 | [diff] [blame] | 166 | 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 | |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 210 | 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.aditya | d000733 | 2021-12-08 18:53:39 +0000 | [diff] [blame] | 218 | - authors: |
| 219 | - Iain M. Banks |
| 220 | - Ursula K. Le Guin |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 221 | name: SciFi |
| 222 | - code: '02' |
| 223 | books: |
puthuparambil.aditya | d000733 | 2021-12-08 18:53:39 +0000 | [diff] [blame] | 224 | - authors: |
| 225 | - Philip Pullman |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 226 | name: kids |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 227 | |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 228 | parameters: |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 229 | cmHandleInPath: |
| 230 | name: cm-handle |
| 231 | in: path |
tragait | 34a94b9 | 2021-03-30 12:02:27 +0100 | [diff] [blame] | 232 | description: The identifier for a network function, network element, subnetwork or any other cm object by managed Network CM Proxy |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 233 | required: true |
| 234 | schema: |
| 235 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 236 | example: my-cm-handle |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 237 | xpathInQuery: |
| 238 | name: xpath |
| 239 | in: query |
| 240 | description: xpath |
| 241 | required: false |
| 242 | schema: |
| 243 | type: string |
| 244 | default: / |
Ruslan Kashapov | 1baf48d | 2021-05-07 10:46:27 +0300 | [diff] [blame] | 245 | requiredXpathInQuery: |
| 246 | name: xpath |
| 247 | in: query |
| 248 | description: xpath |
| 249 | required: true |
| 250 | schema: |
| 251 | type: string |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 252 | includeDescendantsOptionInQuery: |
| 253 | name: include-descendants |
| 254 | in: query |
| 255 | description: include-descendants |
| 256 | required: false |
| 257 | schema: |
| 258 | type: boolean |
| 259 | default: false |
niamhcore | b5d573b | 2021-02-26 10:13:48 +0000 | [diff] [blame] | 260 | cpsPathInQuery: |
| 261 | name: cps-path |
| 262 | in: query |
| 263 | description: cps-path |
| 264 | required: false |
| 265 | schema: |
| 266 | type: string |
| 267 | default: / |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 268 | resourceIdentifierInQuery: |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 269 | name: resourceIdentifier |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 270 | 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. |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 272 | required: true |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 273 | allowReserved: true |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 274 | schema: |
| 275 | type: string |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 276 | examples: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 277 | sample 1: |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 278 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 279 | resourceIdentifier: \shops\bookstore |
| 280 | sample 2: |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 281 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 282 | resourceIdentifier: \shops\bookstore\categories[@code=1] |
| 283 | sample 3: |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 284 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 285 | resourceIdentifier: parent=shops,child=bookstore |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 286 | acceptParamInHeader: |
tragait | c584bf2 | 2021-08-20 15:45:58 +0100 | [diff] [blame] | 287 | name: Accept |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 288 | 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 ] |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 294 | optionsParamInQuery: |
| 295 | name: options |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 296 | in: query |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 297 | 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. |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 298 | required: false |
| 299 | schema: |
| 300 | type: string |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 301 | allowReserved: true |
| 302 | examples: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 303 | sample 1: |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 304 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 305 | options: (depth=3) |
| 306 | sample 2: |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 307 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 308 | options: (fields=book) |
| 309 | sample 3: |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 310 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 311 | options: (depth=2,fields=book/authors) |
tragait | c584bf2 | 2021-08-20 15:45:58 +0100 | [diff] [blame] | 312 | 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 |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 320 | example: application/yang-data+json |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 321 | |
| 322 | responses: |
| 323 | NotFound: |
| 324 | description: The specified resource was not found |
| 325 | content: |
| 326 | application/json: |
| 327 | schema: |
| 328 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 329 | example: |
| 330 | status: 400 |
| 331 | message: Not found error message |
| 332 | details: Not found error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 333 | Unauthorized: |
| 334 | description: Unauthorized |
| 335 | content: |
| 336 | application/json: |
| 337 | schema: |
| 338 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 339 | example: |
| 340 | status: 401 |
| 341 | message: Unauthorized error message |
| 342 | details: Unauthorized error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 343 | Forbidden: |
| 344 | description: Forbidden |
| 345 | content: |
| 346 | application/json: |
| 347 | schema: |
| 348 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 349 | example: |
| 350 | status: 403 |
| 351 | message: Forbidden error message |
| 352 | details: Forbidden error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 353 | BadRequest: |
| 354 | description: Bad Request |
| 355 | content: |
| 356 | application/json: |
| 357 | schema: |
| 358 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 359 | example: |
| 360 | status: 400 BAD_REQUEST |
| 361 | message: Bad request error message |
| 362 | details: Bad request error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 363 | Conflict: |
| 364 | description: Conflict |
| 365 | content: |
| 366 | application/json: |
| 367 | schema: |
| 368 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 369 | example: |
| 370 | status: 409 CONFLICT |
| 371 | message: Conflict error message |
| 372 | details: Conflict error details |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 373 | NotImplemented: |
| 374 | description: The given path has not been implemented |
| 375 | content: |
| 376 | application/json: |
| 377 | schema: |
| 378 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 379 | example: |
| 380 | status: 501 |
| 381 | message: Not implemented error message |
| 382 | details: Not implemented error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 383 | Ok: |
| 384 | description: OK |
| 385 | content: |
| 386 | application/json: |
| 387 | schema: |
| 388 | type: object |
| 389 | Created: |
| 390 | description: Created |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 391 | content: {} |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 392 | NoContent: |
| 393 | description: No Content |
| 394 | content: {} |
JosephKeenan | e0873dd | 2022-01-28 11:22:22 +0000 | [diff] [blame] | 395 | 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 |