-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
1198 lines (1192 loc) · 40.1 KB
/
openapi.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
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
version: 1.0.0
title: KDB.AI Rest API
servers:
- url: "{protocol}://{host}.com"
variables:
protocol:
enum:
- http
- https
default: https
host:
default: cloud.kdb.ai
description: KDB.AI server
paths:
/api/v1/config/table:
get:
operationId: kdb.ai.table.list
summary: Get a list of existing tables with metadata.
tags:
- table
security:
- APIKeyAuth: []
responses:
'200':
description: Operation completed successfully.
content:
application/json:
schema:
title: trades
type: array
items:
$ref: '#/components/schemas/Table'
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
/api/v1/config/table/{name}:
get:
operationId: kdb.ai.table.meta
summary: Get table metadata.
tags:
- table
security:
- APIKeyAuth: []
parameters:
- in: path
name: name
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Table'
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
example:
{
"type": "splayed",
"blockSize": 10000,
"prtnCol": "realTime",
"sortColsOrd": "sym",
"sortColsDisk": "sym",
"columns": [{
"name": "time",
"description": "Time",
"type": "timespan"
}, {
"name": "sym",
"description": "Symbol name",
"type": "symbol",
"attrMem": "grouped",
"attrDisk": "parted",
"attrOrd": "parted"
}, {
"name": "realTime",
"description": "Real timestamp",
"type": "timestamp"
}, {
"name": "price",
"description": "Trade price",
"type": "reals",
"vectorIndex": {
"type": "flat",
"metric": "L2",
"dims": 10
}
}, {
"name": "size",
"description": "Trade size",
"type": "long"
}
]
}
delete:
operationId: kdb.ai.table.delete
summary: Drop table.
tags:
- table
security:
- APIKeyAuth: []
parameters:
- in: path
name: name
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
example: {"message": "success"}
'400':
description: Failed to clean up data from table.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: {"error":"Failed to clean up data from table, table not removed"}
'404':
description: Table not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: {"error":"Table trade not found"}
post:
operationId: kdb.ai.table.create
summary: Create new table.
tags:
- table
security:
- APIKeyAuth: []
parameters:
- in: path
name: name
required: true
schema:
type: string
requestBody:
description: An object with table metadata and list of columns
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Table'
example:
{
"type": "splayed",
"blockSize": 10000,
"prtnCol": "realTime",
"sortColsOrd": "sym",
"sortColsDisk": "sym",
"columns": [
{
"name": "time",
"description": "Time",
"type": "timespan"
},
{
"name": "sym",
"description": "Symbol name",
"type": "symbol",
"attrMem": "grouped",
"attrDisk": "parted",
"attrOrd": "parted"
},
{
"name": "realTime",
"description": "Real timestamp",
"type": "timestamp"
},
{
"name": "price",
"description": "Trade price",
"type": "reals",
"vectorIndex": {
"type": "flat",
"metric": "L2",
"dims": 10
}
},
{
"name": "size",
"description": "Trade size",
"type": "long"
}
]
}
responses:
'200':
description: Table created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
example: {"message": "success"}
'400':
description: \'embedding\' is provided but \'vectorIndex\' is not provided.
content:
application/json:
schema:
type: object
properties:
error:
type: string
examples:
example1:
value: {"error":"'embedding' is provided but 'vectorIndex' is not provided"}
example2:
value: {"error":"tss columns shouldnt allow embedding"}
example3:
value: {"error":"tss doesn't support the provided metrics"}
example4:
value: {"error":"Provided value of 'type' is invalid."}
example5:
value: {"error":"Provided value of 'on_insert_error' is invalid."}
example6:
value: {"error":"Embedding dimension should be a positive integer"}
example7:
value: {"error":"At least 1 additional column is required apart from the embedding column"}
example8:
value: {"error":"b parameter in sparse index must be numeric"}
example9:
value: {"error":"k parameter in sparse index must be numeric"}
/api/v1/insert:
post:
operationId: kdb.ai.insert
summary: Insert data into a table.
description: Request body is a tuple of (target table name, data table) serialized into a PyKX octet stream with pykx._wrappers._to_bytes(6, pykx.toq([table, data]), 1)[1])
security:
- APIKeyAuth: []
requestBody:
description: A binary octet stream of (target table name, data table), or a JSON body of 'table' and 'rows'
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
description: A tuple of (target table name, data table) serialized into a PyKX octet stream with bytes(pykx.serialize([table, data])).
application/json:
schema:
"$ref": "#/components/schemas/InsertRequestBody"
example:
{
"table" : "myTable",
"rows" : [
{ "column1": "value1", "column2": [1,2,3] },
{ "column1": "value2", "column2": [4,5,6] }
]
}
responses:
'200':
description: Operation completed successfully.
content:
text/plain:
schema:
$ref: '#/components/schemas/SuccessResponse'
example: Insert successful.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
/api/v1/train:
post:
operationId: kdb.ai.train
summary: Train index on the table (IVF and IVFPQ only).
description: Request body is a tuple of (target table name, data table)
tags:
- operations
security:
- APIKeyAuth: []
requestBody:
description: A binary octet stream of (target table name, data table), or a JSON body of 'table' and 'rows'
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
description: A tuple of (target table name, data table) serialized into a PyKX octet stream with pykx._wrappers._to_bytes(6, pykx.toq([table, data]), 1)[1])
application/json:
schema:
"$ref": "#/components/schemas/InsertRequestBody"
responses:
'200':
description: Operation completed successfully.
content:
text/plain:
schema:
$ref: '#/components/schemas/SuccessResponse'
example: {"message": "Index training complete, XXX extra rows discarded"}
'202':
description: Some records are cached for training
content:
text/plain:
schema:
type: object
properties:
message:
type: string
example: {"message": "XXX records cached for training, threshold is YYY"}
'400':
description: Request training on an index that is already trained
content:
text/plain:
schema:
type: object
properties:
error:
type: string
examples:
example1:
value: {"error": "Index is already trained"}
example2:
value: {"error": "Index does not require training"}
example3:
value: {"error": "Error persisting Trained Index to disk, to Persist Index please drop, recreate, and retrain."}
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
/api/v1/kxi/search:
post:
operationId: kdb.ai.search
summary: Vector similarity search
tags:
- operations
security:
- APIKeyAuth: []
requestBody:
description: Search parameters to be used.
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/SearchQuery"
responses:
'200':
description: A 2 element list of (RCHeader, search result data).
content:
application/json:
schema:
"$ref": "#/components/schemas/RCResponse"
example:
{
"header": {
"rcvTS": "2023-08-30T07:20:24.545000000",
"corr": "0b15ed6f-5fd1-4cf4-b361-7038cfd24cdb",
"protocol": "gw",
"logCorr": "0b15ed6f-5fd1-4cf4-b361-7038cfd24cdb",
"client": ":172.18.0.2:8081",
"http": "json",
"api": ".kxi.search",
"userName": "",
"userID": "00000000-0000-0000-0000-000000000000",
"retryCount": 0,
"to": "2023-08-30T07:21:24.545000000",
"agg": ":172.18.0.2:9004",
"pvVer": 145,
"rpID": 1,
"refVintage": 79,
"startTS": null,
"endTS": null,
"rc": 0,
"ac": 0,
"ai": ""
},
"payload": [[{
"time": "0D01:28:50.439041000",
"sym": "sym_728",
"realTime": "2023-08-29T12:56:45.159658000",
"price": [0.0766345, 0.09716096, 0.2582242, 0.1446433, 0.06520764, 0.6225908, 0.6705471, 0.47045, 0.4888564, 0.1844551],
"size": 61,
"__nn_distance": 1.438747
}, {
"time": "0D01:06:42.336717000",
"sym": "sym_840",
"realTime": "2023-08-29T12:56:46.267478000",
"price": [0.3075503, 0.4463586, 0.1877289, 0.3232416, 0.4390686, 0.459191, 0.3393451, 0.6452982, 0.1151347, 0.4050211],
"size": 1,
"__nn_distance": 1.546051
}
], [{
"time": "0D02:46:17.525844000",
"sym": "sym_492",
"realTime": "2023-08-29T12:56:49.141114000",
"price": [0.55154, 0.1022196, 0.009592914, 0.1932765, 0.07744465, 0.8430967, 0.3613093, 0.2235865, 0.2936444, 0.9695262],
"size": 43,
"__nn_distance": 1.336594
}, {
"time": "0D01:06:42.336717000",
"sym": "sym_840",
"realTime": "2023-08-29T12:56:46.267478000",
"price": [0.3075503, 0.4463586, 0.1877289, 0.3232416, 0.4390686, 0.459191, 0.3393451, 0.6452982, 0.1151347, 0.4050211],
"size": 1,
"__nn_distance": 1.736009
}
]]
}
'400':
description: non-positive n for sparse search
content:
text/plain:
schema:
type: object
example: {"error": "n for sparse search should be greater than 0"}
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
/api/v1/kxi/hybridSearch:
post:
operationId: kdb.ai.hybridSearch
summary: hybrid similarity search
tags:
- operations
security:
- APIKeyAuth: []
requestBody:
description: search parameters to be used.
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/HybridSearchQuery"
responses:
'200':
description: A 2 element list of (RCHeader, search result data).
content:
application/json:
schema:
"$ref": "#/components/schemas/RCResponse"
example:
{
"header": {
"rcvts": "2023-08-30t07:20:24.545000000",
"corr": "0b15ed6f-5fd1-4cf4-b361-7038cfd24cdb",
"protocol": "gw",
"logcorr": "0b15ed6f-5fd1-4cf4-b361-7038cfd24cdb",
"client": ":172.18.0.2:8081",
"http": "json",
"api": ".kxi.hybridsearch",
"username": "",
"userid": "00000000-0000-0000-0000-000000000000",
"retrycount": 0,
"to": "2023-08-30t07:21:24.545000000",
"agg": ":172.18.0.2:9004",
"pvver": 145,
"rpid": 1,
"refvintage": 79,
"startts": null,
"endts": null,
"rc": 0,
"ac": 0,
"ai": ""
},
"payload": [[{
"time": "0d01:28:50.439041000",
"sym": "sym_728",
"realtime": "2023-08-29t12:56:45.159658000",
"dense": [0.0766345, 0.09716096, 0.2582242, 0.1446433, 0.06520764, 0.6225908, 0.6705471, 0.47045, 0.4888564, 0.1844551],
"sparse": [{"12":1}],
"__nn_distance": 1.0
}, {
"time": "0d01:06:42.336717000",
"sym": "sym_840",
"realtime": "2023-08-29t12:56:46.267478000",
"dense": [0.3075503, 0.4463586, 0.1877289, 0.3232416, 0.4390686, 0.459191, 0.3393451, 0.6452982, 0.1151347, 0.4050211],
"sparse": [{"2":1,"12":2}],
"__nn_distance": 0.546051
}
], [{
"time": "0d02:46:17.525844000",
"sym": "sym_492",
"realtime": "2023-08-29t12:56:49.141114000",
"dense": [0.55154, 0.1022196, 0.009592914, 0.1932765, 0.07744465, 0.8430967, 0.3613093, 0.2235865, 0.2936444, 0.9695262],
"sparse": [{"34":1}],
"__nn_distance": 1.0
}, {
"time": "0d01:06:42.336717000",
"sym": "sym_840",
"realtime": "2023-08-29t12:56:46.267478000",
"dense": [0.3075503, 0.4463586, 0.1877289, 0.3232416, 0.4390686, 0.459191, 0.3393451, 0.6452982, 0.1151347, 0.4050211],
"sparse": [{"7":3,"12":1}],
"__nn_distance": 0.736009
}
]]
}
'400':
description: non-positive n for sparse search
content:
text/plain:
schema:
type: object
example: {"error": "n for sparse search should be greater than 0"}
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
/api/v1/data:
post:
operationId: kdb.ai.query
summary: Perform query to get data from a table
tags:
- operations
requestBody:
description: Get timeseries and splayed data from a database.
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/CanonicalQuery"
responses:
'200':
description: 'A two element list of (RCHeader; table)'
content:
application/octet-stream:
schema:
description: qipc response vector. This vector may be compressed according to https://code.kx.com/q/basics/ipc/#compression if response exceeds 2000 bytes and exceeds compression ratio
type: string
format: binary
application/json:
schema:
"$ref": "#/components/schemas/RCResponse"
example:
{
"header": {
"rcvTS": "2023-08-30T07:21:51.698000000",
"corr": "abde21fe-d49f-45cb-b6b3-3f5d27e8ea0c",
"protocol": "gw",
"logCorr": "abde21fe-d49f-45cb-b6b3-3f5d27e8ea0c",
"client": ":172.18.0.2:8081",
"http": "json",
"api": ".kxi.getData",
"userName": "",
"userID": "00000000-0000-0000-0000-000000000000",
"retryCount": 0,
"to": "2023-08-30T07:22:51.698000000",
"agg": ":172.18.0.2:9004",
"pvVer": 145,
"rpID": 1,
"refVintage": 79,
"startTS": "2023-08-29T00:00:00.000000000",
"endTS": "2023-08-29T23:00:00.000000000",
"rc": 0,
"ac": 0,
"ai": ""
},
"payload": [{
"sym": "sym_104",
"avgSize": 13,
"maxSize": 13
}, {
"sym": "sym_159",
"avgSize": 21,
"maxSize": 21
}, {
"sym": "sym_160",
"avgSize": 64,
"maxSize": 64
}, {
"sym": "sym_185",
"avgSize": 61,
"maxSize": 74
}, {
"sym": "sym_187",
"avgSize": 24,
"maxSize": 24
}, {
"sym": "sym_197",
"avgSize": 20,
"maxSize": 20
}, {
"sym": "sym_203",
"avgSize": 52,
"maxSize": 52
}, {
"sym": "sym_220",
"avgSize": 12,
"maxSize": 12
}, {
"sym": "sym_23",
"avgSize": 30,
"maxSize": 30
}
]
}
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
$ref: "#/components/responses/InternalServerError"
"503":
$ref: "#/components/responses/ServiceUnavailable"
x-codeSamples:
- lang: curl
source: |
curl -X POST \
--header "Content-Type: application/json" \
--header "Accepted: application/json" \
--data '{"table":"trace", "startTS":"2021.05.09D00:00:00.000000000", "endTS":"2021.05.09D23:00:00.000000000", "agg":[["avgPrice", "avg", "price"],["sdevPrice","sdev","price"]], "groupBy": "sym", "filter": [[">","price", 114.7]]}' \
"http://${URL}/data"
- lang: curl-octet-stream
source: |
# Save result to file
curl -X POST -o results.dat \
--header "Content-Type: application/json" \
--header "Accepted: application/octet-stream" \
--data '{"table":"trace", "startTS":"2021.05.09D00:00:00.000000000", "endTS":"2021.05.09D23:00:00.000000000", "agg":[["avgPrice", "avg", "price"],["sdevPrice","sdev","price"]], "groupBy": "sym", "filter": [[">","price", 114.7]]}' \
"http://${URL}/data"
# Read the file in with qce, c.java, c.js, etc
qce
q) -9!read1`:results.dat
/api/v1/ready:
get:
summary: Health check endpoint, returns 200 OK if the service is operating correctly
operationId: check
tags:
- ai.heath
responses:
'200':
description: OK
content:
text/plain:
schema:
$ref: '#/components/schemas/SuccessResponse'
'400':
description: SM is not listening on port
content:
text/plain:
schema:
type: object
properties:
error:
type: string
examples:
example1:
value: {"error": "SM is not listening on port"}
example2:
value: {"error": "SM is not ready"}
example3:
value: {"error": "RC is not listening on port"}
example4:
value: {"error": "All DAPs not registered as available with RC"}
x-codeSamples:
- lang: curl
source: |
curl -v http://localhost:8082/ready/api/v1/ready
/api/v1/version:
get:
summary: Check version of kdbai
operationId: getVersion
tags:
- misc
responses:
'200':
description: OK
content:
text/plain:
schema:
title: 'APIVersion'
type: object
properties:
serverVersion:
type: string
clientMinVersion:
type: string
clientMaxVersion:
type: string
example:
{
"serverVersion": "KDBAI_DB_VERSION:-",
"clientMinVersion": "1.1.0",
"clientMaxVersion": "latest"
}
x-codeSamples:
- lang: curl
source: |
curl -v localhost:8082/api/v1/version | jq .
components:
securitySchemes:
APIKeyAuth:
type: apiKey
in: header
name: X-Api-Key
schemas:
SuccessResponse:
type: object
properties:
message:
type: string
Table:
type: object
properties:
type:
type: string
blockSize:
type: integer
prtnCol:
type: string
sortColsOrd:
type: string
sortColsDisk:
type: string
columns:
type: array
items:
type: object
properties:
name:
type: string
description:
type: string
type:
type: string
attrMem:
type: string
attrDisk:
type: string
attrOrd:
type: string
vectorIndex:
oneOf:
- $ref: '#/components/schemas/FlatIndex'
- $ref: '#/components/schemas/HNSWIndex'
- $ref: '#/components/schemas/IVFIndex'
- $ref: '#/components/schemas/IVFPQIndex'
Symbol:
type: string
x-kx-type: "-11h"
SymbolList:
type: array
items:
$ref: "#/components/schemas/Symbol"
RCResponse:
type: object
properties:
header:
$ref: "#/components/schemas/RCHeader"
payload:
type: object
RCHeader:
type: object
properties:
ai:
type: string
description: Application information. An error reason string. Used in successful HTTP responses, where a database error has occurred
ac:
type: integer
description: Application code. Non zero if a database error has occurred
rc:
type: integer
description: Return code. Non-zero if ac is set or the resource-coordinator encountered an error
CanonicalQuery:
type: object
required:
- table
properties:
table:
type: string
description: Table name
x-kx-type: "-11h"
filter:
description: List of triples describing the filter of the form comparison operator, column, values for comparison.
type: array
items:
type: array
items:
type: string
groupBy:
description: A list of column names to group by
type: array
items:
type: string
x-kx-type: "-11h"
agg:
description: List of symbol tuples defining the aggregations to perform
type: array
items:
type: array
items:
type: string
x-kx-type: "-11h"
fill:
description: Symbol describing the fill method to use
type: string
x-kx-type: "-11h"
temporality:
type: string
description: Temporality to apply to the query
x-kx-type: "-11h"
sortCols:
description: Columns to be sorted ascending, post query execution
type: array
items:
type: string
x-kx-type: "-11h"
SearchQuery:
type: object
required:
- table
- vectors
- n
properties:
table:
type: string
description: Table name
x-kx-type: "-11h"
vectors:
type: array
items:
type: array
items:
type: number
format: double
description: List of vectors to do similarity search with.
n:
type: number
format: long
default: 5
description: Number of results to return.
distances:
type: string
description: Name of the distance column to be added to the result table. If not set, __nn_distance will be used.
filter:
description: List of triples describing the filter of the form comparison operator, column, values for comparison.
type: array
items:
type: array
items:
type: string
groupBy:
description: A list of column names to group by
type: array
items:
type: string
x-kx-type: "-11h"
agg:
description: List of symbol tuples defining the aggregations to perform
type: array
items:
type: array
items:
type: string
x-kx-type: "-11h"
sortCols:
description: Columns to be sorted ascending, post query execution
type: array
items:
type: string
x-kx-type: "-11h"
efSearch:
type: number
format: long
default: 8
description: (hnsw use only) Nodes considered when searching
clusters:
type: number
format: long
default: 8
description: (ivf/ivfpq use only) The number of clusters to be traversed when searching
HybridSearchQuery:
type: object
required:
- table
- denseVectors
- sparseVectors
- n
properties:
table:
type: string
description: Table name
x-kx-type: "-11h"
denseVectors:
type: array
items:
type: array
items:
type: number
format: double
description: List of dense vectors to do similarity search with.
sparseVectors:
type: array
items:
type: object
description: List of sparse vectors to do similarity search with.
n:
type: number
format: long
default: 5
description: Number of results to return.
alpha:
type: number
format: float
description: Weight on searches, 0 is sparse, 1 is dense.
denseIndexOptions:
type: object
description: Index options
sparseIndexOptions:
type: object
description: Index options (k and/or b)
distances:
type: string
description: Name of the distance column to be added to the result table. If not set, __nn_distance will be used.
filter:
description: List of triples describing the filter of the form comparison operator, column, values for comparison.
type: array
items:
type: array
items:
type: string
groupBy:
description: A list of column names to group by
type: array
items:
type: string
x-kx-type: "-11h"
agg: