· 6 years ago · Nov 21, 2019, 09:42 AM
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: f1847956-f52d-4bda-9078-316b577a9d5d
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: f1847956-f52d-4bda-9078-316b577a9d5d
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 NUMBER:
184 type: object
185 Json:
186 type: object
187 TemplateMetadata:
188 required:
189 - author
190 type: object
191 properties:
192 author:
193 type: string
194 description:
195 type: string
196 iconUrl:
197 type: string
198 Page_AlertChannel:
199 required:
200 - values
201 - pagesAmount
202 type: object
203 properties:
204 values:
205 type: array
206 items:
207 $ref: '#/components/schemas/AlertChannel'
208 pagesAmount:
209 type: integer
210 SECRET:
211 type: object
212 NonEmptyList_TemplateProperty:
213 required:
214 - head
215 - tail
216 type: object
217 properties:
218 head:
219 $ref: '#/components/schemas/TemplateProperty'
220 tail:
221 type: array
222 items:
223 $ref: '#/components/schemas/TemplateProperty'
224 BOOLEAN:
225 type: object
226 KeyDataType:
227 oneOf:
228 - $ref: '#/components/schemas/ARRAY'
229 - $ref: '#/components/schemas/NUMBER'
230 - $ref: '#/components/schemas/MULTILINE'
231 - $ref: '#/components/schemas/STRING'
232 - $ref: '#/components/schemas/BOOLEAN'
233 - $ref: '#/components/schemas/BASE64'
234 - $ref: '#/components/schemas/SECRET'
235 TemplateProperty:
236 required:
237 - id
238 - key
239 - displayName
240 - keyDataType
241 - required
242 - provided
243 type: object
244 properties:
245 id:
246 type: integer
247 key:
248 type: string
249 displayName:
250 type: string
251 placeholder:
252 type: string
253 description:
254 type: string
255 keyDataType:
256 $ref: '#/components/schemas/KeyDataType'
257 required:
258 type: boolean
259 provided:
260 type: boolean
261 NewAlertChannel:
262 required:
263 - name
264 - templateName
265 - connectionId
266 - properties
267 type: object
268 properties:
269 name:
270 type: string
271 templateName:
272 type: string
273 connectionId:
274 type: integer
275 properties:
276 type: array
277 items:
278 $ref: '#/components/schemas/PropertyValue'
279 STRING:
280 type: object
281 BASE64:
282 type: object
283 ARRAY:
284 type: object
285 AlertChannel:
286 required:
287 - id
288 - name
289 - templateName
290 - connectionId
291 - properties
292 - createdAt
293 - createdBy
294 - updatedAt
295 - updatedBy
296 type: object
297 properties:
298 id:
299 type: string
300 name:
301 type: string
302 templateName:
303 type: string
304 connectionId:
305 type: integer
306 properties:
307 type: array
308 items:
309 $ref: '#/components/schemas/PropertyValue'
310 createdAt:
311 type: string
312 format: date-time
313 createdBy:
314 type: string
315 updatedAt:
316 type: string
317 format: date-time
318 updatedBy:
319 type: string
320 FieldsErrorDetails:
321 required:
322 - field
323 - error
324 type: object
325 properties:
326 field:
327 type: string
328 error:
329 type: string
330 UpdateAlertChannel:
331 required:
332 - name
333 - connectionId
334 - properties
335 type: object
336 properties:
337 name:
338 type: string
339 connectionId:
340 type: integer
341 properties:
342 type: array
343 items:
344 $ref: '#/components/schemas/PropertyValue'
345 MULTILINE:
346 type: object
347 ErrorDetails:
348 required:
349 - fields
350 - error
351 - nonFieldErrors
352 type: object
353 properties:
354 fields:
355 type: array
356 items:
357 $ref: '#/components/schemas/FieldsErrorDetails'
358 error:
359 type: string
360 nonFieldErrors:
361 type: array
362 items:
363 type: string
364 ChannelTemplate:
365 required:
366 - id
367 - name
368 - version
369 - enabled
370 - builtIn
371 - metadata
372 - configuration
373 - suitableConnections
374 type: object
375 properties:
376 id:
377 type: integer
378 name:
379 type: string
380 version:
381 type: integer
382 enabled:
383 type: boolean
384 builtIn:
385 type: boolean
386 metadata:
387 $ref: '#/components/schemas/TemplateMetadata'
388 configuration:
389 $ref: '#/components/schemas/NonEmptyList_TemplateProperty'
390 suitableConnections:
391 type: array
392 items:
393 $ref: '#/components/schemas/SuitableConnection'
394 SuitableConnection:
395 required:
396 - id
397 - templateName
398 - displayName
399 type: object
400 properties:
401 id:
402 type: integer
403 templateName:
404 type: string
405 displayName:
406 type: string
407 securitySchemes:
408 apiKeyAuth:
409 type: apiKey
410 name: X-Kafka-Lenses-Token
411 in: header