tragait | 34a94b9 | 2021-03-30 12:02:27 +0100 | [diff] [blame] | 1 | # ============LICENSE_START======================================================= |
lukegleeson | 15b93e7 | 2021-07-07 15:25:30 +0100 | [diff] [blame] | 2 | # Copyright (C) 2021 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 |
| 53 | items: |
| 54 | $ref: '#/components/schemas/RestCmHandle' |
DylanB95EST | e999b02 | 2021-08-24 16:56:40 +0100 | [diff] [blame] | 55 | removedCmHandles: |
| 56 | type: array |
| 57 | items: |
| 58 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 59 | example: [my-cm-handle1, my-cm-handle2, my-cm-handle3] |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 60 | |
| 61 | RestCmHandle: |
| 62 | required: |
| 63 | - cmHandle |
| 64 | type: object |
| 65 | properties: |
| 66 | cmHandle: |
| 67 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 68 | example: my-cm-handle |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 69 | cmHandleProperties: |
| 70 | $ref: '#/components/schemas/RestCmHandleAdditionalProperties' |
| 71 | RestCmHandleAdditionalProperties: |
| 72 | type: object |
| 73 | additionalProperties: |
| 74 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 75 | example: my-additional-property |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 76 | |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 77 | Conditions: |
| 78 | type: object |
| 79 | properties: |
| 80 | conditions: |
| 81 | $ref: '#/components/schemas/ConditionsData' |
| 82 | ConditionsData: |
| 83 | type: array |
| 84 | items: |
| 85 | type: object |
| 86 | $ref: '#/components/schemas/ConditionProperties' |
| 87 | ConditionProperties: |
| 88 | properties: |
| 89 | name: |
| 90 | type: string |
| 91 | example: hasAllModules |
| 92 | conditionParameters: |
niamhcore | b0d9307 | 2021-10-28 13:39:24 +0100 | [diff] [blame] | 93 | $ref: '#/components/schemas/ModuleNamesAsJsonArray' |
| 94 | ModuleNamesAsJsonArray: |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 95 | type: array |
| 96 | items: |
| 97 | type: object |
niamhcore | b0d9307 | 2021-10-28 13:39:24 +0100 | [diff] [blame] | 98 | $ref: '#/components/schemas/ModuleNameAsJsonObject' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 99 | example: [my-module-1, my-module-2, my-module-3] |
niamhcore | b0d9307 | 2021-10-28 13:39:24 +0100 | [diff] [blame] | 100 | ModuleNameAsJsonObject: |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 101 | properties: |
| 102 | moduleName: |
| 103 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 104 | example: my-module |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 105 | |
| 106 | #Response Schemas |
| 107 | CmHandles: |
| 108 | type: object |
| 109 | properties: |
| 110 | cmHandles: |
| 111 | $ref: '#/components/schemas/CmHandleProperties' |
| 112 | CmHandleProperties: |
| 113 | type: array |
| 114 | items: |
| 115 | type: object |
| 116 | $ref: '#/components/schemas/CmHandleProperty' |
| 117 | CmHandleProperty: |
| 118 | properties: |
| 119 | cmHandleId: |
| 120 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 121 | example: my-cm-handle-id |
| 122 | |
puthuparambil.aditya | d000733 | 2021-12-08 18:53:39 +0000 | [diff] [blame^] | 123 | ModuleReference: |
| 124 | type: object |
| 125 | title: Module reference details |
| 126 | properties: |
| 127 | moduleName: |
| 128 | type: string |
| 129 | example: my-module-name |
| 130 | revision: |
| 131 | type: string |
| 132 | example: my-module-revision |
| 133 | |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 134 | examples: |
| 135 | dataSampleRequest: |
| 136 | summary: Sample request |
| 137 | description: Sample request body |
| 138 | value: |
| 139 | test:bookstore: |
| 140 | bookstore-name: Chapters |
| 141 | categories: |
| 142 | - code: '01' |
| 143 | name: SciFi |
| 144 | books: |
| 145 | - authors: |
| 146 | - Iain M. Banks |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 147 | - Ursula K. Le Guin |
| 148 | - code: '02' |
| 149 | name: kids |
| 150 | books: |
| 151 | - authors: |
| 152 | - Philip Pullman |
| 153 | |
| 154 | dataSampleResponse: |
| 155 | summary: Sample response |
| 156 | description: Sample response for selecting 'sample 1'. |
| 157 | value: |
| 158 | bookstore: |
| 159 | categories: |
| 160 | - code: '01' |
| 161 | books: |
puthuparambil.aditya | d000733 | 2021-12-08 18:53:39 +0000 | [diff] [blame^] | 162 | - authors: |
| 163 | - Iain M. Banks |
| 164 | - Ursula K. Le Guin |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 165 | name: SciFi |
| 166 | - code: '02' |
| 167 | books: |
puthuparambil.aditya | d000733 | 2021-12-08 18:53:39 +0000 | [diff] [blame^] | 168 | - authors: |
| 169 | - Philip Pullman |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 170 | name: kids |
niamhcore | 66017b4 | 2021-10-19 11:07:02 +0100 | [diff] [blame] | 171 | |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 172 | parameters: |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 173 | cmHandleInPath: |
| 174 | name: cm-handle |
| 175 | in: path |
tragait | 34a94b9 | 2021-03-30 12:02:27 +0100 | [diff] [blame] | 176 | 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] | 177 | required: true |
| 178 | schema: |
| 179 | type: string |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 180 | example: my-cm-handle |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 181 | xpathInQuery: |
| 182 | name: xpath |
| 183 | in: query |
| 184 | description: xpath |
| 185 | required: false |
| 186 | schema: |
| 187 | type: string |
| 188 | default: / |
Ruslan Kashapov | 1baf48d | 2021-05-07 10:46:27 +0300 | [diff] [blame] | 189 | requiredXpathInQuery: |
| 190 | name: xpath |
| 191 | in: query |
| 192 | description: xpath |
| 193 | required: true |
| 194 | schema: |
| 195 | type: string |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 196 | includeDescendantsOptionInQuery: |
| 197 | name: include-descendants |
| 198 | in: query |
| 199 | description: include-descendants |
| 200 | required: false |
| 201 | schema: |
| 202 | type: boolean |
| 203 | default: false |
niamhcore | b5d573b | 2021-02-26 10:13:48 +0000 | [diff] [blame] | 204 | cpsPathInQuery: |
| 205 | name: cps-path |
| 206 | in: query |
| 207 | description: cps-path |
| 208 | required: false |
| 209 | schema: |
| 210 | type: string |
| 211 | default: / |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 212 | resourceIdentifierInQuery: |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 213 | name: resourceIdentifier |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 214 | in: query |
| 215 | 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] | 216 | required: true |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 217 | allowReserved: true |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 218 | schema: |
| 219 | type: string |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 220 | examples: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 221 | sample 1: |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 222 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 223 | resourceIdentifier: \shops\bookstore |
| 224 | sample 2: |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 225 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 226 | resourceIdentifier: \shops\bookstore\categories[@code=1] |
| 227 | sample 3: |
niamhcore | fd2e6dd | 2021-09-29 16:43:35 +0100 | [diff] [blame] | 228 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 229 | resourceIdentifier: parent=shops,child=bookstore |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 230 | acceptParamInHeader: |
tragait | c584bf2 | 2021-08-20 15:45:58 +0100 | [diff] [blame] | 231 | name: Accept |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 232 | in: header |
| 233 | required: false |
| 234 | description: Accept parameter for response, if accept parameter is null, that means client can accept any format. |
| 235 | schema: |
| 236 | type: string |
| 237 | enum: [ application/json, application/yang-data+json ] |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 238 | optionsParamInQuery: |
| 239 | name: options |
tragait | c328551 | 2021-08-16 15:12:36 +0100 | [diff] [blame] | 240 | in: query |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 241 | 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] | 242 | required: false |
| 243 | schema: |
| 244 | type: string |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 245 | allowReserved: true |
| 246 | examples: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 247 | sample 1: |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 248 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 249 | options: (depth=3) |
| 250 | sample 2: |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 251 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 252 | options: (fields=book) |
| 253 | sample 3: |
tragait | abdff1b | 2021-10-06 11:04:18 +0100 | [diff] [blame] | 254 | value: |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 255 | options: (depth=2,fields=book/authors) |
tragait | c584bf2 | 2021-08-20 15:45:58 +0100 | [diff] [blame] | 256 | contentParamInHeader: |
| 257 | name: Content-Type |
| 258 | in: header |
| 259 | required: false |
| 260 | description: Content parameter for request, if content parameter is null, default value is application/json. |
| 261 | schema: |
| 262 | type: string |
| 263 | default: application/json |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 264 | example: application/yang-data+json |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 265 | |
| 266 | responses: |
| 267 | NotFound: |
| 268 | description: The specified resource was not found |
| 269 | content: |
| 270 | application/json: |
| 271 | schema: |
| 272 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 273 | example: |
| 274 | status: 400 |
| 275 | message: Not found error message |
| 276 | details: Not found error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 277 | Unauthorized: |
| 278 | description: Unauthorized |
| 279 | content: |
| 280 | application/json: |
| 281 | schema: |
| 282 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 283 | example: |
| 284 | status: 401 |
| 285 | message: Unauthorized error message |
| 286 | details: Unauthorized error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 287 | Forbidden: |
| 288 | description: Forbidden |
| 289 | content: |
| 290 | application/json: |
| 291 | schema: |
| 292 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 293 | example: |
| 294 | status: 403 |
| 295 | message: Forbidden error message |
| 296 | details: Forbidden error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 297 | BadRequest: |
| 298 | description: Bad Request |
| 299 | content: |
| 300 | application/json: |
| 301 | schema: |
| 302 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 303 | example: |
| 304 | status: 400 BAD_REQUEST |
| 305 | message: Bad request error message |
| 306 | details: Bad request error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 307 | Conflict: |
| 308 | description: Conflict |
| 309 | content: |
| 310 | application/json: |
| 311 | schema: |
| 312 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 313 | example: |
| 314 | status: 409 CONFLICT |
| 315 | message: Conflict error message |
| 316 | details: Conflict error details |
Hanif Kukkalli | 83e318f | 2021-02-23 12:26:39 +0100 | [diff] [blame] | 317 | NotImplemented: |
| 318 | description: The given path has not been implemented |
| 319 | content: |
| 320 | application/json: |
| 321 | schema: |
| 322 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 844cab3 | 2021-12-01 09:42:37 +0000 | [diff] [blame] | 323 | example: |
| 324 | status: 501 |
| 325 | message: Not implemented error message |
| 326 | details: Not implemented error details |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 327 | Ok: |
| 328 | description: OK |
| 329 | content: |
| 330 | application/json: |
| 331 | schema: |
| 332 | type: object |
| 333 | Created: |
| 334 | description: Created |
DylanB95EST | 4f4178c | 2021-07-02 13:30:42 +0100 | [diff] [blame] | 335 | content: {} |
Ruslan Kashapov | 9f52f60 | 2021-01-22 12:53:01 +0200 | [diff] [blame] | 336 | NoContent: |
| 337 | description: No Content |
| 338 | content: {} |