-
Notifications
You must be signed in to change notification settings - Fork 4
/
api.yaml
executable file
·629 lines (628 loc) · 17.7 KB
/
api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
swagger: '2.0'
info:
version: 1.0.0
title: ElasTest Instrumentation Manager
description: RESTful API specification for the ElasTest Instrumentation Manager (EIM)
termsOfService: TBD
contact:
name: Fernando Mendez Requena - Research Software Engineer
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: elastest.io
basePath: /api
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
paths:
/publickey:
get:
tags:
- Publickey
summary: Retrieve public key
description: A client retrieves the public key
operationId: getPublickey
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: Successful operation
schema:
$ref: '#/definitions/Publickey'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/agent/{agentId}':
get:
tags:
- Agent
summary: Retrieve a agent
description: Returns the agent with the given ID. Returns all its details.
operationId: getAgentByID
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: ID of agent
required: true
type: string
responses:
'200':
description: Successful operation
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Network not found
schema:
$ref: '#/definitions/AgentFull'
delete:
tags:
- Agent
summary: Delete a agent
description: A client delete a agent
operationId: deleteAgentByID
consumes:
- application/json
produces:
- '*/*'
parameters:
- name: agentId
in: path
description: Id of agent to delete
required: true
type: string
responses:
'200':
description: Network deleted successfully
schema:
$ref: '#/definitions/AgentDeleted'
'204':
description: No Content
'400':
description: Bad Request
schema:
type: string
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Network not found
schema:
type: string
/agent:
get:
tags:
- Agent
summary: Returns all existing agents
description: Returns all agents with all details
operationId: getAllAgents
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: Successful operation
schema:
type: array
items:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
post:
tags:
- Agent
summary: Register an agent
description: A client registers an agent
operationId: postAgent
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
description: Definition of an agent that is going to be created
required: true
schema:
$ref: '#/definitions/Host'
responses:
'200':
description: Agent creation OK
schema:
$ref: '#/definitions/Agent'
'201':
description: Created
'400':
description: Bad Request
schema:
$ref: '#/definitions/Agent'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/agent/{agentId}/{actionId}':
post:
tags:
- Agent
summary: Submit an action ti an agent
description: A client submit an action to an agent
operationId: postAction
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: Id of agent to that receives the action
required: true
type: string
- name: actionId
in: path
description: action to apply
required: true
type: string
- in: body
name: body
description: Configuration of the agent
required: true
schema:
$ref: '#/definitions/AgentConfiguration'
responses:
'200':
description: Action applied OK
schema:
$ref: '#/definitions/AgentFull'
'204':
description: No Content
'400':
description: Bad Request
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Agent not found
schema:
$ref: '#/definitions/AgentFull'
'/agent/controllability/{agentId}/stress':
post:
tags:
- Agent
summary: Submit an action ti an agent
description: A client submit an action to an agent
operationId: postActionStress
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: Id of agent to that receives the action
required: true
type: string
- name: actionId
in: path
description: action to apply
required: true
type: string
- in: body
name: body
description: Configuration of the agent
required: true
schema:
$ref: '#/definitions/AgentConfigurationStress'
responses:
'200':
description: Action applied OK
schema:
$ref: '#/definitions/AgentFull'
'204':
description: No Content
'400':
description: Bad Request
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Agent not found
schema:
$ref: '#/definitions/AgentFull'
'/agent/controllability/{agentId}/packetloss':
post:
tags:
- Agent
summary: Submit an action ti an agent
description: A client submit an action to an agent. In order to non use **Execbeat** execution, the field called *cronExpression* must be empty.
operationId: postActionPacketloss
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: Id of agent to that receives the action
required: true
type: string
- name: actionId
in: path
description: action to apply
required: true
type: string
- in: body
name: body
description: Configuration of the agent
required: true
schema:
$ref: '#/definitions/AgentConfigurationPacketloss'
responses:
'200':
description: Action applied OK
schema:
$ref: '#/definitions/AgentFull'
'204':
description: No Content
'400':
description: Bad Request
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Agent not found
schema:
$ref: '#/definitions/AgentFull'
'/agent/controllability/{agentId}/unchecked':
delete:
tags:
- Agent
summary: Uncheck an agent
description: A client uncheck the agent for not to be controllable
operationId: deleteControllability
consumes:
- application/json
produces:
- '*/*'
parameters:
- name: agentId
in: path
description: Id of agent to uncheck
required: true
type: string
responses:
'200':
description: Agent unchecked successfully
schema:
$ref: '#/definitions/AgentUnchecked'
'204':
description: No Content
'400':
description: Bad Request
schema:
type: string
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Network not found
schema:
type: string
/agentconfiguration:
get:
tags:
- AgentConfiguration
summary: Returns all existing agent configurations
description: Returns all agent configurations with all details
operationId: getAllAgentConfigurations
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: Successful operation
schema:
type: array
items:
$ref: '#/definitions/AgentConfigurationDatabase'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/agentconfiguration/{agentId}':
get:
tags:
- AgentConfiguration
summary: Retrieve an agent configuration
description: Returns the agent configuration with the given ID. Returns all its details.
operationId: getAgentCfgByID
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: ID of agent
required: true
type: string
responses:
'200':
description: Successful operation
schema:
$ref: '#/definitions/AgentConfigurationDatabase'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Network not found
schema:
$ref: '#/definitions/AgentConfigurationDatabase'
definitions:
Publickey:
type: object
required:
- publickey
properties:
publickey:
type: string
example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCp9ujzo4XgfcFFHZqqHvf25PP/TSAP89pxSx9sqsNsY7EPOMTpQVpYRuooaJQk7pwr8SzHJkWA2KzNcfs1hneIsfWPqhDmeDliwm3cFIrPQ3juFaoD03eRzS36F+qKyN8og5PxSCPSBtDdvdn0gvTA9j1IXQJ4oeUIxr3s8dIJiYpKY3wQeJTVCRQNGHZWrnjgSZ0YCH0wiEpUAT4mfUWmpjSyVmH8q2l2REuJbgVy5rQ7sMqaf/BvbAiKgqLYDOrcGQNjGj6in1Fuwj9vPvhyvRaNrkfj2NuA5RFN+2wPbYyClxEurFJWsD/GEHNKnd/0X88ubhZ89sIEiUYL8KB root@0b83a3aa4d3a
description: This entity defines the publickey of EIM.
Agent:
type: object
required:
- agentId
- host
properties:
agentId:
type: string
host:
type: string
description: This entity defines an agent.
Host:
type: object
required:
- address
- user
- private_key
- logstash_ip
- logstash_port
properties:
address:
type: string
example: 172.19.0.4
user:
type: string
example: root
private_key:
type: string
example: -----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAvLGBDZ5cFC3Pm7NQr9NfU37tNfcEwiAcDe0KS50b0Ecytux0\nfG4JMhghBW2zUfq2XZhBF3y9dXaoDo3w6QcqH3V9GiBF3D08687rjZnrIRHS1CzP\nwgh/pwpkGyZ6Qq7/OUGBxttr0Rc7j07VmoodqGS8hN9iioFa4Y35VPp/hzMaAek4\nN8XViyzEssKqBY821+H+dQ8ymaO2x0vgis/CHtpo8wvBD/oeDXWuTkCE5JmWWrD8\nxm/WkbFPPQJ8KewTNizjl5y4bAHxB5aLfZuriBKubq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FUD6FobFQ\n1/ON+VBxZ8XtJtC5pT0eyR1z6JkD97SYVNuu8wu2UW7duQsZNSbLGWMxB6GUeESq\nDQUJAoGBAKPbaZhvj666fHIXsdFx30V63M1eCPWgtsJ+bTZw4xM4ubu5MShBbHVm\nPP4kdYhct6W0hc0iOUTslMkCZOwFKDvR+oLI73FZhLIPMy7jq5ZfiGgVcYQyB68c\n6eOAvdSrK5di8A3qWvGnZwlXuXT2JCOflfUHmKa8uOdMgDZ9yaED\n-----END RSA PRIVATE KEY-----
logstash_ip:
type: string
example: 172.19.0.2
logstash_port:
type: string
example: 5044
AgentFull:
type: object
required:
- agentId
- host
- monitored
- logstash_ip
- logstash_port
- password
properties:
agentId:
type: string
example: 541
host:
type: string
example: 172.19.0.4
monitored:
type: boolean
example: true
logstash_ip:
type: string
example: 172.19.0.2
logstash_port:
type: string
example: 5044
password:
type: string
example: myPassword
description: This entity defines an agent with all information available.
AgentConfigurationPacketloss:
type: object
required:
- exec
- component
- packetLoss
- stressNg
- dockerized
- cronExpression
properties:
exec:
type: string
example: exec_name
component:
type: string
example: component_name
packetLoss:
type: string
example: "0.01"
stressNg:
type: string
example: ""
dockerized:
type: string
example: yes
cronExpression:
type: string
example: "@every 10s"
description: This entity defines an agent with all information available.
AgentConfigurationStress:
type: object
required:
- exec
- component
- packetLoss
- stressNg
- dockerized
- cronExpression
properties:
exec:
type: string
example: exec_name
component:
type: string
example: component_name
packetLoss:
type: string
example: ""
stressNg:
type: string
example: "4"
dockerized:
type: string
example: yes
cronExpression:
type: string
example: "@every 10s"
description: This entity defines an agent with all information available.
AgentConfiguration:
type: object
required:
- exec
- component
- dockerized
- packetbeat
- filebeat
- metricbeat
properties:
exec:
type: string
example: exec_name
component:
type: string
example: component_name
dockerized:
type: string
example: yes
packetbeat:
type: object
required:
- stream
properties:
stream:
type: string
example: stream1
filebeat:
type: object
required:
- stream
- paths
properties:
stream:
type: string
example: stream2
paths:
type: array
minLength: 1
items:
type: string
example: /var/log/*.log
dockerized:
type: array
minLength: 1
items:
type: string
example: /var/lib/docker/containers/
metricbeat:
type: object
required:
- stream
properties:
stream:
type: string
example: stream3
dockerized:
type: array
minLength: 1
items:
type: string
example: /var/run/docker.sock
description: This entity defines the configuration that will be applied to the agent. If dockerized equals "yes" then the dockerized fields in metricbeat and filebeat must be filled. If dockerized equals "no" then the dockerized fields in metricbeat and filebeat can be null (never are used)
AgentDeleted:
type: object
required:
- agentId
- deleted
properties:
agentId:
type: string
example: iagent1
deleted:
type: string
example: true
description: This entity defines an agent deleted.
AgentUnchecked:
type: object
required:
- agentId
properties:
agentId:
type: string
example: iagent1
description: This entity defines an agent unchecked.
AgentConfigurationDatabase:
type: object
required:
- agentId
- agentConfiguration
properties:
agentId:
type: string
example: iagent1
agentConfiguration:
type: object
$ref: '#/definitions/AgentConfiguration'
description: This entity defines an agent configuration stored in db.