-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathapi.yaml
750 lines (719 loc) · 21.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
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
openapi: "3.0.0"
info:
description: "This is API documentation for [DC/OS Diagnostics](https://github.com/dcos/dcos-diagnostics)"
version: "1.0.0"
title: "DC/OS Diagnostics API"
license:
name: "Apache 2.0"
url: "https://github.com/dcos/dcos-diagnostics/blob/master/LICENSE"
tags:
- name: "Cluster Bundle"
description: "API for CRUD on Cluster Bundle. Works on masters only."
externalDocs:
description: "Code"
url: "https://github.com/dcos/dcos-diagnostics/blob/master/api/rest/cluster_bundle_handler.go"
- name: "Local Bundle"
description: "API for local node bundle"
externalDocs:
description: "Code"
url: "https://github.com/dcos/dcos-diagnostics/blob/master/api/rest/bundle_handler.go"
- name: "Deprecated Cluster Bundle"
description: "Deprecated API for creating cluster bundle. Works on masters only."
externalDocs:
description: "Code"
url: "https://github.com/dcos/dcos-diagnostics/blob/master/api/diagnostics.go"
- name: "Monitoring"
description: "Exposes infromations about nodes and its health"
externalDocs:
description: "Code"
url: "https://github.com/dcos/dcos-diagnostics/blob/master/api/monitoring_response.go"
- name: "Debug"
description: "Endpoints exposed when `--debug` flag is set."
externalDocs:
description: "Code"
url: "https://golang.org/pkg/net/http/pprof/"
servers:
- url: https://mesos.master/system/health/v1
description: Mesos master
paths:
/report:
get:
tags: ["Monitoring"]
responses:
200:
description: Get infromation about all systemd units for all nodes
content:
application/json: {}
/report/download:
get:
tags: ["Monitoring"]
responses:
200:
description: Get infromation about all systemd units for all nodes.
headers:
Content-disposition:
schema:
type: string
description: "attachment; filename=health-report.json"
content:
application/json: {}
/nodes:
get:
tags: ["Monitoring"]
responses:
200:
description: List all nodes with health
content:
application/json:
examples:
list:
value:
nodes:
- host_ip: 172.17.0.3
health: 0
role: agent
- host_ip: 172.17.0.4
health: 0
role: agent_public
- host_ip: 172.17.0.2
health: 0
role: master
/nodes/{ip}:
get:
tags: ["Monitoring"]
parameters:
- in: path
name: ip
required: true
schema:
type: string
responses:
200:
description: Get single node by its IP
content:
application/json:
examples:
list:
value:
host_ip: 172.17.0.3
health: 0
role: agent
/nodes/{ip}/units/{unit}:
get:
tags: ["Monitoring"]
parameters:
- in: path
name: ip
required: true
schema:
type: string
- in: path
name: unit
required: true
schema:
type: string
responses:
200:
description: Get DC/OS systemd unit by id from specific node. Similar to `/units/{unit}/nodes/{ip}`
content:
application/json:
examples:
list:
value:
id: dcos-diagnostics.service
name: DC/OS Diagnostics Agent
health: 0
description: exposes component health
/nodes/units:
get:
tags: ["Monitoring"]
responses:
200:
description: Get host DC/OS systemd units
content:
application/json: {}
/units/{unit}:
get:
tags: ["Monitoring"]
parameters:
- in: path
name: ip
required: true
schema:
type: string
- in: path
name: unit
required: true
schema:
type: string
responses:
200:
description: Get host DC/OS systemd unint by id
content:
application/json: {}
/units/{unit}/nodes:
get:
tags: ["Monitoring"]
parameters:
- in: path
name: unit
required: true
schema:
type: string
responses:
200:
description: Get infromathon from all DC/OS nodes about specific unint
content:
application/json: {}
/units/{unit}/nodes/{ip}:
get:
tags: ["Monitoring"]
parameters:
- in: path
name: ip
required: true
schema:
type: string
- in: path
name: unit
required: true
schema:
type: string
responses:
200:
description: Get infromathon for specific DC/OS node about specific unint similar to `/nodes/{ip}/units/{unit}`
content:
application/json: {}
/logs:
get:
tags: ["Monitoring"]
responses:
200:
description: Get diagnostics bundle conetnt configuration for node. This is used by deprecated cluster bundle API.
content:
application/json:
examples:
list:
value:
/etc/resolv.conf:
PortAndPath: ':443/system/health/v1/logs/files/etc_resolv.conf'
Optional: false
5050-master_flags.json:
PortAndPath: ':5050/master/flags'
Optional: true
dcos-adminrouter.service:
PortAndPath: ':443/system/health/v1/logs/units/dcos-adminrouter.service'
Optional: false
iptables-save.output:
PortAndPath: ':443/system/health/v1/logs/cmds/iptables-save.output'
Optional: false
/logs/{provider}/{entitiy}:
get:
tags: ["Monitoring"]
parameters:
- in: path
name: provider
required: true
schema:
type: string
- in: path
name: entitiy
required: true
schema:
$ref: "#/components/schemas/entity"
responses:
200:
description: Gets file, systemd logs or command output. This is used by deprecated cluster bundle API.
/metrics:
get:
responses:
200:
description: Metrics in prometheus format
/debug/pprof/:
get:
tags: ["Debug"]
responses:
200:
description: An HTML page listing the available profiles
/debug/pprof/{profile}:
get:
tags: ["Debug"]
parameters:
- in: path
name: profile
required: true
schema:
$ref: "#/components/schemas/pprofProfile"
responses:
200:
content:
application/octet-stream: {}
"text/plain; charset=utf-8": {}
description: Responds with the execution trace in binary form.
/diagnostics:
get:
tags: ["Cluster Bundle"]
summary: List all bundles
responses:
200:
description: "List of all cluster bundles and their metadata"
content:
application/json:
examples:
bundle:
$ref: "#/components/examples/bundles"
schema:
$ref: "#/components/schemas/bundles"
/diagnostics/{id}:
get:
tags: ["Cluster Bundle"]
summary: Get specific bundle metadata
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
200:
description: "Bundle metadata"
content:
application/json:
examples:
bundle:
$ref: "#/components/examples/bundle"
schema:
$ref: "#/components/schemas/bundle"
put:
tags: ["Cluster Bundle"]
summary: Generate new bundle
description: Starts process of generating new bundle
parameters:
- in: path
name: id
required: true
schema:
type: string
requestBody:
required: false
content:
application/json:
schema:
$ref: "#/components/schemas/bundleOptions"
responses:
200:
description: "Bundle metadata"
content:
application/json:
schema:
$ref: "#/components/schemas/bundle"
409:
description: "Bundle with given id already exists"
content:
application/json:
schema:
$ref: "#/components/schemas/error"
example:
code: 409
error: bundle 123e4567-e89b-12d3-a456-426655440001 already exists
507:
description: There is a problem with storage
content:
application/json:
schema:
$ref: "#/components/schemas/error"
example:
code: 507
error: could not create bundle 123e4567-e89b-12d3-a456-426655440001 workdir
delete:
tags: ["Cluster Bundle"]
summary: Remove bundle file
description: Removes bundle but keeps its metadata
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
200:
description: "Bundle metadata"
content:
application/zip:
examples:
bundle:
$ref: "#/components/examples/bundle"
schema:
$ref: "#/components/schemas/bundle"
/diagnostics/{id}/file:
get:
tags: ["Cluster Bundle"]
summary: Get bundle data
description: Return bundle content
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/zip:
schema:
type: string
format: binary
/node/diagnostics:
get:
tags: ["Local Bundle"]
summary: List all bundles
responses:
200:
description: "List of all local bundles and their metadata"
content:
application/json:
examples:
bundle:
$ref: "#/components/examples/bundles"
schema:
$ref: "#/components/schemas/bundles"
/node/diagnostics/{id}:
get:
tags: ["Local Bundle"]
summary: Get specific bundle metadata
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
200:
description: "Bundle metadata"
content:
application/json:
examples:
bundle:
$ref: "#/components/examples/bundle"
schema:
$ref: "#/components/schemas/bundle"
put:
tags: ["Local Bundle"]
summary: Generate new bundle
description: Starts process of generating new bundle
parameters:
- in: path
name: id
required: true
schema:
type: string
requestBody:
required: false
content:
application/json:
schema:
$ref: "#/components/schemas/bundleOptions"
responses:
200:
description: "Bundle metadata"
content:
application/json:
schema:
$ref: "#/components/schemas/bundle"
409:
description: "Bundle with given id already exists"
content:
application/json:
schema:
$ref: "#/components/schemas/error"
example:
code: 409
error: bundle 123e4567-e89b-12d3-a456-426655440001 already exists
507:
description: There is a problem with storage
content:
application/json:
schema:
$ref: "#/components/schemas/error"
example:
code: 507
error: could not create bundle 123e4567-e89b-12d3-a456-426655440001 workdir
delete:
tags: ["Local Bundle"]
summary: Remove bundle file
description: Removes bundle but keeps its metadata
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
200:
description: "Bundle metadata"
content:
application/zip:
examples:
bundle:
$ref: "#/components/examples/bundle"
schema:
$ref: "#/components/schemas/bundle"
/node/diagnostics/{id}/file:
get:
tags: ["Local Bundle"]
summary: Get bundle data
description: Return bundle content
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/zip:
schema:
type: string
format: binary
/report/diagnostics/create:
post:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Starts proces of creating cluster bundle. At given time there could only single cluster bundle generation process.
content:
application/json:
examples:
success:
value:
response_http_code: 200
version: 1
status: Job has been successfully started
errors: null
extra:
bundle_name: bundle-2019-11-26-1574774004.zip
409:
description: Can't start new cluster bundle generation process because another one is still running
content:
application/json:
examples:
error:
value:
response_http_code: 409
version: 1
status: Job is already running
errors: null
extra:
bundle_name: ''
/report/diagnostics/cancel:
post:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Stops proces of creating cluster bundle
content:
application/json: {}
/report/diagnostics/status:
get:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Get status of the last cluster bundle generation process from singel master
content:
application/json:
examples:
success:
value:
is_running: false
status: Diagnostics job successfully collected all data
last_bundle_dir: /var/lib/dcos/dcos-diagnostics/diag-bundles/bundle-2019-11-26-1574774154.zip
job_started: '2019-11-26 13:15:54.708377755 +0000 UTC m=+286.920941479'
job_ended: '2019-11-26 13:15:59.278120104 +0000 UTC m=+291.490683790'
job_duration: 4.569742311s
job_progress_percentage: 100
diagnostics_bundle_dir: /var/lib/dcos/dcos-diagnostics/diag-bundles
diagnostics_job_timeout_min: 720
journald_logs_since_hours: 24h
diagnostics_job_get_since_url_timeout_min: 8
command_exec_timeout_sec: 50
diagnostics_partition_disk_usage_percent: 58.12225648925586
/report/diagnostics/status/all:
get:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Get status of the last cluster bundle generation process from all masters
content:
application/json: {}
/report/diagnostics/list:
get:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Get list of the generated cluster bundles from single master
content:
application/json:
examples:
success:
value:
- file_name: /system/health/v1/report/diagnostics/serve/bundle-2019-11-26-1574774004.zip
file_size: 1693145
- file_name: /system/health/v1/report/diagnostics/serve/bundle-2019-11-26-1574774154.zip
file_size: 2783766
/report/diagnostics/list/all:
get:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Get list of the generated cluster bundles from all masters
content:
application/json: {}
/report/diagnostics/serve/{file}:
parameters:
- in: path
name: file
required: true
schema:
type: string
get:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Download cluster bundle file
content:
application/octet-stream: {}
/report/diagnostics/delete/{file}:
parameters:
- in: path
name: file
required: true
schema:
type: string
post:
tags: ["Deprecated Cluster Bundle"]
responses:
200:
description: Delete cluster bundle file
content:
application/json: {}
components:
examples:
bundle:
value: &deleted
id: 123e4567-e89b-12d3-a456-426655440001
size: 494
status: Deleted
started_at: '2015-08-05T09:40:51.62Z'
stopped_at: '2015-08-05T10:40:51.62Z'
errors:
- 'could not collect collector-1: some error'
bundle-started:
value: &started
id: 123e4567-e89b-12d3-a456-426655440002
size: 0
status: Started
started_at: '2015-08-05T09:40:51.62Z'
bundle-unknown:
value: &unknown
id: bundle-state-not-json
status: Unknown
started_at: '0001-01-01T00:00:00Z'
stopped_at: '0001-01-01T00:00:00Z'
errors:
- 'could not unmarshal state file bundle-state-not-json: invalid character ''i'' looking for beginning of value'
bundles:
value:
- *deleted
- *started
- *unknown
schemas:
bundleOptions:
type: "object"
properties:
masters:
type: "boolean"
default: true
description: "information if we should include information about masters"
agents:
type: "boolean"
default: true
description: "information if we should include information about masters"
bundles:
type: "array"
items:
$ref: "#/components/schemas/bundle"
bundle:
type: "object"
properties:
id:
type: "string"
started_at:
type: "string"
format: "date-time"
stoped_at:
type: "string"
format: "date-time"
size:
type: "integer"
errors:
type: array
items:
type: string
status:
type: "string"
enum:
- "Unknown"
- "Started"
- "InProgress"
- "Done"
- "Canceled"
- "Deleted"
- "Failed"
description: >
Status:
* `Unknown` - No information about this bundle
* `Started` - Diagnostics is preparing
* `InProgress` - Diagnostics in progress
* `Done` - Diagnostics finished and the file is ready to be downloaded
* `Canceled` - Diagnostics has been cancelled
* `Deleted` - Diagnostics was finished but was deleted
* `Failed` - Diagnostics could not be downloaded
error:
type: "object"
properties:
code:
type: integer
error:
type: string
entity:
type: "string"
enum:
- files
- units
- cmds
pprofProfile:
type: "string"
enum:
- allocs
- block
- cmdline
- goroutine
- heap
- mutex
- profile
- threadcreate
- trace
description: >
Profile:
* `allocs` – A sampling of all past memory allocations
* `block` – Stack traces that led to blocking on synchronization primitives
* `cmdline` – The command line invocation of the current program
* `goroutine` – Stack traces of all current goroutines
* `heap` – A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample
* `mutex` – Stack traces of holders of contended mutexes
* `profile` – CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile
* `threadcreate` – Stack traces that led to the creation of new OS threads
* `trace` – A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace