· 6 years ago · Nov 28, 2019, 11:00 AM
1openapi: 3.0.1
2info:
3 title: Lenses API
4 version: '3.0'
5paths:
6 /api/v1/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 example:
37 values:
38 - id: 3a7d5c10-d8e8-42e9-8966-97be146c9ea4
39 name: kafka-prd-health
40 templateName: Slack
41 connectionId: 101
42 properties:
43 - key: channel
44 value: '#my-kafka-health-prd'
45 createdAt: '2019-11-28T10:55:10.859Z'
46 createdBy: joe.bloggs
47 updatedAt: '2019-11-28T10:55:10.859Z'
48 updatedBy: joe.bloggs
49 pagesAmount: 1
50 security:
51 - apiKeyAuth: []
52 post:
53 tags:
54 - monitoring
55 description: The JSON object representing the properties to set this channel
56 with
57 operationId: createAlertChannel
58 requestBody:
59 content:
60 application/json:
61 schema:
62 $ref: '#/components/schemas/NewAlertChannel'
63 example:
64 name: kafka-prd-health
65 templateName: Slack
66 connectionId: 101
67 properties:
68 - key: channel
69 value: '#my-kafka-health-prd'
70 required: true
71 responses:
72 '201':
73 description: ''
74 content:
75 application/json:
76 schema:
77 $ref: '#/components/schemas/AlertChannel'
78 example:
79 id: 3a7d5c10-d8e8-42e9-8966-97be146c9ea4
80 name: kafka-prd-health
81 templateName: Slack
82 connectionId: 101
83 properties:
84 - key: channel
85 value: '#my-kafka-health-prd'
86 createdAt: '2019-11-28T10:55:10.859Z'
87 createdBy: joe.bloggs
88 updatedAt: '2019-11-28T10:55:10.859Z'
89 updatedBy: joe.bloggs
90 '400':
91 description: An object wrapping field validation errors and other error
92 messages
93 content:
94 application/json:
95 schema:
96 $ref: '#/components/schemas/ErrorDetails'
97 security:
98 - apiKeyAuth: []
99 /api/v1/alert/channel/{id}:
100 put:
101 tags:
102 - monitoring
103 description: update an alert channel
104 operationId: updateAlertChannel
105 parameters:
106 - name: id
107 in: path
108 description: The alert channel id
109 required: true
110 schema:
111 type: string
112 example: 8ebf65bc-9533-4d98-bcca-355b73643bcd
113 requestBody:
114 description: The JSON object representing the properties to set this channel
115 with
116 content:
117 application/json:
118 schema:
119 $ref: '#/components/schemas/UpdateAlertChannel'
120 example:
121 name: kafka-prd-health
122 connectionId: 101
123 properties:
124 - key: channel
125 value: '#my-kafka-health-prd'
126 required: true
127 responses:
128 '200':
129 description: ''
130 content:
131 application/json:
132 schema:
133 $ref: '#/components/schemas/AlertChannel'
134 '400':
135 description: An object wrapping field validation errors and other error
136 messages
137 content:
138 application/json:
139 schema:
140 $ref: '#/components/schemas/ErrorDetails'
141 security:
142 - apiKeyAuth: []
143 delete:
144 tags:
145 - monitoring
146 description: permanently delete an alert channel
147 operationId: deleteAlertChannel
148 parameters:
149 - name: id
150 in: path
151 description: The alert channel id
152 required: true
153 schema:
154 type: string
155 example: 3fc9bd24-ed57-4a48-9b31-2eadf9ae82a9
156 responses:
157 '204':
158 description: ''
159 '404':
160 description: responds with `NotFound` when the supplied channel id doesn't
161 match any known channel
162 security:
163 - apiKeyAuth: []
164 /api/v1/alert/channel/template:
165 get:
166 tags:
167 - monitoring
168 description: list alert channel templates with their applicable connections
169 operationId: listAlertChannelTemplates
170 responses:
171 '200':
172 description: ''
173 content:
174 application/json:
175 schema:
176 type: array
177 items:
178 $ref: '#/components/schemas/ChannelTemplate'
179 example:
180 - id: 439
181 name: Slack
182 version: 1
183 enabled: true
184 builtIn: true
185 metadata:
186 author: Lenses
187 description: Slack channel template
188 iconUrl: https://lenses.io/icons/slack.png
189 configuration:
190 - id: 102
191 key: channel
192 displayName: Channel Name
193 description: The slack channel where alerts should be notified to
194 keyDataType: STRING
195 required: true
196 provided: false
197 suitableConnections: []
198 security:
199 - apiKeyAuth: []
200components:
201 schemas:
202 PropertyValue:
203 required:
204 - key
205 - value
206 type: object
207 properties:
208 key:
209 type: string
210 value:
211 $ref: '#/components/schemas/Json'
212 Json: {}
213 TemplateMetadata:
214 required:
215 - author
216 type: object
217 properties:
218 author:
219 type: string
220 description:
221 type: string
222 iconUrl:
223 type: string
224 Page_AlertChannel:
225 required:
226 - values
227 - pagesAmount
228 type: object
229 properties:
230 values:
231 type: array
232 items:
233 $ref: '#/components/schemas/AlertChannel'
234 pagesAmount:
235 type: integer
236 TemplateProperty:
237 required:
238 - id
239 - key
240 - displayName
241 - keyDataType
242 - required
243 - provided
244 type: object
245 properties:
246 id:
247 type: integer
248 key:
249 type: string
250 displayName:
251 type: string
252 placeholder:
253 type: string
254 description:
255 type: string
256 keyDataType:
257 type: string
258 enum:
259 - STRING
260 - ARRAY
261 - MULTILINE
262 - SECRET
263 - NUMBER
264 - BOOLEAN
265 - BASE64
266 required:
267 type: boolean
268 provided:
269 type: boolean
270 NewAlertChannel:
271 required:
272 - name
273 - templateName
274 - connectionId
275 - properties
276 type: object
277 properties:
278 name:
279 type: string
280 templateName:
281 type: string
282 connectionId:
283 type: integer
284 properties:
285 type: array
286 items:
287 $ref: '#/components/schemas/PropertyValue'
288 AlertChannel:
289 required:
290 - id
291 - name
292 - templateName
293 - connectionId
294 - properties
295 - createdAt
296 - createdBy
297 - updatedAt
298 - updatedBy
299 type: object
300 properties:
301 id:
302 type: string
303 name:
304 type: string
305 templateName:
306 type: string
307 connectionId:
308 type: integer
309 properties:
310 type: array
311 items:
312 $ref: '#/components/schemas/PropertyValue'
313 createdAt:
314 type: string
315 format: date-time
316 createdBy:
317 type: string
318 updatedAt:
319 type: string
320 format: date-time
321 updatedBy:
322 type: string
323 FieldsErrorDetails:
324 required:
325 - field
326 - error
327 type: object
328 properties:
329 field:
330 type: string
331 error:
332 type: string
333 UpdateAlertChannel:
334 required:
335 - name
336 - connectionId
337 - properties
338 type: object
339 properties:
340 name:
341 type: string
342 connectionId:
343 type: integer
344 properties:
345 type: array
346 items:
347 $ref: '#/components/schemas/PropertyValue'
348 ErrorDetails:
349 required:
350 - fields
351 - error
352 - nonFieldErrors
353 type: object
354 properties:
355 fields:
356 type: array
357 items:
358 $ref: '#/components/schemas/FieldsErrorDetails'
359 error:
360 type: string
361 nonFieldErrors:
362 type: array
363 items:
364 type: string
365 ChannelTemplate:
366 required:
367 - id
368 - name
369 - version
370 - enabled
371 - builtIn
372 - metadata
373 - configuration
374 - suitableConnections
375 type: object
376 properties:
377 id:
378 type: integer
379 name:
380 type: string
381 version:
382 type: integer
383 enabled:
384 type: boolean
385 builtIn:
386 type: boolean
387 metadata:
388 $ref: '#/components/schemas/TemplateMetadata'
389 configuration:
390 type: array
391 items:
392 $ref: '#/components/schemas/TemplateProperty'
393 suitableConnections:
394 type: array
395 items:
396 $ref: '#/components/schemas/SuitableConnection'
397 SuitableConnection:
398 required:
399 - id
400 - templateName
401 - displayName
402 type: object
403 properties:
404 id:
405 type: integer
406 templateName:
407 type: string
408 displayName:
409 type: string
410 securitySchemes:
411 apiKeyAuth:
412 type: apiKey
413 name: X-Kafka-Lenses-Token
414 in: header