blob: d9bd49a09700524b5adc8103ae70e4cefff7116d [file] [log] [blame]
tragait34a94b92021-03-30 12:02:27 +01001# ============LICENSE_START=======================================================
lukegleeson15b93e72021-07-07 15:25:30 +01002# Copyright (C) 2021 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
53 items:
54 $ref: '#/components/schemas/RestCmHandle'
DylanB95ESTe999b022021-08-24 16:56:40 +010055 removedCmHandles:
56 type: array
57 items:
58 type: string
emaclee844cab32021-12-01 09:42:37 +000059 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
DylanB95EST4f4178c2021-07-02 13:30:42 +010060
61 RestCmHandle:
62 required:
63 - cmHandle
64 type: object
65 properties:
66 cmHandle:
67 type: string
emaclee844cab32021-12-01 09:42:37 +000068 example: my-cm-handle
DylanB95EST4f4178c2021-07-02 13:30:42 +010069 cmHandleProperties:
70 $ref: '#/components/schemas/RestCmHandleAdditionalProperties'
71 RestCmHandleAdditionalProperties:
72 type: object
73 additionalProperties:
74 type: string
emaclee844cab32021-12-01 09:42:37 +000075 example: my-additional-property
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020076
niamhcore66017b42021-10-19 11:07:02 +010077 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:
niamhcoreb0d93072021-10-28 13:39:24 +010093 $ref: '#/components/schemas/ModuleNamesAsJsonArray'
94 ModuleNamesAsJsonArray:
niamhcore66017b42021-10-19 11:07:02 +010095 type: array
96 items:
97 type: object
niamhcoreb0d93072021-10-28 13:39:24 +010098 $ref: '#/components/schemas/ModuleNameAsJsonObject'
emaclee844cab32021-12-01 09:42:37 +000099 example: [my-module-1, my-module-2, my-module-3]
niamhcoreb0d93072021-10-28 13:39:24 +0100100 ModuleNameAsJsonObject:
niamhcore66017b42021-10-19 11:07:02 +0100101 properties:
102 moduleName:
103 type: string
emaclee844cab32021-12-01 09:42:37 +0000104 example: my-module
niamhcore66017b42021-10-19 11:07:02 +0100105
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
emaclee844cab32021-12-01 09:42:37 +0000121 example: my-cm-handle-id
122
puthuparambil.adityad0007332021-12-08 18:53:39 +0000123 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
emaclee844cab32021-12-01 09:42:37 +0000134 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
emaclee844cab32021-12-01 09:42:37 +0000147 - 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.adityad0007332021-12-08 18:53:39 +0000162 - authors:
163 - Iain M. Banks
164 - Ursula K. Le Guin
emaclee844cab32021-12-01 09:42:37 +0000165 name: SciFi
166 - code: '02'
167 books:
puthuparambil.adityad0007332021-12-08 18:53:39 +0000168 - authors:
169 - Philip Pullman
emaclee844cab32021-12-01 09:42:37 +0000170 name: kids
niamhcore66017b42021-10-19 11:07:02 +0100171
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200172 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100173 cmHandleInPath:
174 name: cm-handle
175 in: path
tragait34a94b92021-03-30 12:02:27 +0100176 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 +0100177 required: true
178 schema:
179 type: string
emaclee844cab32021-12-01 09:42:37 +0000180 example: my-cm-handle
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100181 xpathInQuery:
182 name: xpath
183 in: query
184 description: xpath
185 required: false
186 schema:
187 type: string
188 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300189 requiredXpathInQuery:
190 name: xpath
191 in: query
192 description: xpath
193 required: true
194 schema:
195 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100196 includeDescendantsOptionInQuery:
197 name: include-descendants
198 in: query
199 description: include-descendants
200 required: false
201 schema:
202 type: boolean
203 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000204 cpsPathInQuery:
205 name: cps-path
206 in: query
207 description: cps-path
208 required: false
209 schema:
210 type: string
211 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100212 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100213 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100214 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.
tragaitc3285512021-08-16 15:12:36 +0100216 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100217 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100218 schema:
219 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100220 examples:
emaclee844cab32021-12-01 09:42:37 +0000221 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100222 value:
emaclee844cab32021-12-01 09:42:37 +0000223 resourceIdentifier: \shops\bookstore
224 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100225 value:
emaclee844cab32021-12-01 09:42:37 +0000226 resourceIdentifier: \shops\bookstore\categories[@code=1]
227 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100228 value:
emaclee844cab32021-12-01 09:42:37 +0000229 resourceIdentifier: parent=shops,child=bookstore
tragaitc3285512021-08-16 15:12:36 +0100230 acceptParamInHeader:
tragaitc584bf22021-08-20 15:45:58 +0100231 name: Accept
tragaitc3285512021-08-16 15:12:36 +0100232 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 ]
tragaitabdff1b2021-10-06 11:04:18 +0100238 optionsParamInQuery:
239 name: options
tragaitc3285512021-08-16 15:12:36 +0100240 in: query
emaclee844cab32021-12-01 09:42:37 +0000241 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 +0100242 required: false
243 schema:
244 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100245 allowReserved: true
246 examples:
emaclee844cab32021-12-01 09:42:37 +0000247 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100248 value:
emaclee844cab32021-12-01 09:42:37 +0000249 options: (depth=3)
250 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100251 value:
emaclee844cab32021-12-01 09:42:37 +0000252 options: (fields=book)
253 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100254 value:
emaclee844cab32021-12-01 09:42:37 +0000255 options: (depth=2,fields=book/authors)
tragaitc584bf22021-08-20 15:45:58 +0100256 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
emaclee844cab32021-12-01 09:42:37 +0000264 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200265
266 responses:
267 NotFound:
268 description: The specified resource was not found
269 content:
270 application/json:
271 schema:
272 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000273 example:
274 status: 400
275 message: Not found error message
276 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200277 Unauthorized:
278 description: Unauthorized
279 content:
280 application/json:
281 schema:
282 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000283 example:
284 status: 401
285 message: Unauthorized error message
286 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200287 Forbidden:
288 description: Forbidden
289 content:
290 application/json:
291 schema:
292 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000293 example:
294 status: 403
295 message: Forbidden error message
296 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200297 BadRequest:
298 description: Bad Request
299 content:
300 application/json:
301 schema:
302 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000303 example:
304 status: 400 BAD_REQUEST
305 message: Bad request error message
306 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200307 Conflict:
308 description: Conflict
309 content:
310 application/json:
311 schema:
312 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000313 example:
314 status: 409 CONFLICT
315 message: Conflict error message
316 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100317 NotImplemented:
318 description: The given path has not been implemented
319 content:
320 application/json:
321 schema:
322 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000323 example:
324 status: 501
325 message: Not implemented error message
326 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200327 Ok:
328 description: OK
329 content:
330 application/json:
331 schema:
332 type: object
333 Created:
334 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100335 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200336 NoContent:
337 description: No Content
338 content: {}