· 6 years ago · Nov 22, 2019, 04:46 PM
1openapi: 3.0.1
2info:
3 title: Lenses API
4 version: '3.0'
5paths:
6 /api/alert/channel:
7 get:
8 tags:
9 - monitoring
10 description: Lists alert channels ordered by their creation time (most recent
11 first)
12 operationId: listAlertChannels
13 parameters:
14 - name: page
15 in: query
16 description: The page number to be returned, must be greater than zero. Defaults
17 to 1.
18 required: false
19 schema:
20 type: integer
21 example: 1
22 - name: pageSize
23 in: query
24 description: The elements amount on a single page, must be greater than zero.
25 required: true
26 schema:
27 type: integer
28 example: 25
29 responses:
30 '200':
31 description: ''
32 content:
33 application/json:
34 schema:
35 $ref: '#/components/schemas/Page_AlertChannel'
36 security:
37 - apiKeyAuth: []
38 post:
39 tags:
40 - monitoring
41 description: The JSON object representing the properties to set this channel
42 with
43 operationId: createAlertChannel
44 requestBody:
45 content:
46 application/json:
47 schema:
48 $ref: '#/components/schemas/NewAlertChannel'
49 example:
50 name: kafka-prd-health
51 templateName: io.lenses.slack
52 connectionId: 1192
53 properties:
54 - key: channel
55 keyId: 31
56 value: '#my-kafka-health-prd'
57 required: true
58 responses:
59 '200':
60 description: ''
61 content:
62 application/json:
63 schema:
64 $ref: '#/components/schemas/AlertChannel'
65 '400':
66 description: An object wrapping field validation errors and other error
67 messages
68 content:
69 application/json:
70 schema:
71 $ref: '#/components/schemas/ErrorDetails'
72 security:
73 - apiKeyAuth: []
74 /api/alert/channel/{id}:
75 put:
76 tags:
77 - monitoring
78 description: The JSON object representing the properties to set this channel
79 with
80 operationId: updateAlertChannel
81 parameters:
82 - name: id
83 in: path
84 description: The alert channel id
85 required: true
86 schema:
87 type: string
88 example: 2b870555-56f4-4047-9553-91e1e6fc0167
89 requestBody:
90 content:
91 application/json:
92 schema:
93 $ref: '#/components/schemas/UpdateAlertChannel'
94 required: true
95 responses:
96 '200':
97 description: ''
98 content:
99 application/json:
100 schema:
101 $ref: '#/components/schemas/AlertChannel'
102 '400':
103 description: An object wrapping field validation errors and other error
104 messages
105 content:
106 application/json:
107 schema:
108 $ref: '#/components/schemas/ErrorDetails'
109 security:
110 - apiKeyAuth: []
111 delete:
112 tags:
113 - monitoring
114 description: permanently delete an alert channel
115 operationId: deleteAlertChannel
116 parameters:
117 - name: id
118 in: path
119 description: The alert channel id
120 required: true
121 schema:
122 type: string
123 example: fb6d8e73-7e09-4f2e-87b7-fcf3b7ace56e
124 responses:
125 '204':
126 description: ''
127 '404':
128 description: responds with `NotFound` when the supplied channel id doesn't
129 match any known channel
130 security:
131 - apiKeyAuth: []
132 /api/alert/channel/template:
133 get:
134 tags:
135 - monitoring
136 description: list alert channel templates with their applicable connections
137 operationId: listAlertChannelTemplates
138 responses:
139 '200':
140 description: ''
141 content:
142 application/json:
143 schema:
144 type: array
145 items:
146 $ref: '#/components/schemas/ChannelTemplate'
147 example:
148 - id: 439
149 name: Slack
150 version: 1
151 enabled: true
152 builtIn: true
153 metadata:
154 author: Lenses
155 description: Slack channel template
156 iconUrl: https://lenses.io/icons/slack.png
157 configuration:
158 - id: 102
159 key: channel
160 displayName: Channel Name
161 description: The slack channel where alerts should be notified to
162 keyDataType: STRING
163 required: true
164 provided: false
165 suitableConnections: []
166 security:
167 - apiKeyAuth: []
168components:
169 schemas:
170 PropertyValue:
171 required:
172 - key
173 - keyId
174 - value
175 type: object
176 properties:
177 key:
178 type: string
179 keyId:
180 type: integer
181 value:
182 $ref: '#/components/schemas/Json'
183 Json:
184 type: object
185 TemplateMetadata:
186 required:
187 - author
188 type: object
189 properties:
190 author:
191 type: string
192 description:
193 type: string
194 iconUrl:
195 type: string
196 Page_AlertChannel:
197 required:
198 - values
199 - pagesAmount
200 type: object
201 properties:
202 values:
203 type: array
204 items:
205 $ref: '#/components/schemas/AlertChannel'
206 pagesAmount:
207 type: integer
208 TemplateProperty:
209 required:
210 - id
211 - key
212 - displayName
213 - keyDataType
214 - required
215 - provided
216 type: object
217 properties:
218 id:
219 type: integer
220 key:
221 type: string
222 displayName:
223 type: string
224 placeholder:
225 type: string
226 description:
227 type: string
228 keyDataType:
229 type: string
230 required:
231 type: boolean
232 provided:
233 type: boolean
234 NewAlertChannel:
235 required:
236 - name
237 - templateName
238 - connectionId
239 - properties
240 type: object
241 properties:
242 name:
243 type: string
244 templateName:
245 type: string
246 connectionId:
247 type: integer
248 properties:
249 type: array
250 items:
251 $ref: '#/components/schemas/PropertyValue'
252 AlertChannel:
253 required:
254 - id
255 - name
256 - templateName
257 - connectionId
258 - properties
259 - createdAt
260 - createdBy
261 - updatedAt
262 - updatedBy
263 type: object
264 properties:
265 id:
266 type: string
267 name:
268 type: string
269 templateName:
270 type: string
271 connectionId:
272 type: integer
273 properties:
274 type: array
275 items:
276 $ref: '#/components/schemas/PropertyValue'
277 createdAt:
278 type: string
279 format: date-time
280 createdBy:
281 type: string
282 updatedAt:
283 type: string
284 format: date-time
285 updatedBy:
286 type: string
287 FieldsErrorDetails:
288 required:
289 - field
290 - error
291 type: object
292 properties:
293 field:
294 type: string
295 error:
296 type: string
297 UpdateAlertChannel:
298 required:
299 - name
300 - connectionId
301 - properties
302 type: object
303 properties:
304 name:
305 type: string
306 connectionId:
307 type: integer
308 properties:
309 type: array
310 items:
311 $ref: '#/components/schemas/PropertyValue'
312 ErrorDetails:
313 required:
314 - fields
315 - error
316 - nonFieldErrors
317 type: object
318 properties:
319 fields:
320 type: array
321 items:
322 $ref: '#/components/schemas/FieldsErrorDetails'
323 error:
324 type: string
325 nonFieldErrors:
326 type: array
327 items:
328 type: string
329 ChannelTemplate:
330 required:
331 - id
332 - name
333 - version
334 - enabled
335 - builtIn
336 - metadata
337 - configuration
338 - suitableConnections
339 type: object
340 properties:
341 id:
342 type: integer
343 name:
344 type: string
345 version:
346 type: integer
347 enabled:
348 type: boolean
349 builtIn:
350 type: boolean
351 metadata:
352 $ref: '#/components/schemas/TemplateMetadata'
353 configuration:
354 type: array
355 items:
356 $ref: '#/components/schemas/TemplateProperty'
357 minItems: 1
358 suitableConnections:
359 type: array
360 items:
361 $ref: '#/components/schemas/SuitableConnection'
362 SuitableConnection:
363 required:
364 - id
365 - templateName
366 - displayName
367 type: object
368 properties:
369 id:
370 type: integer
371 templateName:
372 type: string
373 displayName:
374 type: string
375 securitySchemes:
376 apiKeyAuth:
377 type: apiKey
378 name: X-Kafka-Lenses-Token
379 in: header