da1878fea86b85dc25faca8d2a971b8634a0e5e6
[cps.git] / cps-ncmp-rest / docs / openapi / components.yaml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Nordix Foundation
3 #  Modifications Copyright (C) 2021 Pantheon.tech
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
10 #
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
20 components:
21   schemas:
22     # Common Schemas
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
33
34     # Request Schemas
35     RestDmiPluginRegistration:
36       type: object
37       properties:
38         dmiPlugin:
39           type: string
40           example: onap-dmi-plugin
41         dmiDataPlugin:
42           type: string
43           example: onap-dmi-data-plugin
44         dmiModelPlugin:
45           type: string
46           example: onap-dmi-model-plugin
47         createdCmHandles:
48           type: array
49           items:
50             $ref: '#/components/schemas/RestCmHandle'
51         updatedCmHandles:
52           type: array
53           items:
54             $ref: '#/components/schemas/RestCmHandle'
55         removedCmHandles:
56           type: array
57           items:
58             type: string
59
60     RestCmHandle:
61       required:
62         - cmHandle
63       type: object
64       properties:
65         cmHandle:
66           type: string
67           example: cmHandle123
68         cmHandleProperties:
69             $ref: '#/components/schemas/RestCmHandleAdditionalProperties'
70     RestCmHandleAdditionalProperties:
71         type: object
72         additionalProperties:
73             type: string
74             example: system-001
75
76     Conditions:
77       type: object
78       properties:
79         conditions:
80           $ref: '#/components/schemas/ConditionsData'
81     ConditionsData:
82       type: array
83       items:
84         type: object
85         $ref: '#/components/schemas/ConditionProperties'
86     ConditionProperties:
87       properties:
88         name:
89           type: string
90           example: hasAllModules
91         conditionParameters:
92           $ref: '#/components/schemas/ModuleNamesAsJsonArray'
93     ModuleNamesAsJsonArray:
94       type: array
95       items:
96         type: object
97         $ref: '#/components/schemas/ModuleNameAsJsonObject'
98     ModuleNameAsJsonObject:
99         properties:
100           moduleName:
101             type: string
102             example: someModuleName
103
104     #Response Schemas
105     CmHandles:
106       type: object
107       properties:
108         cmHandles:
109           $ref: '#/components/schemas/CmHandleProperties'
110     CmHandleProperties:
111       type: array
112       items:
113         type: object
114         $ref: '#/components/schemas/CmHandleProperty'
115     CmHandleProperty:
116       properties:
117         cmHandleId:
118           type: string
119           example: someCmHandleId
120
121   parameters:
122     cmHandleInPath:
123       name: cm-handle
124       in: path
125       description: The identifier for a network function, network element, subnetwork or any other cm object by managed Network CM Proxy
126       required: true
127       schema:
128         type: string
129     xpathInQuery:
130       name: xpath
131       in: query
132       description: xpath
133       required: false
134       schema:
135         type: string
136         default: /
137     requiredXpathInQuery:
138       name: xpath
139       in: query
140       description: xpath
141       required: true
142       schema:
143         type: string
144     includeDescendantsOptionInQuery:
145       name: include-descendants
146       in: query
147       description: include-descendants
148       required: false
149       schema:
150         type: boolean
151         default: false
152     cpsPathInQuery:
153       name: cps-path
154       in: query
155       description: cps-path
156       required: false
157       schema:
158         type: string
159         default: /
160     resourceIdentifierInQuery:
161       name: resourceIdentifier
162       in: query
163       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.
164       required: true
165       allowReserved: true
166       schema:
167         type: string
168       examples:
169         sample1:
170           value:
171             resourceIdentifier: \parent\child
172         sample2:
173           value:
174             resourceIdentifier: \parent\listElement[key=value]
175         sample3:
176           value:
177             resourceIdentifier: \parent\listElement[key=value]\grandChild
178         sample4:
179           value:
180             resourceIdentifier: parent=1,child=abc
181     acceptParamInHeader:
182       name: Accept
183       in: header
184       required: false
185       description: Accept parameter for response, if accept parameter is null, that means client can accept any format.
186       schema:
187         type: string
188         enum: [ application/json, application/yang-data+json ]
189     optionsParamInQuery:
190       name: options
191       in: query
192       description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'.
193       required: false
194       schema:
195         type: string
196       allowReserved: true
197       examples:
198         sample1:
199           value:
200             options: (key1=value1,key2=value2)
201         sample2:
202           value:
203             options: (key1=value1,key2=value1/value2)
204         sample3:
205           value:
206             options: (key1=10,key2=value2,key3=[val31;val32])
207     contentParamInHeader:
208       name: Content-Type
209       in: header
210       required: false
211       description: Content parameter for request, if content parameter is null, default value is application/json.
212       schema:
213         type: string
214         default: application/json
215
216
217   responses:
218     NotFound:
219       description: The specified resource was not found
220       content:
221         application/json:
222           schema:
223             $ref: '#/components/schemas/ErrorMessage'
224     Unauthorized:
225       description: Unauthorized
226       content:
227         application/json:
228           schema:
229             $ref: '#/components/schemas/ErrorMessage'
230     Forbidden:
231       description: Forbidden
232       content:
233         application/json:
234           schema:
235             $ref: '#/components/schemas/ErrorMessage'
236     BadRequest:
237       description: Bad Request
238       content:
239         application/json:
240           schema:
241             $ref: '#/components/schemas/ErrorMessage'
242     Conflict:
243       description: Conflict
244       content:
245         application/json:
246           schema:
247             $ref: '#/components/schemas/ErrorMessage'
248     NotImplemented:
249       description: The given path has not been implemented
250       content:
251         application/json:
252           schema:
253             $ref: '#/components/schemas/ErrorMessage'
254     Ok:
255       description: OK
256       content:
257         application/json:
258           schema:
259             type: object
260     Created:
261       description: Created
262       content: {}
263     NoContent:
264       description: No Content
265       content: {}