{ "/api/v1/database/": { "get": { "description": "Gets a list of databases, use Rison or JSON query parameters for filtering, sorting, pagination and for selecting specific columns and metadata.", "parameters": [ { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/get_list_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "count": { "description": "The total record count on the backend", "type": "number" }, "description_columns": { "properties": { "column_name": { "description": "The description for the column name. Will be translated by babel", "example": "A Nice description for the column", "type": "string" } }, "type": "object" }, "ids": { "description": "A list of item ids, useful when you don't know the column id", "items": { "type": "string" }, "type": "array" }, "label_columns": { "properties": { "column_name": { "description": "The label for the column name. Will be translated by babel", "example": "A Nice label for the column", "type": "string" } }, "type": "object" }, "list_columns": { "description": "A list of columns", "items": { "type": "string" }, "type": "array" }, "list_title": { "description": "A title to render. Will be translated by babel", "example": "List Items", "type": "string" }, "order_columns": { "description": "A list of allowed columns to sort", "items": { "type": "string" }, "type": "array" }, "result": { "description": "The result from the get list query", "items": { "$ref": "#/components/schemas/DatabaseRestApi.get_list" }, "type": "array" } }, "type": "object" } } }, "description": "Items from Model" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get a list of databases", "tags": [ "Database" ] }, "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseRestApi.post" } } }, "description": "Database schema", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "id": { "type": "number" }, "result": { "$ref": "#/components/schemas/DatabaseRestApi.post" } }, "type": "object" } } }, "description": "Database added" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Create a new database", "tags": [ "Database" ] } }, "/api/v1/database/_info": { "get": { "description": "Get metadata information about this API resource", "parameters": [ { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/get_info_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "add_columns": { "type": "object" }, "edit_columns": { "type": "object" }, "filters": { "properties": { "column_name": { "items": { "properties": { "name": { "description": "The filter name. Will be translated by babel", "type": "string" }, "operator": { "description": "The filter operation key to use on list filters", "type": "string" } }, "type": "object" }, "type": "array" } }, "type": "object" }, "permissions": { "description": "The user permissions for this API resource", "items": { "type": "string" }, "type": "array" } }, "type": "object" } } }, "description": "Item from Model" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get metadata information about this API resource", "tags": [ "Database" ] } }, "/api/v1/database/available/": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "items": { "properties": { "available_drivers": { "description": "Installed drivers for the engine", "items": { "type": "string" }, "type": "array" }, "default_driver": { "description": "Default driver for the engine", "type": "string" }, "engine": { "description": "Name of the SQLAlchemy engine", "type": "string" }, "engine_information": { "description": "Dict with public properties form the DB Engine", "properties": { "disable_ssh_tunneling": { "description": "Whether the engine supports SSH Tunnels", "type": "boolean" }, "supports_file_upload": { "description": "Whether the engine supports file uploads", "type": "boolean" } }, "type": "object" }, "name": { "description": "Name of the database", "type": "string" }, "parameters": { "description": "JSON schema defining the needed parameters", "type": "object" }, "preferred": { "description": "Is the database preferred?", "type": "boolean" }, "sqlalchemy_uri_placeholder": { "description": "Example placeholder for the SQLAlchemy URI", "type": "string" } }, "type": "object" }, "type": "array" } } }, "description": "Database names" }, "400": { "$ref": "#/components/responses/400" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get names of databases currently available", "tags": [ "Database" ] } }, "/api/v1/database/export/": { "get": { "parameters": [ { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/get_export_ids_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/zip": { "schema": { "format": "binary", "type": "string" } } }, "description": "A zip file with database(s) and dataset(s) as YAML" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Download database(s) and associated dataset(s) as a zip file", "tags": [ "Database" ] } }, "/api/v1/database/import/": { "post": { "requestBody": { "content": { "multipart/form-data": { "schema": { "properties": { "formData": { "description": "upload file (ZIP)", "format": "binary", "type": "string" }, "overwrite": { "description": "overwrite existing databases?", "type": "boolean" }, "passwords": { "description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.", "type": "string" }, "ssh_tunnel_passwords": { "description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.", "type": "string" }, "ssh_tunnel_private_key_passwords": { "description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.", "type": "string" }, "ssh_tunnel_private_keys": { "description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.", "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "Database import result" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Import database(s) with associated datasets", "tags": [ "Database" ] } }, "/api/v1/database/oauth2/": { "get": { "description": "-> Receive and store personal access tokens from OAuth for user-level authorization", "parameters": [ { "in": "query", "name": "state", "schema": { "type": "string" } }, { "in": "query", "name": "code", "schema": { "type": "string" } }, { "in": "query", "name": "scope", "schema": { "type": "string" } }, { "in": "query", "name": "error", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "text/html": { "schema": { "type": "string" } } }, "description": "A dummy self-closing HTML page" }, "400": { "$ref": "#/components/responses/400" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Receive personal access tokens from OAuth2", "tags": [ "Database" ] } }, "/api/v1/database/related/{column_name}": { "get": { "parameters": [ { "in": "path", "name": "column_name", "required": true, "schema": { "type": "string" } }, { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/get_related_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" } } }, "description": "Related column data" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get related fields data", "tags": [ "Database" ] } }, "/api/v1/database/test_connection/": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseTestConnectionSchema" } } }, "description": "Database schema", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "Database Test Connection" }, "400": { "$ref": "#/components/responses/400" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Test a database connection", "tags": [ "Database" ] } }, "/api/v1/database/upload_metadata/": { "post": { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/UploadFileMetadataPostSchema" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "result": { "$ref": "#/components/schemas/UploadFileMetadata" } }, "type": "object" } } }, "description": "Upload response" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Upload a file and returns file metadata", "tags": [ "Database" ] } }, "/api/v1/database/validate_parameters/": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseValidateParametersSchema" } } }, "description": "DB-specific parameters", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "Database Test Connection" }, "400": { "$ref": "#/components/responses/400" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Validate database connection parameters", "tags": [ "Database" ] } }, "/api/v1/database/{pk}": { "delete": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "Database deleted" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Delete a database", "tags": [ "Database" ] }, "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "Database" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get a database", "tags": [ "Database" ] }, "put": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseRestApi.put" } } }, "description": "Database schema", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "id": { "type": "number" }, "result": { "$ref": "#/components/schemas/DatabaseRestApi.put" } }, "type": "object" } } }, "description": "Database changed" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Change a database", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/catalogs/": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/database_catalogs_query_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogsResponseSchema" } } }, "description": "A List of all catalogs from the database" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get all catalogs from a database", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/connection": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseConnectionSchema" } } }, "description": "Database with connection info" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get a database connection info", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/function_names/": { "get": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseFunctionNamesResponse" } } }, "description": "Query result" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get function names supported by a database", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/related_objects/": { "get": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseRelatedObjectsResponse" } } }, "description": "Query result" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get charts and dashboards count associated to a database", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/schemas/": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/database_schemas_query_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchemasResponseSchema" } } }, "description": "A List of all schemas from the database" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get all schemas from a database", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/schemas_access_for_file_upload/": { "get": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseSchemaAccessForFileUploadResponse" } } }, "description": "The list of the database schemas where to upload information" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "The list of the database schemas where to upload information", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/select_star/{table_name}/": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "description": "Table name", "in": "path", "name": "table_name", "required": true, "schema": { "type": "string" } }, { "description": "Table schema", "in": "path", "name": "schema_name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SelectStarResponseSchema" } } }, "description": "SQL statement for a select star for table" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get database select star for table", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/select_star/{table_name}/{schema_name}/": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "description": "Table name", "in": "path", "name": "table_name", "required": true, "schema": { "type": "string" } }, { "description": "Table schema", "in": "path", "name": "schema_name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SelectStarResponseSchema" } } }, "description": "SQL statement for a select star for table" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get database select star for table", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/ssh_tunnel/": { "delete": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "SSH Tunnel deleted" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Delete a SSH tunnel", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/sync_permissions/": { "post": { "parameters": [ { "description": "The database connection ID", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "Task created to sync permissions." }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Re-sync all permissions for a database connection", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/table/{table_name}/{schema_name}/": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "description": "Table name", "in": "path", "name": "table_name", "required": true, "schema": { "type": "string" } }, { "description": "Table schema", "in": "path", "name": "schema_name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableMetadataResponseSchema" } } }, "description": "Table metadata information" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get database table metadata", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/table_extra/{table_name}/{schema_name}/": { "get": { "description": "Response depends on each DB engine spec normally focused on partitions.", "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "description": "Table name", "in": "path", "name": "table_name", "required": true, "schema": { "type": "string" } }, { "description": "Table schema", "in": "path", "name": "schema_name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" } } }, "description": "Table extra metadata information" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get table extra metadata", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/table_metadata/": { "get": { "description": "Metadata associated with the table (columns, indexes, etc.)", "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "description": "Table name", "in": "query", "name": "name", "required": true, "schema": { "type": "string" } }, { "description": "Optional table schema, if not passed default schema will be used", "in": "query", "name": "schema", "schema": { "type": "string" } }, { "description": "Optional table catalog, if not passed default catalog will be used", "in": "query", "name": "catalog", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" } } }, "description": "Table metadata information" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get table metadata", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/table_metadata/extra/": { "get": { "description": "Extra metadata associated with the table (partitions, description, etc.)", "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "description": "Table name", "in": "query", "name": "name", "required": true, "schema": { "type": "string" } }, { "description": "Optional table schema, if not passed the schema configured in the database will be used", "in": "query", "name": "schema", "schema": { "type": "string" } }, { "description": "Optional table catalog, if not passed the catalog configured in the database will be used", "in": "query", "name": "catalog", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" } } }, "description": "Table extra metadata information" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get table extra metadata", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/tables/": { "get": { "parameters": [ { "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } }, { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/database_tables_query_schema" } } }, "in": "query", "name": "q" } ], "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "count": { "type": "integer" }, "result": { "description": "A List of tables for given database", "items": { "$ref": "#/components/schemas/DatabaseTablesResponse" }, "type": "array" } }, "type": "object" } } }, "description": "Tables list" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Get a list of tables for given database", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/upload/": { "post": { "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/UploadPostSchema" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "CSV upload response" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "422": { "$ref": "#/components/responses/422" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Upload a file to a database table", "tags": [ "Database" ] } }, "/api/v1/database/{pk}/validate_sql/": { "post": { "description": "Validates that arbitrary SQL is acceptable for the given database.", "parameters": [ { "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateSQLRequest" } } }, "description": "Validate SQL request", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "result": { "description": "A List of SQL errors found on the statement", "items": { "$ref": "#/components/schemas/ValidateSQLResponse" }, "type": "array" } }, "type": "object" } } }, "description": "Validation result" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" }, "500": { "$ref": "#/components/responses/500" } }, "security": [ { "jwt": [] } ], "summary": "Validate arbitrary SQL", "tags": [ "Database" ] } } }\n