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