mindsdb

Форк
0
/
openapi.yml 
1246 строк · 35.6 Кб
1
openapi: 3.0.0
2
info:
3
  title: MindsDB API
4
  description: >-
5
    OpenAPI Specification for MindsDB's REST API. Each API Endpoint corresponds
6
    to a specific SQL Statement e.g POST /model => CREATE MODEL
7
  version: 0.0.1
8
  contact:
9
    email: admin@mindsdb.com
10
  license:
11
    name: GNU General Public License v3.0
12
    url: 'https://github.com/mindsdb/mindsdb/blob/staging/LICENSE'
13
servers:
14
  - url: 'http://127.0.0.1:47334/v1/api'
15
    description: MindsDB local deployments
16
components:
17
  schemas:
18
    Database:
19
      type: object
20
      properties:
21
        name:
22
          type: string
23
        engine:
24
          type: string
25
          description: Handler used to create this database (e.g. postgres)
26
        type:
27
          type: string
28
          description: Type of database (data | project | system)
29
    Model:
30
      type: object
31
      properties:
32
        name:
33
          type: string
34
        accuracy:
35
          type: number
36
          description: Accuracy of trained model between 0 and 1
37
        active:
38
          type: boolean
39
          description: Whether or not this model is currently the active version
40
        version:
41
          type: number
42
          description: Version of this model
43
        status:
44
          type: string
45
          description: Current status of this model (generating | creating | complete | error)
46
        predict:
47
          type: string
48
          description: Column name that this model predicts
49
        mindsdb_version:
50
          type: string
51
          description: MindsDB version associated with this model
52
        error:
53
          type: string
54
          description: Error encountered during training, if applicable
55
        fetch_data_query:
56
          type: string
57
          description: SQL query used to fetch training data for this model
58
        created_at:
59
          type: string
60
          description: Time model was created at in YYYY-MM-DD HH:MM:SS format (trained models only)
61
        training_time:
62
          type: string
63
          description: How long training this model took in HH:MM:SS format (trained models only)
64
        update:
65
          type: string
66
          description: Set to "available" when a new version of MindsDB is available that makes the model obsolete, or when new data is available in the data that was used to train the model (trained models only).
67
        
68
    Project:
69
      type: object
70
      properties:
71
        name:
72
          type: string
73

74
    Table:
75
      type: object
76
      properties:
77
        name:
78
          type: string
79
        type:
80
          type: string
81
          description: Type of table (data | view)
82

83
    View:
84
      type: object
85
      properties:
86
        name:
87
          type: string
88
        query:
89
          type: string
90
          description: SELECT query used to create the view
91
paths:
92
  '/api/databases':
93
    get:
94
      security:
95
        - ApiKeyAuth: []
96
      summary: Returns a list of database names.
97
      description: Gets all databases created by the user.
98
      responses:
99
        '200':
100
          description: A JSON array of database names
101
          content:
102
            application/json:
103
              schema:
104
                type: array
105
                items:
106
                  $ref: '#/components/schemas/Database'
107

108
        '401':
109
          description: Invalid API key error message
110
          content:
111
            application/json:
112
              schema:
113
                type: object
114
                items:
115
                  type: string
116
        '500':
117
          description: Server error
118
          content:
119
            application/json:
120
              schema:
121
                type: object
122
                items:
123
                  type: string
124
    post:
125
      security:
126
        - ApiKeyAuth: []
127
      summary: Creates a new database connection.
128
      description: Creates a new database connection. The example parameters below are for connecting to [MySQL](/data-integrations/mysql). See [here](/data-integrations/all-data-integrations) for which parameters to use for your datasource.
129
      requestBody:
130
        required: true
131
        content:
132
          application/json:
133
            schema:
134
              type: object
135
              properties:
136
                database:
137
                  type: object
138
                  properties:
139
                    name:
140
                      type: string
141
                    engine:
142
                      type: string
143
                    parameters:
144
                      type: object
145
                      description: Parameters used to connect to your data source. These example parameters are for connecting to [MySQL](/data-integrations/mysql). See [here](/data-integrations/all-data-integrations) for which parameters to use for your datasource.
146
                      properties:
147
                        user:
148
                          type: string
149
                        password:
150
                          type: string
151
                        host:
152
                          type: string
153
                        port:
154
                          type: string
155
                        database:
156
                          type: string
157
      responses:
158
        # OpenAPI spec defines '200' status as a successful operation, so even though the
159
        # response code is '201', we need to use '200' so docs are properly generated.
160
        '200':
161
          description: The created database
162
          content:
163
            application/json:
164
              schema:
165
                $ref: '#/components/schemas/Database'
166
        '401':
167
          description: Invalid API key error message
168
          content:
169
            application/json:
170
              schema:
171
                type: object
172
                items:
173
                  type: string
174
        '400':
175
          description: Bad request format
176
          content:
177
            application/json:
178
              schema:
179
                type: object
180
                items:
181
                  type: string
182
        '409':
183
          description: Database already exists
184
          content:
185
            application/json:
186
              schema:
187
                type: object
188
                items:
189
                  type: string
190
        '500':
191
          description: Server error
192
          content:
193
            application/json:
194
              schema:
195
                type: object
196
                items:
197
                  type: string
198

199
  '/api/databases/{databaseName}':
200
    get:
201
      security:
202
        - ApiKeyAuth: []
203
      summary: Gets info about existing database.
204
      description: Gets info about an existing database.
205
      parameters:
206
        - name: databaseName
207
          in: path
208
          description: Name of existing database
209
          required: true
210
          schema:
211
            type: string
212
      responses:
213
        '200':
214
          description: A JSON object with database informations
215
          content:
216
            application/json:
217
              schema:
218
                $ref: '#/components/schemas/Database'
219

220
        '401':
221
          description: Invalid API key error message
222
          content:
223
            application/json:
224
              schema:
225
                type: object
226
                items:
227
                  type: string
228
        '404':
229
          description: Database not found
230
          content:
231
            application/json:
232
              schema:
233
                type: object
234
                items:
235
                  type: string
236
        '500':
237
          description: Server error
238
          content:
239
            application/json:
240
              schema:
241
                type: object
242
                items:
243
                  type: string
244

245
    put:
246
      security:
247
        - ApiKeyAuth: []
248
      summary: Updates an existing database connection.
249
      description: Updates an existing database connection, or creates a new connection if one doesn't exist. The example parameters below are for updating a [MySQL](/data-integrations/mysql) connection. See [here](/data-integrations/all-data-integrations) for which parameters to use for your datasource.
250
      parameters:
251
        - name: databaseName
252
          in: path
253
          description: The name of the project
254
          required: true
255
          schema:
256
            type: string
257
      requestBody:
258
        required: true
259
        content:
260
          application/json:
261
            schema:
262
              type: object
263
              properties:
264
                database:
265
                  type: object
266
                  properties:
267
                    engine:
268
                      type: string
269
                    parameters:
270
                      type: object
271
                      description: Parameters used to connect to your data source. These example parameters are for connecting to [MySQL](/data-integrations/mysql). See [here](/data-integrations/all-data-integrations) for which parameters to use for your datasource.
272
                      properties:
273
                        user:
274
                          type: string
275
                        password:
276
                          type: string
277
                        host:
278
                          type: string
279
                        port:
280
                          type: string
281
                        database:
282
                          type: string
283
      responses:
284
        '200':
285
          description: Database was successfully updated
286
          content:
287
            application/json:
288
              schema:
289
                $ref: '#/components/schemas/Database'
290
        '400':
291
          description: Bad request format
292
          content:
293
            application/json:
294
              schema:
295
                type: object
296
                items:
297
                  type: string
298
        '401':
299
          description: Invalid API key error message
300
          content:
301
            application/json:
302
              schema:
303
                type: object
304
                items:
305
                  type: string
306
        '500':
307
          description: Server error
308
          content:
309
            application/json:
310
              schema:
311
                type: object
312
                items:
313
                  type: string
314
    delete:
315
      security:
316
        - ApiKeyAuth: []
317
      summary: Deletes an existing database.
318
      description: Deletes an existing database connection by name.
319
      parameters:
320
        - name: databaseName
321
          in: path
322
          description: Name of existing database to delete
323
          required: true
324
          schema:
325
            type: string
326
      responses:
327
        '200':
328
          description: An empty response indicates success
329
          content:
330
            application/json:
331
              schema:
332
                type: string
333
        '401':
334
          description: Invalid API key error message
335
          content:
336
            application/json:
337
              schema:
338
                type: object
339
                items:
340
                  type: string
341
        '404':
342
          description: Database not found
343
          content:
344
            application/json:
345
              schema:
346
                type: object
347
                items:
348
                  type: string
349
        '500':
350
          description: Server error
351
          content:
352
            application/json:
353
              schema:
354
                type: object
355
                items:
356
                  type: string
357
  '/api/projects':
358
    get:
359
      security:
360
        - ApiKeyAuth: []
361
      summary: Returns a list of projects.
362
      description: Gets all projects created by the user.
363
      responses:
364
        '200':
365
          description: A JSON array of projects
366
          content:
367
            application/json:
368
              schema:
369
                type: array
370
                items:
371
                  $ref: '#/components/schemas/Project'
372
        '401':
373
          description: Invalid API key error message
374
          content:
375
            application/json:
376
              schema:
377
                type: object
378
                items:
379
                  type: string
380
        '500':
381
          description: Server error
382
          content:
383
            application/json:
384
              schema:
385
                type: object
386
                items:
387
                  type: string
388
  '/api/projects/{projectName}':
389
    get:
390
      security:
391
        - ApiKeyAuth: []
392
      summary: Get a project by name.
393
      description: Gets a project created by the user.
394
      parameters:
395
        - name: projectName
396
          in: path
397
          description: The name of the project
398
          required: true
399
          schema:
400
            type: string
401
      responses:
402
        '200':
403
          description: The returned project
404
          content:
405
            application/json:
406
              schema:
407
                $ref: '#/components/schemas/Project'
408
        '401':
409
          description: Invalid API key error message
410
          content:
411
            application/json:
412
              schema:
413
                type: object
414
                items:
415
                  type: string
416
        '404':
417
          description: Project not found
418
          content:
419
            application/json:
420
              schema:
421
                type: object
422
                items:
423
                  type: string
424
        '500':
425
          description: Server error
426
          content:
427
            application/json:
428
              schema:
429
                type: object
430
                items:
431
                  type: string
432

433
  '/api/projects/{projectName}/models':
434
    post:
435
      security:
436
        - ApiKeyAuth: []
437
      summary: This endpoint trains a new ML Model.
438
      description: Starts training a new Machine Learning model.
439
      parameters:
440
        - name: projectName
441
          in: path
442
          description: The name of the project
443
          required: true
444
          schema:
445
            type: string
446
      requestBody:
447
        required: true
448
        content:
449
          application/json:
450
            schema:
451
              type: object
452
              properties:
453
                query:
454
                  type: string
455
                  description: The SQL CREATE MODEL statement used to train this model. See the [CREATE MODEL](https://docs.mindsdb.com/sql/create/model) statement 
456
      responses:
457
        '200':
458
          description: Model training started
459
          content:
460
            application/json:
461
              schema:
462
                $ref: '#/components/schemas/Model'
463
        '400':
464
          description: Bad request
465
          content:
466
            application/json:
467
              schema:
468
                type: object
469
                items:
470
                  type: string
471
        '401':
472
          description: Invalid API key error message
473
          content:
474
            application/json:
475
              schema:
476
                type: object
477
                items:
478
                  type: string
479
        '404':
480
          description: Project not found
481
          content:
482
            application/json:
483
              schema:
484
                type: object
485
                items:
486
                  type: string
487
        '500':
488
          description: Server error
489
          content:
490
            application/json:
491
              schema:
492
                type: object
493
                items:
494
                  type: string
495
    get:
496
      security:
497
        - ApiKeyAuth: []
498
      summary: Returns a list of models.
499
      description: Gets info about all models in the project.
500
      parameters:
501
        - name: projectName
502
          in: path
503
          description: The name of the project
504
          required: true
505
          schema:
506
            type: string
507
      responses:
508
        '200':
509
          description: A JSON array of models names
510
          content:
511
            application/json:
512
              schema:
513
                type: array
514
                items:
515
                  $ref: '#/components/schemas/Model'
516
        '401':
517
          description: Invalid API key error message
518
          content:
519
            application/json:
520
              schema:
521
                type: object
522
                items:
523
                  type: string
524
        '404':
525
          description: Project not found
526
          content:
527
            application/json:
528
              schema:
529
                type: object
530
                items:
531
                  type: string
532
        '500':
533
          description: Server error
534
          content:
535
            application/json:
536
              schema:
537
                type: object
538
                items:
539
                  type: string
540
  '/api/projects/{projectName}/models/{modelName}':
541
    get:
542
      security:
543
        - ApiKeyAuth: []
544
      summary: Gets info about specific model.
545
      description: Gets info for a specific model in the project.
546
      parameters:
547
        - name: projectName
548
          in: path
549
          description: The name of the project
550
          required: true
551
          schema:
552
            type: string
553
        - name: modelName
554
          in: path
555
          description: The name of the model
556
          required: true
557
          schema:
558
            type: string
559
      responses:
560
        '200':
561
          description: Model information
562
          content:
563
            application/json:
564
              schema:
565
                $ref: '#/components/schemas/Model'
566
        '401':
567
          description: Invalid API key error message
568
          content:
569
            application/json:
570
              schema:
571
                type: object
572
                items:
573
                  type: string
574
        '404':
575
          description: Model not found
576
          content:
577
            application/json:
578
              schema:
579
                type: object
580
                items:
581
                  type: string
582
        '500':
583
          description: Server error
584
          content:
585
            application/json:
586
              schema:
587
                type: object
588
                items:
589
                  type: string
590
    delete:
591
      security:
592
        - ApiKeyAuth: []
593
      summary: Deletes an existing model.
594
      description: Deletes a model in the project.
595
      parameters:
596
        - name: projectName
597
          in: path
598
          description: The name of the project
599
          required: true
600
          schema:
601
            type: string
602
        - name: modelName
603
          in: path
604
          description: The name of the model
605
          required: true
606
          schema:
607
            type: string
608
      responses:
609
        '200':
610
          description: Empty response if delete is successful
611
          content:
612
            application/json:
613
              schema:
614
                type: string
615
        '401':
616
          description: Invalid API key error message
617
          content:
618
            application/json:
619
              schema:
620
                type: object
621
                items:
622
                  type: string
623
        '404':
624
          description: Project or model not found
625
          content:
626
            application/json:
627
              schema:
628
                type: object
629
                items:
630
                  type: string
631
        '500':
632
          description: Server error
633
          content:
634
            application/json:
635
              schema:
636
                type: object
637
                items:
638
                  type: string
639
  '/api/projects/{projectName}/models/{modelName}/predict':
640
    post:
641
      security:
642
        - ApiKeyAuth: []
643
      summary: This endpoint fetches predictions from the model.
644
      description: Uses this model to make a prediction for values of new data.
645
      parameters:
646
        - name: projectName
647
          in: path
648
          description: The name of the project
649
          required: true
650
          schema:
651
            type: string
652
        - name: modelName
653
          in: path
654
          description: The name of the model
655
          required: true
656
          schema:
657
            type: string
658
      requestBody:
659
        required: true
660
        content:
661
          application/json:
662
            schema:
663
              type: array
664
              properties:
665
                data:
666
                  type: object
667
                  description: The data for querying the model as key/value e.g column name/value. Example with [home rental prices](https://docs.mindsdb.com/sql/tutorials/home-rentals) - [{"sqft":823}]
668
      responses:
669
        '200':
670
          description: Model queried succesfully
671
          content:
672
            application/json:
673
              schema:
674
                type: object
675
                items:
676
                  type: string
677
                  description: Prediction object that contains data columns and the target value, confidence, lower and upper bound.
678
        '401':
679
          description: Invalid API key error message
680
          content:
681
            application/json:
682
              schema:
683
                type: object
684
                items:
685
                  type: string
686
        '404':
687
          description: Project or model not found
688
          content:
689
            application/json:
690
              schema:
691
                type: object
692
                items:
693
                  type: string
694
        '500':
695
          description: Server error
696
          content:
697
            application/json:
698
              schema:
699
                type: object
700
                items:
701
                  type: string
702
  '/api/projects/{projectName}/models/{modelName}/describe':
703
    get:
704
      security:
705
        - ApiKeyAuth: []
706
      summary: Describe a model
707
      description: Gets the attributes of a specific model.
708
      parameters:
709
        - name: projectName
710
          in: path
711
          description: The name of the project
712
          required: true
713
          schema:
714
            type: string
715
        - name: modelName
716
          in: path
717
          description: The name of the model
718
          required: true
719
          schema:
720
            type: string
721
      requestBody:
722
          content:
723
            application/json:
724
              schema:
725
                type: object
726
                properties:
727
                  attribute:
728
                    type: string
729
                    description: Attribute of the model to describe. See our [DESCRIBE documentation](https://docs.mindsdb.com/sql/api/describe). E.g. info, features, model
730

731
      responses:
732
        '200':
733
          description: A JSON object with model informations
734
          content:
735
            application/json:
736
              schema:
737
                type: object
738
                items:
739
                  type: string
740
                  description: Array containing model information
741
        '401':
742
          description: Invalid API key error message
743
          content:
744
            application/json:
745
              schema:
746
                type: object
747
                items:
748
                  type: string
749
        '404':
750
          description: Model not found
751
          content:
752
            application/json:
753
              schema:
754
                type: object
755
                items:
756
                  type: string
757
        '500':
758
          description: Server error
759
          content:
760
            application/json:
761
              schema:
762
                type: object
763
                items:
764
                  type: string
765
  '/api/projects/{projectName}/views':
766
    post:
767
      security:
768
        - ApiKeyAuth: []
769
      summary: This endpoint creates a view which is a result-set of the SELECT statement.
770
      description: Creates a [view](https://docs.mindsdb.com/sql/create/view) from a SELECT statement.
771
      parameters:
772
        - name: projectName
773
          in: path
774
          description: The name of the project
775
          required: true
776
          schema:
777
            type: string
778
      requestBody:
779
        required: true
780
        content:
781
          application/json:
782
            schema:
783
              type: object
784
              properties:
785
                view:
786
                  type: object
787
                  properties:
788
                    name:
789
                      type: string
790
                      description: Name of the view
791
                    query:
792
                      type: string
793
                      description: The SQL query that will save the result-set in a view.
794
      responses:
795
        '200':
796
          description: View created
797
          content:
798
            application/json:
799
              schema:
800
                type: array
801
                items:
802
                  $ref: '#/components/schemas/View'
803
        '401':
804
          description: Invalid API key error message
805
          content:
806
            application/json:
807
              schema:
808
                type: object
809
                items:
810
                  type: string
811
        '404':
812
          description: Project not found
813
          content:
814
            application/json:
815
              schema:
816
                type: object
817
                items:
818
                  type: string
819
        '500':
820
          description: Server error
821
          content:
822
            application/json:
823
              schema:
824
                type: object
825
                items:
826
                  type: string
827
    get:
828
      security:
829
        - ApiKeyAuth: []
830
      summary: List all views in a project
831
      description: Gets all views in a project.
832
      parameters:
833
        - name: projectName
834
          in: path
835
          description: The name of the project
836
          required: true
837
          schema:
838
            type: string
839
      responses:
840
        '200':
841
          description: A JSON object with view names
842
          content:
843
            application/json:
844
              schema:
845
                type: array
846
                items:
847
                  $ref: '#/components/schemas/View'
848
        '401':
849
          description: Invalid API key error message
850
          content:
851
            application/json:
852
              schema:
853
                type: object
854
                items:
855
                  type: string
856
        '404':
857
          description: Project not found
858
          content:
859
            application/json:
860
              schema:
861
                type: object
862
                items:
863
                  type: string
864
        '500':
865
          description: Server error
866
          content:
867
            application/json:
868
              schema:
869
                type: object
870
                items:
871
                  type: string
872
  '/api/projects/{projectName}/views/{viewName}':
873
    get:
874
      security:
875
        - ApiKeyAuth: []
876
      summary: SELECT from VIEW
877
      description: Gets a single view.
878
      parameters:
879
        - name: projectName
880
          in: path
881
          description: The name of the project
882
          required: true
883
          schema:
884
            type: string
885
        - name: viewName
886
          in: path
887
          description: The name of the view
888
          required: true
889
          schema:
890
            type: string
891
      responses:
892
        '200':
893
          description: A JSON object with VIEW data
894
          content:
895
            application/json:
896
              schema:
897
                $ref: '#/components/schemas/View'
898
        '401':
899
          description: Invalid API key error message
900
          content:
901
            application/json:
902
              schema:
903
                type: object
904
                items:
905
                  type: string
906
        '404':
907
          description: View or project not found
908
          content:
909
            application/json:
910
              schema:
911
                type: object
912
                items:
913
                  type: string
914
        '500':
915
          description: Server error
916
          content:
917
            application/json:
918
              schema:
919
                type: object
920
                items:
921
                  type: string
922
    delete:
923
      security:
924
        - ApiKeyAuth: []
925
      summary: Deletes an existing view.
926
      description: Deletes an existing view in the project.
927
      parameters:
928
        - name: projectName
929
          in: path
930
          description: Project name the view is in
931
          required: true
932
          schema:
933
            type: string
934
        - name: viewName
935
          in: path
936
          description: View name to delete
937
          required: true
938
          schema:
939
            type: string
940
      responses:
941
        '200':
942
          description: Succesfully deleted
943
          content:
944
            application/json:
945
              schema:
946
                type: object
947
                items:
948
                  type: string
949
        '401':
950
          description: Invalid API key error message
951
          content:
952
            application/json:
953
              schema:
954
                type: object
955
                items:
956
                  type: string
957
        '404':
958
          description: View or projectnot found
959
          content:
960
            application/json:
961
              schema:
962
                type: object
963
                items:
964
                  type: string
965
        '500':
966
          description: Server error
967
          content:
968
            application/json:
969
              schema:
970
                type: object
971
                items:
972
                  type: string
973
    put:
974
      security:
975
        - ApiKeyAuth: []
976
      summary: Updates an existing view.
977
      description: Updates an existing view, or creates a new view if one doesn't exist.
978
      parameters:
979
        - name: projectName
980
          in: path
981
          description: The name of the project
982
          required: true
983
          schema:
984
            type: string
985
        - name: viewName
986
          in: path
987
          description: The name of the view
988
          required: true
989
          schema:
990
            type: string
991
      requestBody:
992
        required: true
993
        content:
994
          application/json:
995
            schema:
996
              type: object
997
              properties:
998
                view:
999
                  type: object
1000
                  properties:
1001
                    name:
1002
                      type: string
1003
                      description: Name of the view
1004
                    query:
1005
                      type: string
1006
                      description: The SQL query that will save the result-set in a view.
1007
      responses:
1008
        '200':
1009
          description: View was successfully updated
1010
          content:
1011
            application/json:
1012
              schema:
1013
                $ref: '#/components/schemas/View'
1014
        '400':
1015
          description: Bad request format
1016
          content:
1017
            application/json:
1018
              schema:
1019
                type: object
1020
                items:
1021
                  type: string
1022
        '401':
1023
          description: Invalid API key error message
1024
          content:
1025
            application/json:
1026
              schema:
1027
                type: object
1028
                items:
1029
                  type: string
1030
        '500':
1031
          description: Server error
1032
          content:
1033
            application/json:
1034
              schema:
1035
                type: object
1036
                items:
1037
                  type: string
1038
  '/api/databases/{databaseName}/tables':
1039
    post:
1040
      security:
1041
        - ApiKeyAuth: []
1042
      summary: This endpoint creates a new table with the predictions result-set.
1043
      description: Creates a new table from a select query. See [CREATE table documentation](https://docs.mindsdb.com/sql/create/table).
1044
      parameters:
1045
      - name: databaseName
1046
        in: path
1047
        description: Name of the database
1048
        required: true
1049
        schema:
1050
          type: string
1051
      requestBody:
1052
        required: true
1053
        content:
1054
          application/json:
1055
            schema:
1056
              type: object
1057
              properties:
1058
                table:
1059
                  type: object
1060
                  properties:
1061
                    name:
1062
                      type: string
1063
                    select:
1064
                      type: string
1065
                      description: SELECT statement to create the table from
1066
                    replace:
1067
                      type: boolean
1068
                      description: Whether or not to delete a pre-existing table before creating it
1069
      responses:
1070
        '200':
1071
          description: Table created
1072
          content:
1073
            application/json:
1074
              schema:
1075
                $ref: '#/components/schemas/Table'
1076
        '401':
1077
          description: Invalid API key error message
1078
          content:
1079
            application/json:
1080
              schema:
1081
                type: object
1082
                items:
1083
                  type: string
1084
        '404':
1085
          description: Database not found
1086
          content:
1087
            application/json:
1088
              schema:
1089
                type: object
1090
                items:
1091
                  type: string
1092
        '500':
1093
          description: Server error
1094
          content:
1095
            application/json:
1096
              schema:
1097
                type: object
1098
                items:
1099
                  type: string
1100

1101
    get:
1102
      security:
1103
        - ApiKeyAuth: []
1104
      summary: Returns a list of tables in a database.
1105
      description: Gets metadata for all tables in a database.
1106
      parameters:
1107
        - name: databaseName
1108
          in: path
1109
          description: The name of the database
1110
          required: true
1111
          schema:
1112
            type: string
1113
      responses:
1114
        '200':
1115
          description: A JSON array of tables
1116
          content:
1117
            application/json:
1118
              schema:
1119
                type: array
1120
                items:
1121
                  $ref: '#/components/schemas/Table'
1122
        '401':
1123
          description: Invalid API key error message
1124
          content:
1125
            application/json:
1126
              schema:
1127
                type: object
1128
                items:
1129
                  type: string
1130
        '404':
1131
          description: Database not found
1132
          content:
1133
            application/json:
1134
              schema:
1135
                type: object
1136
                items:
1137
                  type: string
1138
        '500':
1139
          description: Server error
1140
          content:
1141
            application/json:
1142
              schema:
1143
                type: object
1144
                items:
1145
                  type: string
1146
  '/api/databases/{databaseName}/tables/{tableName}':
1147
    get:
1148
      security:
1149
        - ApiKeyAuth: []
1150
      summary: SELECT from Table
1151
      description: Gets metadata for a table in a database.
1152
      parameters:
1153
        - name: databaseName
1154
          in: path
1155
          description: The name of the database
1156
          required: true
1157
          schema:
1158
            type: string
1159
        - name: tableName
1160
          in: path
1161
          description: The name of the table
1162
          required: true
1163
          schema:
1164
            type: string
1165
      responses:
1166
        '200':
1167
          description: A JSON object with SELECT data
1168
          content:
1169
            application/json:
1170
              schema:
1171
                $ref: '#/components/schemas/Table'
1172
        '401':
1173
          description: Invalid API key error message
1174
          content:
1175
            application/json:
1176
              schema:
1177
                type: object
1178
                items:
1179
                  type: string
1180
        '404':
1181
          description: Table or database not found
1182
          content:
1183
            application/json:
1184
              schema:
1185
                type: object
1186
                items:
1187
                  type: string
1188
        '500':
1189
          description: Server error
1190
          content:
1191
            application/json:
1192
              schema:
1193
                type: object
1194
                items:
1195
                  type: string
1196
    delete:
1197
      security:
1198
        - ApiKeyAuth: []
1199
      summary: Deletes an existing table.
1200
      description: Deletes a table in a database.
1201
      parameters:
1202
        - name: databaseName
1203
          in: path
1204
          description: The name of the database
1205
          required: true
1206
          schema:
1207
            type: string
1208
        - name: tableName
1209
          in: path
1210
          description: Table name to delete
1211
          required: true
1212
          schema:
1213
            type: string
1214
      responses:
1215
        '200':
1216
          description: Successfully deleted
1217
          content:
1218
            application/json:
1219
              schema:
1220
                type: object
1221
                items:
1222
                  type: string
1223
        '401':
1224
          description: Invalid API key error message
1225
          content:
1226
            application/json:
1227
              schema:
1228
                type: object
1229
                items:
1230
                  type: string
1231
        '404':
1232
          description: Table or database not found
1233
          content:
1234
            application/json:
1235
              schema:
1236
                type: object
1237
                items:
1238
                  type: string
1239
        '500':
1240
          description: Server error
1241
          content:
1242
            application/json:
1243
              schema:
1244
                type: object
1245
                items:
1246
                  type: string

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.