Update openAPI documentation for release process
[cps.git] / docs / api / swagger / ncmp / openapi-inventory.yaml
1 openapi: 3.0.1
2 info:
3   title: NCMP Inventory API
4   description: NCMP Inventory API
5   version: "1.0"
6 servers:
7   - url: /ncmpInventory
8 security:
9   - basicAuth: []
10 paths:
11   /v1/ch:
12     post:
13       tags:
14         - network-cm-proxy-inventory
15       summary: DMI notifies NCMP of new CM Handles
16       description: "Register a DMI Plugin with any new, updated or removed CM Handles."
17       operationId: updateDmiPluginRegistration
18       requestBody:
19         content:
20           application/json:
21             schema:
22               $ref: '#/components/schemas/RestDmiPluginRegistration'
23         required: true
24       responses:
25         "200":
26           description: No Content
27           content: {}
28         "400":
29           description: Bad Request
30           content:
31             application/json:
32               schema:
33                 $ref: '#/components/schemas/ErrorMessage'
34               example:
35                 status: 400 BAD_REQUEST
36                 message: Bad request error message
37                 details: Bad request error details
38         "401":
39           description: Unauthorized
40           content:
41             application/json:
42               schema:
43                 $ref: '#/components/schemas/ErrorMessage'
44               example:
45                 status: 401
46                 message: Unauthorized error message
47                 details: Unauthorized error details
48         "403":
49           description: Forbidden
50           content:
51             application/json:
52               schema:
53                 $ref: '#/components/schemas/ErrorMessage'
54               example:
55                 status: 403
56                 message: Forbidden error message
57                 details: Forbidden error details
58         "500":
59           description: Partial or Complete failure. The error details are provided
60             in the response body and all supported error codes are documented in the
61             example.
62           content:
63             application/json:
64               schema:
65                 $ref: '#/components/schemas/DmiPluginRegistrationErrorResponse'
66               example:
67                 failedCreatedCmHandles:
68                   - cmHandle: my-cm-handle-01
69                     errorCode: "00"
70                     errorText: Unknown error. <error-details>
71                   - cmHandle: my-cm-handle-02
72                     errorCode: "01"
73                     errorText: cm-handle already exists
74                   - cmHandle: my-cm-handle-03
75                     errorCode: "03"
76                     errorText: cm-handle has an invalid character(s) in id
77                 failedUpdatedCmHandles:
78                   - cmHandle: my-cm-handle-01
79                     errorCode: "00"
80                     errorText: Unknown error. <error-details>
81                   - cmHandle: my-cm-handle-02
82                     errorCode: "02"
83                     errorText: cm-handle does not exist
84                   - cmHandle: my-cm-handle-03
85                     errorCode: "03"
86                     errorText: cm-handle has an invalid character(s) in id
87                 failedRemovedCmHandles:
88                   - cmHandle: my-cm-handle-01
89                     errorCode: "00"
90                     errorText: Unknown error. <error-details>
91                   - cmHandle: my-cm-handle-02
92                     errorCode: "02"
93                     errorText: cm-handle does not exists
94                   - cmHandle: my-cm-handle-03
95                     errorCode: "03"
96                     errorText: cm-handle has an invalid character(s) in id
97   /v1/ch/cmHandles:
98     get:
99       tags:
100         - network-cm-proxy-inventory
101       summary: "Get all cm handle IDs for a registered DMI plugin (DMI plugin, DMI\
102         \ data plugin, DMI model plugin)"
103       description: Get all cm handle IDs for a registered DMI plugin
104       operationId: getAllCmHandleIdsForRegisteredDmi
105       parameters:
106         - name: dmi-plugin-identifier
107           in: query
108           description: dmi-plugin-identifier
109           required: true
110           schema:
111             type: string
112             example: my-dmi-plugin
113       responses:
114         "200":
115           description: OK
116           content:
117             application/json:
118               schema:
119                 type: array
120                 items:
121                   type: string
122         "401":
123           description: Unauthorized
124           content:
125             application/json:
126               schema:
127                 $ref: '#/components/schemas/ErrorMessage'
128               example:
129                 status: 401
130                 message: Unauthorized error message
131                 details: Unauthorized error details
132         "403":
133           description: Forbidden
134           content:
135             application/json:
136               schema:
137                 $ref: '#/components/schemas/ErrorMessage'
138               example:
139                 status: 403
140                 message: Forbidden error message
141                 details: Forbidden error details
142         "500":
143           description: Internal Server Error
144           content:
145             application/json:
146               schema:
147                 $ref: '#/components/schemas/ErrorMessage'
148               example:
149                 status: 500
150                 message: Internal Server Error
151                 details: Internal Server Error occurred
152   /v1/ch/searches:
153     post:
154       tags:
155         - network-cm-proxy-inventory
156       summary: Query for CM Handle IDs
157       description: "Query and get CMHandleIds for additional properties, public properties\
158         \ and registered DMI plugin (DMI plugin, DMI data plugin, DMI model plugin)."
159       operationId: searchCmHandleIds
160       requestBody:
161         content:
162           application/json:
163             schema:
164               $ref: '#/components/schemas/CmHandleQueryParameters'
165         required: true
166       responses:
167         "200":
168           description: OK
169           content:
170             application/json:
171               schema:
172                 type: array
173                 items:
174                   type: string
175         "401":
176           description: Unauthorized
177           content:
178             application/json:
179               schema:
180                 $ref: '#/components/schemas/ErrorMessage'
181               example:
182                 status: 401
183                 message: Unauthorized error message
184                 details: Unauthorized error details
185         "403":
186           description: Forbidden
187           content:
188             application/json:
189               schema:
190                 $ref: '#/components/schemas/ErrorMessage'
191               example:
192                 status: 403
193                 message: Forbidden error message
194                 details: Forbidden error details
195         "500":
196           description: Internal Server Error
197           content:
198             application/json:
199               schema:
200                 $ref: '#/components/schemas/ErrorMessage'
201               example:
202                 status: 500
203                 message: Internal Server Error
204                 details: Internal Server Error occurred
205 components:
206   schemas:
207     RestDmiPluginRegistration:
208       type: object
209       properties:
210         dmiPlugin:
211           type: string
212           example: my-dmi-plugin
213           default: ""
214         dmiDataPlugin:
215           type: string
216           example: my-dmi-data-plugin
217           default: ""
218         dmiModelPlugin:
219           type: string
220           example: my-dmi-model-plugin
221           default: ""
222         createdCmHandles:
223           type: array
224           items:
225             $ref: '#/components/schemas/RestInputCmHandle'
226         updatedCmHandles:
227           type: array
228           items:
229             $ref: '#/components/schemas/RestInputCmHandle'
230         removedCmHandles:
231           type: array
232           example:
233             - my-cm-handle1
234             - my-cm-handle2
235             - my-cm-handle3
236           items:
237             type: string
238     RestInputCmHandle:
239       required:
240         - cmHandle
241       type: object
242       properties:
243         cmHandle:
244           type: string
245           example: my-cm-handle
246         cmHandleProperties:
247           $ref: '#/components/schemas/RestCmHandleProperties'
248         publicCmHandleProperties:
249           $ref: '#/components/schemas/RestCmHandleProperties'
250     RestCmHandleProperties:
251       type: object
252       additionalProperties:
253         type: string
254         example: my-property
255     ErrorMessage:
256       title: Error
257       type: object
258       properties:
259         status:
260           type: string
261         message:
262           type: string
263         details:
264           type: string
265     DmiPluginRegistrationErrorResponse:
266       type: object
267       properties:
268         failedCreatedCmHandles:
269           type: array
270           items:
271             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
272         failedUpdatedCmHandles:
273           type: array
274           items:
275             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
276         failedRemovedCmHandles:
277           type: array
278           items:
279             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
280     CmHandlerRegistrationErrorResponse:
281       type: object
282       properties:
283         cmHandle:
284           type: string
285           example: my-cm-handle
286         errorCode:
287           type: string
288           example: "00"
289         errorText:
290           type: string
291           example: Unknown error. <error-details>
292     CmHandleQueryParameters:
293       title: Cm Handle query parameters for executing cm handle search
294       type: object
295       properties:
296         cmHandleQueryParameters:
297           type: array
298           items:
299             $ref: '#/components/schemas/ConditionProperties'
300         conditions:
301           type: array
302           description: "not necessary, it is just for backward compatibility"
303           deprecated: true
304           items:
305             $ref: '#/components/schemas/OldConditionProperties'
306     ConditionProperties:
307       properties:
308         conditionName:
309           type: string
310         conditionParameters:
311           type: array
312           items:
313             type: object
314             additionalProperties:
315               type: string
316     OldConditionProperties:
317       properties:
318         name:
319           type: string
320         conditionParameters:
321           type: array
322           items:
323             $ref: '#/components/schemas/ModuleNameAsJsonObject'
324       deprecated: true
325     ModuleNameAsJsonObject:
326       properties:
327         moduleName:
328           type: string
329           example: my-module
330   securitySchemes:
331     basicAuth:
332       type: http
333       scheme: basic