Elffuss BraidHub

kikocis/lancedb public

main · 14.5 KiBRawPermalink
1openapi: 3.1.0
2info:
3 version: 1.0.0
4 title: LanceDB Cloud API
5 description: |
6 LanceDB Cloud API is a RESTful API that allows users to access and modify data stored in LanceDB Cloud.
7 Table actions are considered temporary resource creations and all use POST method.
8 contact:
9 name: LanceDB support
10 url: https://lancedb.com
11 email: contact@lancedb.com
12
13servers:
14 - url: https://{db}.{region}.api.lancedb.com
15 description: LanceDB Cloud REST endpoint.
16 variables:
17 db:
18 default: ""
19 description: the name of DB
20 region:
21 default: "us-east-1"
22 description: the service region of the DB
23
24security:
25 - key_auth: []
26
27components:
28 securitySchemes:
29 key_auth:
30 name: x-api-key
31 type: apiKey
32 in: header
33 parameters:
34 table_name:
35 name: name
36 in: path
37 description: name of the table
38 required: true
39 schema:
40 type: string
41 responses:
42 invalid_request:
43 description: Invalid request
44 content:
45 text/plain:
46 schema:
47 type: string
48 not_found:
49 description: Not found
50 content:
51 text/plain:
52 schema:
53 type: string
54 unauthorized:
55 description: Unauthorized
56 content:
57 text/plain:
58 schema:
59 type: string
60 requestBodies:
61 arrow_stream_buffer:
62 description: Arrow IPC stream buffer
63 required: true
64 content:
65 application/vnd.apache.arrow.stream:
66 schema:
67 type: string
68 format: binary
69
70paths:
71 /v1/table/:
72 get:
73 description: List tables, optionally, with pagination.
74 tags:
75 - Tables
76 summary: List Tables
77 operationId: listTables
78 parameters:
79 - name: limit
80 in: query
81 description: Limits the number of items to return.
82 schema:
83 type: integer
84 - name: page_token
85 in: query
86 description: Specifies the starting position of the next query
87 schema:
88 type: string
89 responses:
90 "200":
91 description: Successfully returned a list of tables in the DB
92 content:
93 application/json:
94 schema:
95 type: object
96 properties:
97 tables:
98 type: array
99 items:
100 type: string
101 page_token:
102 type: string
103
104 "400":
105 $ref: "#/components/responses/invalid_request"
106 "401":
107 $ref: "#/components/responses/unauthorized"
108 "404":
109 $ref: "#/components/responses/not_found"
110
111 /v1/table/{name}/create/:
112 post:
113 description: Create a new table
114 summary: Create a new table
115 operationId: createTable
116 tags:
117 - Tables
118 parameters:
119 - $ref: "#/components/parameters/table_name"
120 requestBody:
121 $ref: "#/components/requestBodies/arrow_stream_buffer"
122 responses:
123 "200":
124 description: Table successfully created
125 "400":
126 $ref: "#/components/responses/invalid_request"
127 "401":
128 $ref: "#/components/responses/unauthorized"
129 "404":
130 $ref: "#/components/responses/not_found"
131
132 /v1/table/{name}/query/:
133 post:
134 description: Vector Query
135 url: https://{db-uri}.{aws-region}.api.lancedb.com/v1/table/{name}/query/
136 tags:
137 - Data
138 summary: Vector Query
139 parameters:
140 - $ref: "#/components/parameters/table_name"
141 requestBody:
142 required: true
143 content:
144 application/json:
145 schema:
146 type: object
147 properties:
148 vector:
149 type: FixedSizeList
150 description: |
151 The targetted vector to search for. Required.
152 vector_column:
153 type: string
154 description: |
155 The column to query, it can be inferred from the schema if there is only one vector column.
156 prefilter:
157 type: boolean
158 description: |
159 Whether to prefilter the data. Optional.
160 k:
161 type: integer
162 description: |
163 The number of search results to return. Default is 10.
164 distance_type:
165 type: string
166 description: |
167 The distance metric to use for search. L2, Cosine, Dot and Hamming are supported. Default is L2.
168 bypass_vector_index:
169 type: boolean
170 description: |
171 Whether to bypass vector index. Optional.
172 filter:
173 type: string
174 description: |
175 A filter expression that specifies the rows to query. Optional.
176 columns:
177 type: array
178 items:
179 type: string
180 description: |
181 The columns to return. Optional.
182 nprobe:
183 type: integer
184 description: |
185 The number of probes to use for search. Optional.
186 refine_factor:
187 type: integer
188 description: |
189 The refine factor to use for search. Optional.
190 default: null
191 fast_search:
192 type: boolean
193 description: |
194 Whether to use fast search. Optional.
195 default: false
196 required:
197 - vector
198
199 responses:
200 "200":
201 description: top k results if query is successfully executed
202 content:
203 application/json:
204 schema:
205 type: object
206 properties:
207 results:
208 type: array
209 items:
210 type: object
211 properties:
212 id:
213 type: integer
214 selected_col_1_to_return:
215 type: col_1_type
216 selected_col_n_to_return:
217 type: col_n_type
218 _distance:
219 type: float
220
221 "400":
222 $ref: "#/components/responses/invalid_request"
223 "401":
224 $ref: "#/components/responses/unauthorized"
225 "404":
226 $ref: "#/components/responses/not_found"
227
228 /v1/table/{name}/insert/:
229 post:
230 description: Insert new data to the Table.
231 tags:
232 - Data
233 operationId: insertData
234 summary: Insert new data.
235 parameters:
236 - $ref: "#/components/parameters/table_name"
237 requestBody:
238 $ref: "#/components/requestBodies/arrow_stream_buffer"
239 responses:
240 "200":
241 description: Insert successful
242 "400":
243 $ref: "#/components/responses/invalid_request"
244 "401":
245 $ref: "#/components/responses/unauthorized"
246 "404":
247 $ref: "#/components/responses/not_found"
248 /v1/table/{name}/merge_insert/:
249 post:
250 description: Create a "merge insert" operation
251 This operation can add rows, update rows, and remove rows all in a single
252 transaction. See python method `lancedb.table.Table.merge_insert` for examples.
253 tags:
254 - Data
255 summary: Merge Insert
256 operationId: mergeInsert
257 parameters:
258 - $ref: "#/components/parameters/table_name"
259 - name: on
260 in: query
261 description: |
262 The column to use as the primary key for the merge operation.
263 required: true
264 schema:
265 type: string
266 - name: when_matched_update_all
267 in: query
268 description: |
269 Rows that exist in both the source table (new data) and
270 the target table (old data) will be updated, replacing
271 the old row with the corresponding matching row.
272 required: false
273 schema:
274 type: boolean
275 - name: when_matched_update_all_filt
276 in: query
277 description: |
278 If present then only rows that satisfy the filter expression will
279 be updated
280 required: false
281 schema:
282 type: string
283 - name: when_not_matched_insert_all
284 in: query
285 description: |
286 Rows that exist only in the source table (new data) will be
287 inserted into the target table (old data).
288 required: false
289 schema:
290 type: boolean
291 - name: when_not_matched_by_source_delete
292 in: query
293 description: |
294 Rows that exist only in the target table (old data) will be
295 deleted. An optional condition (`when_not_matched_by_source_delete_filt`)
296 can be provided to limit what data is deleted.
297 required: false
298 schema:
299 type: boolean
300 - name: when_not_matched_by_source_delete_filt
301 in: query
302 description: |
303 The filter expression that specifies the rows to delete.
304 required: false
305 schema:
306 type: string
307 requestBody:
308 $ref: "#/components/requestBodies/arrow_stream_buffer"
309 responses:
310 "200":
311 description: Merge Insert successful
312 "400":
313 $ref: "#/components/responses/invalid_request"
314 "401":
315 $ref: "#/components/responses/unauthorized"
316 "404":
317 $ref: "#/components/responses/not_found"
318 /v1/table/{name}/delete/:
319 post:
320 description: Delete rows from a table.
321 tags:
322 - Data
323 summary: Delete rows from a table
324 operationId: deleteData
325 parameters:
326 - $ref: "#/components/parameters/table_name"
327 requestBody:
328 required: true
329 content:
330 application/json:
331 schema:
332 type: object
333 properties:
334 predicate:
335 type: string
336 description: |
337 A filter expression that specifies the rows to delete.
338 responses:
339 "200":
340 description: Delete successful
341 "401":
342 $ref: "#/components/responses/unauthorized"
343 /v1/table/{name}/drop/:
344 post:
345 description: Drop a table
346 tags:
347 - Tables
348 summary: Drop a table
349 operationId: dropTable
350 parameters:
351 - $ref: "#/components/parameters/table_name"
352 requestBody:
353 $ref: "#/components/requestBodies/arrow_stream_buffer"
354 responses:
355 "200":
356 description: Drop successful
357 "401":
358 $ref: "#/components/responses/unauthorized"
359
360 /v1/table/{name}/describe/:
361 post:
362 description: Describe a table and return Table Information.
363 tags:
364 - Tables
365 summary: Describe a table
366 operationId: describeTable
367 parameters:
368 - $ref: "#/components/parameters/table_name"
369 responses:
370 "200":
371 description: Table information
372 content:
373 application/json:
374 schema:
375 type: object
376 properties:
377 table:
378 type: string
379 version:
380 type: integer
381 schema:
382 type: string
383 stats:
384 type: object
385 "401":
386 $ref: "#/components/responses/unauthorized"
387 "404":
388 $ref: "#/components/responses/not_found"
389
390 /v1/table/{name}/index/list/:
391 post:
392 description: List indexes of a table
393 tags:
394 - Tables
395 summary: List indexes of a table
396 operationId: listIndexes
397 parameters:
398 - $ref: "#/components/parameters/table_name"
399 responses:
400 "200":
401 description: Available list of indexes on the table.
402 content:
403 application/json:
404 schema:
405 type: object
406 properties:
407 indexes:
408 type: array
409 items:
410 type: object
411 properties:
412 columns:
413 type: array
414 items:
415 type: string
416 index_name:
417 type: string
418 index_uuid:
419 type: string
420 "401":
421 $ref: "#/components/responses/unauthorized"
422 "404":
423 $ref: "#/components/responses/not_found"
424 /v1/table/{name}/create_index/:
425 post:
426 description: Create vector index on a Table
427 tags:
428 - Tables
429 summary: Create vector index on a Table
430 operationId: createIndex
431 parameters:
432 - $ref: "#/components/parameters/table_name"
433 requestBody:
434 required: true
435 content:
436 application/json:
437 schema:
438 type: object
439 properties:
440 column:
441 type: string
442 metric_type:
443 type: string
444 nullable: false
445 description: |
446 The metric type to use for the index. L2, Cosine, Dot are supported.
447 index_type:
448 type: string
449 responses:
450 "200":
451 description: Index successfully created
452 "400":
453 $ref: "#/components/responses/invalid_request"
454 "401":
455 $ref: "#/components/responses/unauthorized"
456 "404":
457 $ref: "#/components/responses/not_found"
458 /v1/table/{name}/create_scalar_index/:
459 post:
460 description: Create a scalar index on a table
461 tags:
462 - Tables
463 summary: Create a scalar index on a table
464 operationId: createScalarIndex
465 parameters:
466 - $ref: "#/components/parameters/table_name"
467 requestBody:
468 required: true
469 content:
470 application/json:
471 schema:
472 type: object
473 properties:
474 column:
475 type: string
476 index_type:
477 type: string
478 required: false
479 responses:
480 "200":
481 description: Scalar Index successfully created
482 "400":
483 $ref: "#/components/responses/invalid_request"
484 "401":
485 $ref: "#/components/responses/unauthorized"
486 "404":
487 $ref: "#/components/responses/not_found"