Merge "Update Release Notes Section of Documentation"
[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     ErrorMessage:
23       type: object
24       title: Error
25       properties:
26         status:
27           type: string
28         message:
29           type: string
30         details:
31           type: string
32
33     RestDmiPluginRegistration:
34       type: object
35       properties:
36         dmiPlugin:
37           type: string
38           example: onap-dmi-plugin
39         createdCmHandles:
40           type: array
41           items:
42             $ref: '#/components/schemas/RestCmHandle'
43         updatedCmHandles:
44           type: array
45           items:
46             $ref: '#/components/schemas/RestCmHandle'
47         removedCmHandles:
48           type: array
49           items:
50             type: string
51
52     RestCmHandle:
53       required:
54         - cmHandle
55       type: object
56       properties:
57         cmHandle:
58           type: string
59           example: cmHandle123
60         cmHandleProperties:
61             $ref: '#/components/schemas/RestCmHandleAdditionalProperties'
62     RestCmHandleAdditionalProperties:
63         type: object
64         additionalProperties:
65             type: string
66             example: system-001
67
68   parameters:
69     cmHandleInPath:
70       name: cm-handle
71       in: path
72       description: The identifier for a network function, network element, subnetwork or any other cm object by managed Network CM Proxy
73       required: true
74       schema:
75         type: string
76     xpathInQuery:
77       name: xpath
78       in: query
79       description: xpath
80       required: false
81       schema:
82         type: string
83         default: /
84     requiredXpathInQuery:
85       name: xpath
86       in: query
87       description: xpath
88       required: true
89       schema:
90         type: string
91     includeDescendantsOptionInQuery:
92       name: include-descendants
93       in: query
94       description: include-descendants
95       required: false
96       schema:
97         type: boolean
98         default: false
99     cpsPathInQuery:
100       name: cps-path
101       in: query
102       description: cps-path
103       required: false
104       schema:
105         type: string
106         default: /
107     resourceIdentifierInQuery:
108       name: resourceIdentifier
109       in: query
110       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.
111       required: true
112       allowReserved: true
113       schema:
114         type: string
115       examples:
116         sample1:
117           value:
118             resourceIdentifier: \parent\child
119         sample2:
120           value:
121             resourceIdentifier: \parent\listElement[key=value]
122         sample3:
123           value:
124             resourceIdentifier: \parent\listElement[key=value]\grandChild
125         sample4:
126           value:
127             resourceIdentifier: parent=1,child=abc
128     acceptParamInHeader:
129       name: Accept
130       in: header
131       required: false
132       description: Accept parameter for response, if accept parameter is null, that means client can accept any format.
133       schema:
134         type: string
135         enum: [ application/json, application/yang-data+json ]
136     optionsParamInQuery:
137       name: options
138       in: query
139       description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'.
140       required: false
141       schema:
142         type: string
143       allowReserved: true
144       examples:
145         sample1:
146           value:
147             options: (key1=value1,key2=value2)
148         sample2:
149           value:
150             options: (key1=value1,key2=value1/value2)
151         sample3:
152           value:
153             options: (key1=10,key2=value2,key3=[val31;val32])
154     contentParamInHeader:
155       name: Content-Type
156       in: header
157       required: false
158       description: Content parameter for request, if content parameter is null, default value is application/json.
159       schema:
160         type: string
161         default: application/json
162
163
164   responses:
165     NotFound:
166       description: The specified resource was not found
167       content:
168         application/json:
169           schema:
170             $ref: '#/components/schemas/ErrorMessage'
171     Unauthorized:
172       description: Unauthorized
173       content:
174         application/json:
175           schema:
176             $ref: '#/components/schemas/ErrorMessage'
177     Forbidden:
178       description: Forbidden
179       content:
180         application/json:
181           schema:
182             $ref: '#/components/schemas/ErrorMessage'
183     BadRequest:
184       description: Bad Request
185       content:
186         application/json:
187           schema:
188             $ref: '#/components/schemas/ErrorMessage'
189     Conflict:
190       description: Conflict
191       content:
192         application/json:
193           schema:
194             $ref: '#/components/schemas/ErrorMessage'
195     NotImplemented:
196       description: The given path has not been implemented
197       content:
198         application/json:
199           schema:
200             $ref: '#/components/schemas/ErrorMessage'
201     Ok:
202       description: OK
203       content:
204         application/json:
205           schema:
206             type: object
207     Created:
208       description: Created
209       content: {}
210     NoContent:
211       description: No Content
212       content: {}