· 6 years ago · Nov 23, 2019, 01:28 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: e701c527-9ce0-4f32-ab64-151324469296
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: 58248a3a-6a65-49f8-acc0-640048c8d253
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 enum:
231 - STRING
232 - ARRAY
233 - MULTILINE
234 - SECRET
235 - NUMBER
236 - BOOLEAN
237 - BASE64
238 required:
239 type: boolean
240 provided:
241 type: boolean
242 NewAlertChannel:
243 required:
244 - name
245 - templateName
246 - connectionId
247 - properties
248 type: object
249 properties:
250 name:
251 type: string
252 templateName:
253 type: string
254 connectionId:
255 type: integer
256 properties:
257 type: array
258 items:
259 $ref: '#/components/schemas/PropertyValue'
260 AlertChannel:
261 required:
262 - id
263 - name
264 - templateName
265 - connectionId
266 - properties
267 - createdAt
268 - createdBy
269 - updatedAt
270 - updatedBy
271 type: object
272 properties:
273 id:
274 type: string
275 name:
276 type: string
277 templateName:
278 type: string
279 connectionId:
280 type: integer
281 properties:
282 type: array
283 items:
284 $ref: '#/components/schemas/PropertyValue'
285 createdAt:
286 type: string
287 format: date-time
288 createdBy:
289 type: string
290 updatedAt:
291 type: string
292 format: date-time
293 updatedBy:
294 type: string
295 FieldsErrorDetails:
296 required:
297 - field
298 - error
299 type: object
300 properties:
301 field:
302 type: string
303 error:
304 type: string
305 UpdateAlertChannel:
306 required:
307 - name
308 - connectionId
309 - properties
310 type: object
311 properties:
312 name:
313 type: string
314 connectionId:
315 type: integer
316 properties:
317 type: array
318 items:
319 $ref: '#/components/schemas/PropertyValue'
320 ErrorDetails:
321 required:
322 - fields
323 - error
324 - nonFieldErrors
325 type: object
326 properties:
327 fields:
328 type: array
329 items:
330 $ref: '#/components/schemas/FieldsErrorDetails'
331 error:
332 type: string
333 nonFieldErrors:
334 type: array
335 items:
336 type: string
337 ChannelTemplate:
338 required:
339 - id
340 - name
341 - version
342 - enabled
343 - builtIn
344 - metadata
345 - configuration
346 - suitableConnections
347 type: object
348 properties:
349 id:
350 type: integer
351 name:
352 type: string
353 version:
354 type: integer
355 enabled:
356 type: boolean
357 builtIn:
358 type: boolean
359 metadata:
360 $ref: '#/components/schemas/TemplateMetadata'
361 configuration:
362 type: array
363 items:
364 $ref: '#/components/schemas/TemplateProperty'
365 suitableConnections:
366 type: array
367 items:
368 $ref: '#/components/schemas/SuitableConnection'
369 SuitableConnection:
370 required:
371 - id
372 - templateName
373 - displayName
374 type: object
375 properties:
376 id:
377 type: integer
378 templateName:
379 type: string
380 displayName:
381 type: string
382 securitySchemes:
383 apiKeyAuth:
384 type: apiKey
385 name: X-Kafka-Lenses-Token
386 in: header