blob: 719282b3e7c211b7ee62dec03f9b235da16ec176 [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'
emaclee844cab32021-12-01 09:42:37 +000051 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
DylanB95EST31facc82021-08-18 17:12:25 +010052 updatedCmHandles:
53 type: array
54 items:
55 $ref: '#/components/schemas/RestCmHandle'
DylanB95ESTe999b022021-08-24 16:56:40 +010056 removedCmHandles:
57 type: array
58 items:
59 type: string
emaclee844cab32021-12-01 09:42:37 +000060 example: [my-cm-handle1, my-cm-handle2, my-cm-handle3]
DylanB95EST4f4178c2021-07-02 13:30:42 +010061
62 RestCmHandle:
63 required:
64 - cmHandle
65 type: object
66 properties:
67 cmHandle:
68 type: string
emaclee844cab32021-12-01 09:42:37 +000069 example: my-cm-handle
DylanB95EST4f4178c2021-07-02 13:30:42 +010070 cmHandleProperties:
71 $ref: '#/components/schemas/RestCmHandleAdditionalProperties'
72 RestCmHandleAdditionalProperties:
73 type: object
74 additionalProperties:
75 type: string
emaclee844cab32021-12-01 09:42:37 +000076 example: my-additional-property
Ruslan Kashapov9f52f602021-01-22 12:53:01 +020077
niamhcore66017b42021-10-19 11:07:02 +010078 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:
niamhcoreb0d93072021-10-28 13:39:24 +010094 $ref: '#/components/schemas/ModuleNamesAsJsonArray'
95 ModuleNamesAsJsonArray:
niamhcore66017b42021-10-19 11:07:02 +010096 type: array
97 items:
98 type: object
niamhcoreb0d93072021-10-28 13:39:24 +010099 $ref: '#/components/schemas/ModuleNameAsJsonObject'
emaclee844cab32021-12-01 09:42:37 +0000100 example: [my-module-1, my-module-2, my-module-3]
niamhcoreb0d93072021-10-28 13:39:24 +0100101 ModuleNameAsJsonObject:
niamhcore66017b42021-10-19 11:07:02 +0100102 properties:
103 moduleName:
104 type: string
emaclee844cab32021-12-01 09:42:37 +0000105 example: my-module
niamhcore66017b42021-10-19 11:07:02 +0100106
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
emaclee844cab32021-12-01 09:42:37 +0000122 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
niamhcore66017b42021-10-19 11:07:02 +0100161
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200162 parameters:
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100163 cmHandleInPath:
164 name: cm-handle
165 in: path
tragait34a94b92021-03-30 12:02:27 +0100166 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 +0100167 required: true
168 schema:
169 type: string
emaclee844cab32021-12-01 09:42:37 +0000170 example: my-cm-handle
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100171 xpathInQuery:
172 name: xpath
173 in: query
174 description: xpath
175 required: false
176 schema:
177 type: string
178 default: /
Ruslan Kashapov1baf48d2021-05-07 10:46:27 +0300179 requiredXpathInQuery:
180 name: xpath
181 in: query
182 description: xpath
183 required: true
184 schema:
185 type: string
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100186 includeDescendantsOptionInQuery:
187 name: include-descendants
188 in: query
189 description: include-descendants
190 required: false
191 schema:
192 type: boolean
193 default: false
niamhcoreb5d573b2021-02-26 10:13:48 +0000194 cpsPathInQuery:
195 name: cps-path
196 in: query
197 description: cps-path
198 required: false
199 schema:
200 type: string
201 default: /
niamhcorefd2e6dd2021-09-29 16:43:35 +0100202 resourceIdentifierInQuery:
tragaitc3285512021-08-16 15:12:36 +0100203 name: resourceIdentifier
niamhcorefd2e6dd2021-09-29 16:43:35 +0100204 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.
tragaitc3285512021-08-16 15:12:36 +0100206 required: true
niamhcorefd2e6dd2021-09-29 16:43:35 +0100207 allowReserved: true
tragaitc3285512021-08-16 15:12:36 +0100208 schema:
209 type: string
niamhcorefd2e6dd2021-09-29 16:43:35 +0100210 examples:
emaclee844cab32021-12-01 09:42:37 +0000211 sample 1:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100212 value:
emaclee844cab32021-12-01 09:42:37 +0000213 resourceIdentifier: \shops\bookstore
214 sample 2:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100215 value:
emaclee844cab32021-12-01 09:42:37 +0000216 resourceIdentifier: \shops\bookstore\categories[@code=1]
217 sample 3:
niamhcorefd2e6dd2021-09-29 16:43:35 +0100218 value:
emaclee844cab32021-12-01 09:42:37 +0000219 resourceIdentifier: parent=shops,child=bookstore
tragaitc3285512021-08-16 15:12:36 +0100220 acceptParamInHeader:
tragaitc584bf22021-08-20 15:45:58 +0100221 name: Accept
tragaitc3285512021-08-16 15:12:36 +0100222 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 ]
tragaitabdff1b2021-10-06 11:04:18 +0100228 optionsParamInQuery:
229 name: options
tragaitc3285512021-08-16 15:12:36 +0100230 in: query
emaclee844cab32021-12-01 09:42:37 +0000231 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 +0100232 required: false
233 schema:
234 type: string
tragaitabdff1b2021-10-06 11:04:18 +0100235 allowReserved: true
236 examples:
emaclee844cab32021-12-01 09:42:37 +0000237 sample 1:
tragaitabdff1b2021-10-06 11:04:18 +0100238 value:
emaclee844cab32021-12-01 09:42:37 +0000239 options: (depth=3)
240 sample 2:
tragaitabdff1b2021-10-06 11:04:18 +0100241 value:
emaclee844cab32021-12-01 09:42:37 +0000242 options: (fields=book)
243 sample 3:
tragaitabdff1b2021-10-06 11:04:18 +0100244 value:
emaclee844cab32021-12-01 09:42:37 +0000245 options: (depth=2,fields=book/authors)
tragaitc584bf22021-08-20 15:45:58 +0100246 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
emaclee844cab32021-12-01 09:42:37 +0000254 example: application/yang-data+json
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200255
256 responses:
257 NotFound:
258 description: The specified resource was not found
259 content:
260 application/json:
261 schema:
262 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000263 example:
264 status: 400
265 message: Not found error message
266 details: Not found error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200267 Unauthorized:
268 description: Unauthorized
269 content:
270 application/json:
271 schema:
272 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000273 example:
274 status: 401
275 message: Unauthorized error message
276 details: Unauthorized error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200277 Forbidden:
278 description: Forbidden
279 content:
280 application/json:
281 schema:
282 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000283 example:
284 status: 403
285 message: Forbidden error message
286 details: Forbidden error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200287 BadRequest:
288 description: Bad Request
289 content:
290 application/json:
291 schema:
292 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000293 example:
294 status: 400 BAD_REQUEST
295 message: Bad request error message
296 details: Bad request error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200297 Conflict:
298 description: Conflict
299 content:
300 application/json:
301 schema:
302 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000303 example:
304 status: 409 CONFLICT
305 message: Conflict error message
306 details: Conflict error details
Hanif Kukkalli83e318f2021-02-23 12:26:39 +0100307 NotImplemented:
308 description: The given path has not been implemented
309 content:
310 application/json:
311 schema:
312 $ref: '#/components/schemas/ErrorMessage'
emaclee844cab32021-12-01 09:42:37 +0000313 example:
314 status: 501
315 message: Not implemented error message
316 details: Not implemented error details
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200317 Ok:
318 description: OK
319 content:
320 application/json:
321 schema:
322 type: object
323 Created:
324 description: Created
DylanB95EST4f4178c2021-07-02 13:30:42 +0100325 content: {}
Ruslan Kashapov9f52f602021-01-22 12:53:01 +0200326 NoContent:
327 description: No Content
328 content: {}