Merge "Changing resource identifier to a query param"
[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     fieldsParamInQuery:
137       name: fields
138       in: query
139       description: Fields parameter to filter resource
140       required: false
141       schema:
142         type: string
143     depthParamInQuery:
144       name: depth
145       in: query
146       description: Depth parameter for response
147       required: false
148       schema:
149         type: integer
150         minimum: 1
151     contentParamInHeader:
152       name: Content-Type
153       in: header
154       required: false
155       description: Content parameter for request, if content parameter is null, default value is application/json.
156       schema:
157         type: string
158         default: application/json
159
160
161   responses:
162     NotFound:
163       description: The specified resource was not found
164       content:
165         application/json:
166           schema:
167             $ref: '#/components/schemas/ErrorMessage'
168     Unauthorized:
169       description: Unauthorized
170       content:
171         application/json:
172           schema:
173             $ref: '#/components/schemas/ErrorMessage'
174     Forbidden:
175       description: Forbidden
176       content:
177         application/json:
178           schema:
179             $ref: '#/components/schemas/ErrorMessage'
180     BadRequest:
181       description: Bad Request
182       content:
183         application/json:
184           schema:
185             $ref: '#/components/schemas/ErrorMessage'
186     Conflict:
187       description: Conflict
188       content:
189         application/json:
190           schema:
191             $ref: '#/components/schemas/ErrorMessage'
192     NotImplemented:
193       description: The given path has not been implemented
194       content:
195         application/json:
196           schema:
197             $ref: '#/components/schemas/ErrorMessage'
198     Ok:
199       description: OK
200       content:
201         application/json:
202           schema:
203             type: object
204     Created:
205       description: Created
206       content: {}
207     NoContent:
208       description: No Content
209       content: {}