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