Add Examples to DMI-Plugin API Spec
[cps/ncmp-dmi-plugin.git] / openapi / components.yml
1 components:
2   schemas:
3     ErrorMessage:
4       type: object
5       title: Error
6       properties:
7         status:
8           type: string
9         message:
10           type: string
11         details:
12           type: string
13
14     CmHandles:
15       type: object
16       properties:
17         cmHandles:
18           type: array
19           example: ["cmHandleId1","cmHandleId2","cmHandleId3"]
20           items:
21             type: string
22
23     ModuleReferencesRequest:
24       type: object
25       properties:
26         cmHandleProperties:
27           $ref: '#/components/schemas/cmHandleProperties'
28
29     ModuleResourcesReadRequest:
30       type: object
31       properties:
32         data:
33           type: object
34           properties:
35             modules:
36               type: array
37               items:
38                 type: object
39                 properties:
40                   name:
41                     type: string
42                     example: my-name
43                   revision:
44                     type: string
45                     example: my-revision
46         cmHandleProperties:
47           $ref: '#/components/schemas/cmHandleProperties'
48
49     ModuleSet:
50       type: object
51       properties:
52         schemas:
53           type: array
54           items:
55             type: object
56             properties:
57               moduleName:
58                 type: string
59                 example: my-module-name
60               revision:
61                 type: string
62                 example: my-revision
63               namespace:
64                 type: string
65                 example: my-namespace
66
67     YangResources:
68       type: array
69       items:
70         type: object
71         $ref: '#/components/schemas/YangResource'
72
73     YangResource:
74       properties:
75         yangSource:
76           type: string
77           example: my-yang-source
78         moduleName:
79           type: string
80           example: my-module-name
81         revision:
82           type: string
83           example: my-revision
84
85     DataAccessRequest:
86       type: object
87       properties:
88         operation:
89           type: string
90           enum: [ read, create, update, delete ]
91           example: read
92         dataType:
93           type: string
94           example: my-data-type
95         data:
96           type: string
97           example: my-data
98         cmHandleProperties:
99           $ref: '#/components/schemas/cmHandleProperties'
100
101     cmHandleProperties:
102       type: object
103       additionalProperties:
104         type: string
105         example: {"prop1":"value1","prop2":"value2"}
106
107   responses:
108     NoContent:
109       description: No Content
110       content: {}
111     BadRequest:
112       description: Bad Request
113       content:
114         application/json:
115           schema:
116             $ref: '#/components/schemas/ErrorMessage'
117           example:
118             status: 400
119             message: Bad Request
120             details: The provided request is not valid
121     Unauthorized:
122       description: Unauthorized
123       content:
124         application/json:
125           schema:
126             $ref: '#/components/schemas/ErrorMessage'
127           example:
128             status: 401
129             message: Unauthorized request
130             details: This request is unauthorized
131     Forbidden:
132       description: Forbidden
133       content:
134         application/json:
135           schema:
136             $ref: '#/components/schemas/ErrorMessage'
137           example:
138             status: 403
139             message: Request Forbidden
140             details: This request is forbidden
141     NotFound:
142       description: The specified resource was not found
143       content:
144         application/json:
145           schema:
146             $ref: '#/components/schemas/ErrorMessage'
147           example:
148             status: 404
149             message: Resource Not Found
150             details: The requested resource is not found
151     Conflict:
152       description: Conflict
153       content:
154         application/json:
155           schema:
156             $ref: '#/components/schemas/ErrorMessage'
157           example:
158             status: 409
159             message: Conflicting request
160             details: The request cannot be processed as the resource is in use.
161
162   parameters:
163     cmHandleInPath:
164       name: cmHandle
165       in: path
166       description: The identifier for a network function, network element, subnetwork, or any other cm object by managed Network CM Proxy
167       required: true
168       schema:
169         type: string
170         example: my-cm-handle
171
172     resourceIdentifierInQuery:
173       name: resourceIdentifier
174       in: query
175       description: Resource identifier to get/set the resource data
176       required: true
177       allowReserved: true
178       schema:
179         type: string
180         example: my-schema:my-node
181
182     acceptParamInHeader:
183       name: accept
184       in: header
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
190     optionsParamInQuery:
191       name: options
192       in: query
193       description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'.
194       required: false
195       schema:
196         type: string
197       allowReserved: true
198       examples:
199         sample1:
200           value:
201             options: (key1=value1,key2=value2)
202         sample2:
203           value:
204             options: (key1=value1,key2=value1/value2)
205         sample3:
206           value:
207             options: (key1=10,key2=value2,key3=val31,val32)