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