9f64f58cb745ef90f079a0ad16f4d765ff8327f0
[cps.git] / docs / api / swagger / ncmp / openapi-inventory.yaml
1 openapi: 3.0.3
2 info:
3   description: NCMP Inventory API
4   title: NCMP Inventory API
5   version: "1.0"
6 servers:
7 - url: /ncmpInventory
8 security:
9 - basicAuth: []
10 paths:
11   /v1/ch:
12     post:
13       description: "Register a DMI Plugin with any new, updated or removed CM Handles."
14       operationId: updateDmiPluginRegistration
15       requestBody:
16         content:
17           application/json:
18             schema:
19               $ref: '#/components/schemas/RestDmiPluginRegistration'
20         required: true
21       responses:
22         "200":
23           content: {}
24           description: No Content
25         "400":
26           content:
27             application/json:
28               example:
29                 status: 400 BAD_REQUEST
30                 message: Bad request error message
31                 details: Bad request error details
32               schema:
33                 $ref: '#/components/schemas/ErrorMessage'
34           description: Bad Request
35         "401":
36           content:
37             application/json:
38               example:
39                 status: 401
40                 message: Unauthorized error message
41                 details: Unauthorized error details
42               schema:
43                 $ref: '#/components/schemas/ErrorMessage'
44           description: Unauthorized
45         "403":
46           content:
47             application/json:
48               example:
49                 status: 403
50                 message: Forbidden error message
51                 details: Forbidden error details
52               schema:
53                 $ref: '#/components/schemas/ErrorMessage'
54           description: Forbidden
55         "500":
56           content:
57             application/json:
58               example:
59                 failedCreatedCmHandles:
60                 - cmHandle: my-cm-handle-01
61                   errorCode: "00"
62                   errorText: Unknown error. <error-details>
63                 - cmHandle: my-cm-handle-02
64                   errorCode: "01"
65                   errorText: cm-handle already exists
66                 - cmHandle: my-cm-handle-03
67                   errorCode: "03"
68                   errorText: cm-handle has an invalid character(s) in id
69                 failedUpdatedCmHandles:
70                 - cmHandle: my-cm-handle-01
71                   errorCode: "00"
72                   errorText: Unknown error. <error-details>
73                 - cmHandle: my-cm-handle-02
74                   errorCode: "02"
75                   errorText: cm-handle does not exist
76                 - cmHandle: my-cm-handle-03
77                   errorCode: "03"
78                   errorText: cm-handle has an invalid character(s) in id
79                 failedRemovedCmHandles:
80                 - cmHandle: my-cm-handle-01
81                   errorCode: "00"
82                   errorText: Unknown error. <error-details>
83                 - cmHandle: my-cm-handle-02
84                   errorCode: "02"
85                   errorText: cm-handle does not exists
86                 - cmHandle: my-cm-handle-03
87                   errorCode: "03"
88                   errorText: cm-handle has an invalid character(s) in id
89               schema:
90                 $ref: '#/components/schemas/DmiPluginRegistrationErrorResponse'
91           description: Partial or Complete failure. The error details are provided
92             in the response body and all supported error codes are documented in the
93             example.
94       summary: DMI notifies NCMP of new CM Handles
95       tags:
96       - network-cm-proxy-inventory
97   /v1/ch/cmHandles:
98     get:
99       description: Get all cm handle IDs for a registered DMI plugin
100       operationId: getAllCmHandleIdsForRegisteredDmi
101       parameters:
102       - description: dmi-plugin-identifier
103         in: query
104         name: dmi-plugin-identifier
105         required: true
106         schema:
107           example: my-dmi-plugin
108           type: string
109       responses:
110         "200":
111           content:
112             application/json:
113               schema:
114                 items:
115                   type: string
116                 type: array
117           description: OK
118         "401":
119           content:
120             application/json:
121               example:
122                 status: 401
123                 message: Unauthorized error message
124                 details: Unauthorized error details
125               schema:
126                 $ref: '#/components/schemas/ErrorMessage'
127           description: Unauthorized
128         "403":
129           content:
130             application/json:
131               example:
132                 status: 403
133                 message: Forbidden error message
134                 details: Forbidden error details
135               schema:
136                 $ref: '#/components/schemas/ErrorMessage'
137           description: Forbidden
138         "500":
139           content:
140             application/json:
141               example:
142                 status: 500
143                 message: Internal Server Error
144                 details: Internal Server Error occurred
145               schema:
146                 $ref: '#/components/schemas/ErrorMessage'
147           description: Internal Server Error
148       summary: "Get all cm handle IDs for a registered DMI plugin (DMI plugin, DMI\
149         \ data plugin, DMI model plugin)"
150       tags:
151       - network-cm-proxy-inventory
152   /v1/ch/searches:
153     post:
154       description: "Query and get CMHandleIds for additional properties, public properties\
155         \ and registered DMI plugin (DMI plugin, DMI data plugin, DMI model plugin)."
156       operationId: searchCmHandleIds
157       requestBody:
158         content:
159           application/json:
160             schema:
161               $ref: '#/components/schemas/CmHandleQueryParameters'
162         required: true
163       responses:
164         "200":
165           content:
166             application/json:
167               schema:
168                 items:
169                   type: string
170                 type: array
171           description: OK
172         "401":
173           content:
174             application/json:
175               example:
176                 status: 401
177                 message: Unauthorized error message
178                 details: Unauthorized error details
179               schema:
180                 $ref: '#/components/schemas/ErrorMessage'
181           description: Unauthorized
182         "403":
183           content:
184             application/json:
185               example:
186                 status: 403
187                 message: Forbidden error message
188                 details: Forbidden error details
189               schema:
190                 $ref: '#/components/schemas/ErrorMessage'
191           description: Forbidden
192         "500":
193           content:
194             application/json:
195               example:
196                 status: 500
197                 message: Internal Server Error
198                 details: Internal Server Error occurred
199               schema:
200                 $ref: '#/components/schemas/ErrorMessage'
201           description: Internal Server Error
202       summary: Query for CM Handle IDs
203       tags:
204       - network-cm-proxy-inventory
205 components:
206   parameters:
207     dmiPluginIdentifierInQuery:
208       description: dmi-plugin-identifier
209       in: query
210       name: dmi-plugin-identifier
211       required: true
212       schema:
213         example: my-dmi-plugin
214         type: string
215   responses:
216     NoContent:
217       content: {}
218       description: No Content
219     BadRequest:
220       content:
221         application/json:
222           example:
223             status: 400 BAD_REQUEST
224             message: Bad request error message
225             details: Bad request error details
226           schema:
227             $ref: '#/components/schemas/ErrorMessage'
228       description: Bad Request
229     Unauthorized:
230       content:
231         application/json:
232           example:
233             status: 401
234             message: Unauthorized error message
235             details: Unauthorized error details
236           schema:
237             $ref: '#/components/schemas/ErrorMessage'
238       description: Unauthorized
239     Forbidden:
240       content:
241         application/json:
242           example:
243             status: 403
244             message: Forbidden error message
245             details: Forbidden error details
246           schema:
247             $ref: '#/components/schemas/ErrorMessage'
248       description: Forbidden
249     InternalServerError:
250       content:
251         application/json:
252           example:
253             status: 500
254             message: Internal Server Error
255             details: Internal Server Error occurred
256           schema:
257             $ref: '#/components/schemas/ErrorMessage'
258       description: Internal Server Error
259   schemas:
260     RestDmiPluginRegistration:
261       example:
262         updatedCmHandles:
263         - cmHandle: my-cm-handle
264           publicCmHandleProperties:
265             key: my-property
266           cmHandleProperties:
267             key: my-property
268           moduleSetTag: my-module-set-tag
269           trustLevel: COMPLETE
270         - cmHandle: my-cm-handle
271           publicCmHandleProperties:
272             key: my-property
273           cmHandleProperties:
274             key: my-property
275           moduleSetTag: my-module-set-tag
276           trustLevel: COMPLETE
277         createdCmHandles:
278         - cmHandle: my-cm-handle
279           publicCmHandleProperties:
280             key: my-property
281           cmHandleProperties:
282             key: my-property
283           moduleSetTag: my-module-set-tag
284           trustLevel: COMPLETE
285         - cmHandle: my-cm-handle
286           publicCmHandleProperties:
287             key: my-property
288           cmHandleProperties:
289             key: my-property
290           moduleSetTag: my-module-set-tag
291           trustLevel: COMPLETE
292         dmiPlugin: my-dmi-plugin
293         dmiModelPlugin: my-dmi-model-plugin
294         upgradedCmHandles:
295           cmHandles:
296           - my-cm-handle1
297           - my-cm-handle2
298           - my-cm-handle3
299           moduleSetTag: my-module-set-tag
300         dmiDataPlugin: my-dmi-data-plugin
301         removedCmHandles:
302         - my-cm-handle1
303         - my-cm-handle2
304         - my-cm-handle3
305       properties:
306         dmiPlugin:
307           default: ""
308           example: my-dmi-plugin
309           type: string
310         dmiDataPlugin:
311           default: ""
312           example: my-dmi-data-plugin
313           type: string
314         dmiModelPlugin:
315           default: ""
316           example: my-dmi-model-plugin
317           type: string
318         createdCmHandles:
319           items:
320             $ref: '#/components/schemas/RestInputCmHandle'
321           type: array
322         updatedCmHandles:
323           items:
324             $ref: '#/components/schemas/RestInputCmHandle'
325           type: array
326         removedCmHandles:
327           example:
328           - my-cm-handle1
329           - my-cm-handle2
330           - my-cm-handle3
331           items:
332             type: string
333           type: array
334         upgradedCmHandles:
335           $ref: '#/components/schemas/UpgradedCmHandles'
336       type: object
337     RestInputCmHandle:
338       example:
339         cmHandle: my-cm-handle
340         publicCmHandleProperties:
341           key: my-property
342         cmHandleProperties:
343           key: my-property
344         moduleSetTag: my-module-set-tag
345         trustLevel: COMPLETE
346       properties:
347         cmHandle:
348           example: my-cm-handle
349           type: string
350         cmHandleProperties:
351           additionalProperties:
352             example: my-property
353             type: string
354           type: object
355         publicCmHandleProperties:
356           additionalProperties:
357             example: my-property
358             type: string
359           type: object
360         moduleSetTag:
361           example: my-module-set-tag
362           type: string
363         trustLevel:
364           enum:
365           - COMPLETE
366           - NONE
367           example: COMPLETE
368           type: string
369       required:
370       - cmHandle
371       type: object
372     RestCmHandleProperties:
373       additionalProperties:
374         example: my-property
375         type: string
376       type: object
377     UpgradedCmHandles:
378       example:
379         cmHandles:
380         - my-cm-handle1
381         - my-cm-handle2
382         - my-cm-handle3
383         moduleSetTag: my-module-set-tag
384       properties:
385         cmHandles:
386           example:
387           - my-cm-handle1
388           - my-cm-handle2
389           - my-cm-handle3
390           items:
391             type: string
392           type: array
393         moduleSetTag:
394           example: my-module-set-tag
395           type: string
396       required:
397       - cmHandles
398       type: object
399     ErrorMessage:
400       properties:
401         status:
402           type: string
403         message:
404           type: string
405         details:
406           type: string
407       title: Error
408       type: object
409     DmiPluginRegistrationErrorResponse:
410       properties:
411         failedCreatedCmHandles:
412           items:
413             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
414           type: array
415         failedUpdatedCmHandles:
416           items:
417             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
418           type: array
419         failedRemovedCmHandles:
420           items:
421             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
422           type: array
423         failedUpgradeCmHandles:
424           items:
425             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
426           type: array
427       type: object
428     CmHandlerRegistrationErrorResponse:
429       properties:
430         cmHandle:
431           example: my-cm-handle
432           type: string
433         errorCode:
434           example: "00"
435           type: string
436         errorText:
437           example: Unknown error. <error-details>
438           type: string
439       type: object
440     CmHandleQueryParameters:
441       example:
442         cmHandleQueryParameters:
443         - conditionParameters:
444           - key: conditionParameters
445           - key: conditionParameters
446           conditionName: conditionName
447         - conditionParameters:
448           - key: conditionParameters
449           - key: conditionParameters
450           conditionName: conditionName
451         conditions:
452         - name: name
453           conditionParameters:
454           - moduleName: my-module
455           - moduleName: my-module
456         - name: name
457           conditionParameters:
458           - moduleName: my-module
459           - moduleName: my-module
460       properties:
461         cmHandleQueryParameters:
462           items:
463             $ref: '#/components/schemas/ConditionProperties'
464           type: array
465         conditions:
466           deprecated: true
467           description: "not necessary, it is just for backward compatibility"
468           items:
469             $ref: '#/components/schemas/OldConditionProperties'
470           type: array
471       title: Cm Handle query parameters for executing cm handle search
472       type: object
473     ConditionProperties:
474       example:
475         conditionParameters:
476         - key: conditionParameters
477         - key: conditionParameters
478         conditionName: conditionName
479       properties:
480         conditionName:
481           type: string
482         conditionParameters:
483           items:
484             additionalProperties:
485               type: string
486             type: object
487           type: array
488     OldConditionProperties:
489       deprecated: true
490       example:
491         name: name
492         conditionParameters:
493         - moduleName: my-module
494         - moduleName: my-module
495       properties:
496         name:
497           type: string
498         conditionParameters:
499           items:
500             $ref: '#/components/schemas/ModuleNameAsJsonObject'
501           type: array
502     ModuleNameAsJsonObject:
503       example:
504         moduleName: my-module
505       properties:
506         moduleName:
507           example: my-module
508           type: string
509   securitySchemes:
510     basicAuth:
511       scheme: basic
512       type: http