forked from oxidecomputer/omicron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clickhouse-admin-server.json
661 lines (661 loc) · 17.8 KB
/
clickhouse-admin-server.json
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
{
"openapi": "3.0.3",
"info": {
"title": "ClickHouse Cluster Admin Server API",
"description": "API for interacting with the Oxide control plane's ClickHouse cluster replica servers",
"contact": {
"url": "https://oxide.computer",
"email": "[email protected]"
},
"version": "0.0.1"
},
"paths": {
"/config": {
"put": {
"summary": "Generate a ClickHouse configuration file for a server node on a specified",
"description": "directory and enable the SMF service.",
"operationId": "generate_config_and_enable_svc",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServerConfigurableSettings"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "successful creation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReplicaConfig"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/distributed-ddl-queue": {
"get": {
"summary": "Contains information about distributed ddl queries (ON CLUSTER clause)",
"description": "that were executed on a cluster.",
"operationId": "distributed_ddl_queue",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"title": "Array_of_DistributedDdlQueue",
"type": "array",
"items": {
"$ref": "#/components/schemas/DistributedDdlQueue"
}
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/timeseries/{table}/{metric}/avg": {
"get": {
"summary": "Retrieve time series from the system database.",
"description": "The value of each data point is the average of all stored data points within the interval. These are internal ClickHouse metrics.",
"operationId": "system_timeseries_avg",
"parameters": [
{
"in": "path",
"name": "metric",
"description": "Name of the metric to retrieve.",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "table",
"description": "Table to query in the `system` database",
"required": true,
"schema": {
"$ref": "#/components/schemas/SystemTable"
}
},
{
"in": "query",
"name": "interval",
"description": "The interval to collect monitoring metrics in seconds. Default is 60 seconds.",
"schema": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
{
"in": "query",
"name": "time_range",
"description": "Range of time to collect monitoring metrics in seconds. Default is 86400 seconds (24 hrs).",
"schema": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
{
"in": "query",
"name": "timestamp_format",
"description": "Format in which each timeseries timestamp will be in. Default is UTC",
"schema": {
"$ref": "#/components/schemas/TimestampFormat"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"title": "Array_of_SystemTimeSeries",
"type": "array",
"items": {
"$ref": "#/components/schemas/SystemTimeSeries"
}
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
}
},
"components": {
"schemas": {
"ClickhouseHost": {
"oneOf": [
{
"type": "object",
"properties": {
"ipv6": {
"type": "string",
"format": "ipv6"
}
},
"required": [
"ipv6"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ipv4": {
"type": "string",
"format": "ipv4"
}
},
"required": [
"ipv4"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"domain_name": {
"type": "string"
}
},
"required": [
"domain_name"
],
"additionalProperties": false
}
]
},
"DistributedDdlQueue": {
"description": "Contains information about distributed ddl queries (ON CLUSTER clause) that were executed on a cluster.",
"type": "object",
"properties": {
"cluster": {
"description": "Cluster name",
"type": "string"
},
"entry": {
"description": "Query id",
"type": "string"
},
"entry_version": {
"description": "Version of the entry",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"exception_code": {
"description": "Exception code",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"exception_text": {
"description": "Exception message",
"type": "string"
},
"host": {
"description": "Hostname",
"type": "string",
"format": "ipv6"
},
"initiator_host": {
"description": "Host that initiated the DDL operation",
"type": "string"
},
"initiator_port": {
"description": "Port used by the initiator",
"type": "integer",
"format": "uint16",
"minimum": 0
},
"port": {
"description": "Host Port",
"type": "integer",
"format": "uint16",
"minimum": 0
},
"query": {
"description": "Query executed",
"type": "string"
},
"query_create_time": {
"description": "Query created time",
"type": "string",
"format": "date-time"
},
"query_duration_ms": {
"description": "Duration of query execution (in milliseconds)",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"query_finish_time": {
"description": "Query finish time",
"type": "string",
"format": "date-time"
},
"settings": {
"description": "Settings used in the DDL operation",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"status": {
"description": "Status of the query",
"type": "string"
}
},
"required": [
"cluster",
"entry",
"entry_version",
"exception_code",
"exception_text",
"host",
"initiator_host",
"initiator_port",
"port",
"query",
"query_create_time",
"query_duration_ms",
"query_finish_time",
"settings",
"status"
]
},
"Error": {
"description": "Error information from a response.",
"type": "object",
"properties": {
"error_code": {
"type": "string"
},
"message": {
"type": "string"
},
"request_id": {
"type": "string"
}
},
"required": [
"message",
"request_id"
]
},
"Generation": {
"description": "Generation numbers stored in the database, used for optimistic concurrency control",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"KeeperConfigsForReplica": {
"type": "object",
"properties": {
"nodes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/KeeperNodeConfig"
}
}
},
"required": [
"nodes"
]
},
"KeeperNodeConfig": {
"type": "object",
"properties": {
"host": {
"$ref": "#/components/schemas/ClickhouseHost"
},
"port": {
"type": "integer",
"format": "uint16",
"minimum": 0
}
},
"required": [
"host",
"port"
]
},
"LogConfig": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"errorlog": {
"type": "string",
"format": "Utf8PathBuf"
},
"level": {
"$ref": "#/components/schemas/LogLevel"
},
"log": {
"type": "string",
"format": "Utf8PathBuf"
},
"size": {
"type": "integer",
"format": "uint16",
"minimum": 0
}
},
"required": [
"count",
"errorlog",
"level",
"log",
"size"
]
},
"LogLevel": {
"type": "string",
"enum": [
"trace",
"debug"
]
},
"Macros": {
"type": "object",
"properties": {
"cluster": {
"type": "string"
},
"replica": {
"$ref": "#/components/schemas/ServerId"
},
"shard": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"required": [
"cluster",
"replica",
"shard"
]
},
"RemoteServers": {
"type": "object",
"properties": {
"cluster": {
"type": "string"
},
"replicas": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ServerNodeConfig"
}
},
"secret": {
"type": "string"
}
},
"required": [
"cluster",
"replicas",
"secret"
]
},
"ReplicaConfig": {
"description": "Configuration for a ClickHouse replica server",
"type": "object",
"properties": {
"data_path": {
"description": "Directory for all files generated by ClickHouse itself",
"type": "string",
"format": "Utf8PathBuf"
},
"http_port": {
"description": "Port for HTTP connections",
"type": "integer",
"format": "uint16",
"minimum": 0
},
"interserver_http_port": {
"description": "Port for interserver HTTP connections",
"type": "integer",
"format": "uint16",
"minimum": 0
},
"keepers": {
"description": "Contains settings that allow ClickHouse servers to interact with a Keeper cluster",
"allOf": [
{
"$ref": "#/components/schemas/KeeperConfigsForReplica"
}
]
},
"listen_host": {
"description": "Address the server is listening on",
"type": "string",
"format": "ipv6"
},
"logger": {
"description": "Logging settings",
"allOf": [
{
"$ref": "#/components/schemas/LogConfig"
}
]
},
"macros": {
"description": "Parameter substitutions for replicated tables",
"allOf": [
{
"$ref": "#/components/schemas/Macros"
}
]
},
"remote_servers": {
"description": "Configuration of clusters used by the Distributed table engine and bythe cluster table function",
"allOf": [
{
"$ref": "#/components/schemas/RemoteServers"
}
]
},
"tcp_port": {
"description": "Port for TCP connections",
"type": "integer",
"format": "uint16",
"minimum": 0
}
},
"required": [
"data_path",
"http_port",
"interserver_http_port",
"keepers",
"listen_host",
"logger",
"macros",
"remote_servers",
"tcp_port"
]
},
"ServerConfigurableSettings": {
"description": "The top most type for configuring clickhouse-servers via clickhouse-admin-server-api",
"type": "object",
"properties": {
"generation": {
"description": "A unique identifier for the configuration generation.",
"allOf": [
{
"$ref": "#/components/schemas/Generation"
}
]
},
"settings": {
"description": "Configurable settings for a ClickHouse replica server node.",
"allOf": [
{
"$ref": "#/components/schemas/ServerSettings"
}
]
}
},
"required": [
"generation",
"settings"
]
},
"ServerId": {
"description": "A unique ID for a Clickhouse Server",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"ServerNodeConfig": {
"type": "object",
"properties": {
"host": {
"$ref": "#/components/schemas/ClickhouseHost"
},
"port": {
"type": "integer",
"format": "uint16",
"minimum": 0
}
},
"required": [
"host",
"port"
]
},
"ServerSettings": {
"description": "Configurable settings for a ClickHouse replica server node.",
"type": "object",
"properties": {
"config_dir": {
"description": "Directory for the generated server configuration XML file",
"type": "string",
"format": "Utf8PathBuf"
},
"datastore_path": {
"description": "Directory for all files generated by ClickHouse itself",
"type": "string",
"format": "Utf8PathBuf"
},
"id": {
"description": "Unique ID of the server node",
"allOf": [
{
"$ref": "#/components/schemas/ServerId"
}
]
},
"keepers": {
"description": "Addresses for each of the individual nodes in the Keeper cluster",
"type": "array",
"items": {
"$ref": "#/components/schemas/ClickhouseHost"
}
},
"listen_addr": {
"description": "Address the server is listening on",
"type": "string",
"format": "ipv6"
},
"remote_servers": {
"description": "Addresses for each of the individual replica servers",
"type": "array",
"items": {
"$ref": "#/components/schemas/ClickhouseHost"
}
}
},
"required": [
"config_dir",
"datastore_path",
"id",
"keepers",
"listen_addr",
"remote_servers"
]
},
"SystemTimeSeries": {
"description": "Retrieved time series from the internal `system` database.",
"type": "object",
"properties": {
"time": {
"type": "string"
},
"value": {
"type": "number",
"format": "double"
}
},
"required": [
"time",
"value"
]
},
"SystemTable": {
"description": "Available metrics tables in the `system` database",
"type": "string",
"enum": [
"asynchronous_metric_log",
"metric_log"
]
},
"TimestampFormat": {
"description": "Which format should the timestamp be in.",
"type": "string",
"enum": [
"utc",
"unix_epoch"
]
}
},
"responses": {
"Error": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}