2d34f0a61afe3ff17a59d7e4931fb4d5586efa08
[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 paths:
9   /v1/ch:
10     post:
11       tags:
12       - network-cm-proxy-inventory
13       summary: DMI notifies NCMP of new CM Handles
14       description: "Register a DMI Plugin with any new, updated or removed CM Handles."
15       operationId: updateDmiPluginRegistration
16       requestBody:
17         content:
18           application/json:
19             schema:
20               $ref: '#/components/schemas/RestDmiPluginRegistration'
21         required: true
22       responses:
23         "200":
24           description: No Content
25           content: {}
26         "400":
27           description: Bad Request
28           content:
29             application/json:
30               schema:
31                 $ref: '#/components/schemas/ErrorMessage'
32               example:
33                 status: 400 BAD_REQUEST
34                 message: Bad request error message
35                 details: Bad request error details
36         "401":
37           description: Unauthorized
38           content:
39             application/json:
40               schema:
41                 $ref: '#/components/schemas/ErrorMessage'
42               example:
43                 status: 401
44                 message: Unauthorized error message
45                 details: Unauthorized error details
46         "403":
47           description: Forbidden
48           content:
49             application/json:
50               schema:
51                 $ref: '#/components/schemas/ErrorMessage'
52               example:
53                 status: 403
54                 message: Forbidden error message
55                 details: Forbidden error details
56         "500":
57           description: Partial or Complete failure. The error details are provided
58             in the response body and all supported error codes are documented in the
59             example.
60           content:
61             application/json:
62               schema:
63                 $ref: '#/components/schemas/DmiPluginRegistrationErrorResponse'
64               example:
65                 failedCreatedCmHandles:
66                 - cmHandle: my-cm-handle-01
67                   errorCode: "00"
68                   errorText: Unknown error. <error-details>
69                 - cmHandle: my-cm-handle-02
70                   errorCode: "01"
71                   errorText: cm-handle already exists
72                 - cmHandle: my-cm-handle-03
73                   errorCode: "03"
74                   errorText: cm-handle has an invalid character(s) in id
75                 failedUpdatedCmHandles:
76                 - cmHandle: my-cm-handle-01
77                   errorCode: "00"
78                   errorText: Unknown error. <error-details>
79                 - cmHandle: my-cm-handle-02
80                   errorCode: "02"
81                   errorText: cm-handle does not exist
82                 - cmHandle: my-cm-handle-03
83                   errorCode: "03"
84                   errorText: cm-handle has an invalid character(s) in id
85                 failedRemovedCmHandles:
86                 - cmHandle: my-cm-handle-01
87                   errorCode: "00"
88                   errorText: Unknown error. <error-details>
89                 - cmHandle: my-cm-handle-02
90                   errorCode: "02"
91                   errorText: cm-handle does not exists
92                 - cmHandle: my-cm-handle-03
93                   errorCode: "03"
94                   errorText: cm-handle has an invalid character(s) in id
95   /v1/ch/cmHandles:
96     get:
97       tags:
98       - network-cm-proxy-inventory
99       summary: "Get all cm handle IDs for a registered DMI plugin (DMI plugin, DMI\
100         \ data plugin, DMI model plugin)"
101       description: Get all cm handle IDs for a registered DMI plugin
102       operationId: getAllCmHandleIdsForRegisteredDmi
103       parameters:
104       - name: dmi-plugin-identifier
105         in: query
106         description: dmi-plugin-identifier
107         required: true
108         schema:
109           type: string
110           example: my-dmi-plugin
111       responses:
112         "200":
113           description: OK
114           content:
115             application/json:
116               schema:
117                 type: array
118                 items:
119                   type: string
120         "401":
121           description: Unauthorized
122           content:
123             application/json:
124               schema:
125                 $ref: '#/components/schemas/ErrorMessage'
126               example:
127                 status: 401
128                 message: Unauthorized error message
129                 details: Unauthorized error details
130         "403":
131           description: Forbidden
132           content:
133             application/json:
134               schema:
135                 $ref: '#/components/schemas/ErrorMessage'
136               example:
137                 status: 403
138                 message: Forbidden error message
139                 details: Forbidden error details
140         "500":
141           description: Internal Server Error
142           content:
143             application/json:
144               schema:
145                 $ref: '#/components/schemas/ErrorMessage'
146               example:
147                 status: 500
148                 message: Internal Server Error
149                 details: Internal Server Error occurred
150 components:
151   schemas:
152     RestDmiPluginRegistration:
153       type: object
154       properties:
155         dmiPlugin:
156           type: string
157           example: my-dmi-plugin
158           default: ""
159         dmiDataPlugin:
160           type: string
161           example: my-dmi-data-plugin
162           default: ""
163         dmiModelPlugin:
164           type: string
165           example: my-dmi-model-plugin
166           default: ""
167         createdCmHandles:
168           type: array
169           items:
170             $ref: '#/components/schemas/RestInputCmHandle'
171         updatedCmHandles:
172           type: array
173           items:
174             $ref: '#/components/schemas/RestInputCmHandle'
175         removedCmHandles:
176           type: array
177           example:
178           - my-cm-handle1
179           - my-cm-handle2
180           - my-cm-handle3
181           items:
182             type: string
183     RestInputCmHandle:
184       required:
185       - cmHandle
186       type: object
187       properties:
188         cmHandle:
189           type: string
190           example: my-cm-handle
191         cmHandleProperties:
192           $ref: '#/components/schemas/RestCmHandleProperties'
193         publicCmHandleProperties:
194           $ref: '#/components/schemas/RestCmHandleProperties'
195     RestCmHandleProperties:
196       type: object
197       additionalProperties:
198         type: string
199         example: my-property
200     ErrorMessage:
201       title: Error
202       type: object
203       properties:
204         status:
205           type: string
206         message:
207           type: string
208         details:
209           type: string
210     DmiPluginRegistrationErrorResponse:
211       type: object
212       properties:
213         failedCreatedCmHandles:
214           type: array
215           items:
216             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
217         failedUpdatedCmHandles:
218           type: array
219           items:
220             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
221         failedRemovedCmHandles:
222           type: array
223           items:
224             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
225     CmHandlerRegistrationErrorResponse:
226       type: object
227       properties:
228         cmHandle:
229           type: string
230           example: my-cm-handle
231         errorCode:
232           type: string
233           example: "00"
234         errorText:
235           type: string
236           example: Unknown error. <error-details>