[NCMP] Add Basic Auth to OpenAPI Definitions
[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   securitySchemes:
152     basicAuth:
153       type: http
154       scheme: basic
155   schemas:
156     RestDmiPluginRegistration:
157       type: object
158       properties:
159         dmiPlugin:
160           type: string
161           example: my-dmi-plugin
162           default: ""
163         dmiDataPlugin:
164           type: string
165           example: my-dmi-data-plugin
166           default: ""
167         dmiModelPlugin:
168           type: string
169           example: my-dmi-model-plugin
170           default: ""
171         createdCmHandles:
172           type: array
173           items:
174             $ref: '#/components/schemas/RestInputCmHandle'
175         updatedCmHandles:
176           type: array
177           items:
178             $ref: '#/components/schemas/RestInputCmHandle'
179         removedCmHandles:
180           type: array
181           example:
182           - my-cm-handle1
183           - my-cm-handle2
184           - my-cm-handle3
185           items:
186             type: string
187     RestInputCmHandle:
188       required:
189       - cmHandle
190       type: object
191       properties:
192         cmHandle:
193           type: string
194           example: my-cm-handle
195         cmHandleProperties:
196           $ref: '#/components/schemas/RestCmHandleProperties'
197         publicCmHandleProperties:
198           $ref: '#/components/schemas/RestCmHandleProperties'
199     RestCmHandleProperties:
200       type: object
201       additionalProperties:
202         type: string
203         example: my-property
204     ErrorMessage:
205       title: Error
206       type: object
207       properties:
208         status:
209           type: string
210         message:
211           type: string
212         details:
213           type: string
214     DmiPluginRegistrationErrorResponse:
215       type: object
216       properties:
217         failedCreatedCmHandles:
218           type: array
219           items:
220             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
221         failedUpdatedCmHandles:
222           type: array
223           items:
224             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
225         failedRemovedCmHandles:
226           type: array
227           items:
228             $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse'
229     CmHandlerRegistrationErrorResponse:
230       type: object
231       properties:
232         cmHandle:
233           type: string
234           example: my-cm-handle
235         errorCode:
236           type: string
237           example: "00"
238         errorText:
239           type: string
240           example: Unknown error. <error-details>
241
242 security:
243   - basicAuth: []