diff --git a/backup_script.py b/backup_script.py index a0becb7..9371651 100644 --- a/backup_script.py +++ b/backup_script.py @@ -1,10 +1,13 @@ -# -# @SEMANTICS: backup, superset, automation, dashboard -# @PURPOSE: Этот модуль отвечает за автоматизированное резервное копирование дашбордов Superset. -# @DEPENDS_ON: superset_tool.client -> Использует SupersetClient для взаимодействия с API. -# @DEPENDS_ON: superset_tool.utils -> Использует утилиты для логирования, работы с файлами и инициализации клиентов. +# [DEF:backup_script:Module] +# +# @SEMANTICS: backup, superset, automation, dashboard +# @PURPOSE: Этот модуль отвечает за автоматизированное резервное копирование дашбордов Superset. +# @LAYER: App +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> superset_tool.utils +# @PUBLIC_API: BackupConfig, backup_dashboards, main -# +# [SECTION: IMPORTS] import logging import sys from pathlib import Path @@ -22,12 +25,10 @@ from superset_tool.utils.fileio import ( RetentionPolicy ) from superset_tool.utils.init_clients import setup_clients -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Хранит конфигурацию для процесса бэкапа. +# [DEF:BackupConfig:DataClass] +# @PURPOSE: Хранит конфигурацию для процесса бэкапа. @dataclass class BackupConfig: """Конфигурация для процесса бэкапа.""" @@ -35,26 +36,26 @@ class BackupConfig: rotate_archive: bool = True clean_folders: bool = True retention_policy: RetentionPolicy = field(default_factory=RetentionPolicy) -# +# [/DEF:BackupConfig] -# -# @PURPOSE: Выполняет бэкап всех доступных дашбордов для заданного клиента и окружения, пропуская ошибки экспорта. -# @PRE: `client` должен быть инициализированным экземпляром `SupersetClient`. -# @PRE: `env_name` должен быть строкой, обозначающей окружение. -# @PRE: `backup_root` должен быть валидным путем к корневой директории бэкапа. -# @POST: Дашборды экспортируются и сохраняются. Ошибки экспорта логируются и не приводят к остановке скрипта. -# @PARAM: client: SupersetClient - Клиент для доступа к API Superset. -# @PARAM: env_name: str - Имя окружения (e.g., 'PROD'). -# @PARAM: backup_root: Path - Корневая директория для сохранения бэкапов. -# @PARAM: logger: SupersetLogger - Инстанс логгера. -# @PARAM: config: BackupConfig - Конфигурация процесса бэкапа. -# @RETURN: bool - `True` если все дашборды были экспортированы без критических ошибок, `False` иначе. -# @RELATION: CALLS -> client.get_dashboards -# @RELATION: CALLS -> client.export_dashboard -# @RELATION: CALLS -> save_and_unpack_dashboard -# @RELATION: CALLS -> archive_exports -# @RELATION: CALLS -> consolidate_archive_folders -# @RELATION: CALLS -> remove_empty_directories +# [DEF:backup_dashboards:Function] +# @PURPOSE: Выполняет бэкап всех доступных дашбордов для заданного клиента и окружения, пропуская ошибки экспорта. +# @PRE: `client` должен быть инициализированным экземпляром `SupersetClient`. +# @PRE: `env_name` должен быть строкой, обозначающей окружение. +# @PRE: `backup_root` должен быть валидным путем к корневой директории бэкапа. +# @POST: Дашборды экспортируются и сохраняются. Ошибки экспорта логируются и не приводят к остановке скрипта. +# @RELATION: CALLS -> client.get_dashboards +# @RELATION: CALLS -> client.export_dashboard +# @RELATION: CALLS -> save_and_unpack_dashboard +# @RELATION: CALLS -> archive_exports +# @RELATION: CALLS -> consolidate_archive_folders +# @RELATION: CALLS -> remove_empty_directories +# @PARAM: client (SupersetClient) - Клиент для доступа к API Superset. +# @PARAM: env_name (str) - Имя окружения (e.g., 'PROD'). +# @PARAM: backup_root (Path) - Корневая директория для сохранения бэкапов. +# @PARAM: logger (SupersetLogger) - Инстанс логгера. +# @PARAM: config (BackupConfig) - Конфигурация процесса бэкапа. +# @RETURN: bool - `True` если все дашборды были экспортированы без критических ошибок, `False` иначе. def backup_dashboards( client: SupersetClient, env_name: str, @@ -110,13 +111,13 @@ def backup_dashboards( except (RequestException, IOError) as e: logger.critical(f"[backup_dashboards][Failure] Fatal error during backup for {env_name}: {e}", exc_info=True) return False -# +# [/DEF:backup_dashboards] -# -# @PURPOSE: Основная точка входа для запуска процесса резервного копирования. -# @RETURN: int - Код выхода (0 - успех, 1 - ошибка). -# @RELATION: CALLS -> setup_clients -# @RELATION: CALLS -> backup_dashboards +# [DEF:main:Function] +# @PURPOSE: Основная точка входа для запуска процесса резервного копирования. +# @RELATION: CALLS -> setup_clients +# @RELATION: CALLS -> backup_dashboards +# @RETURN: int - Код выхода (0 - успех, 1 - ошибка). def main() -> int: log_dir = Path("P:\\Superset\\010 Бекапы\\Logs") logger = SupersetLogger(log_dir=log_dir, level=logging.INFO, console=True) @@ -154,11 +155,9 @@ def main() -> int: logger.info("[main][Exit] Superset backup process finished.") return exit_code -# +# [/DEF:main] if __name__ == "__main__": sys.exit(main()) -# --- Конец кода модуля --- - -# +# [/DEF:backup_script] diff --git a/comment_mapping.xlsx b/comment_mapping.xlsx deleted file mode 100644 index 2dc3c61..0000000 Binary files a/comment_mapping.xlsx and /dev/null differ diff --git a/debug_db_api.py b/debug_db_api.py new file mode 100644 index 0000000..7d88171 --- /dev/null +++ b/debug_db_api.py @@ -0,0 +1,70 @@ +# [DEF:debug_db_api:Module] +# +# @SEMANTICS: debug, api, database, script +# @PURPOSE: Скрипт для отладки структуры ответа API баз данных. +# @LAYER: App +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> superset_tool.utils +# @PUBLIC_API: debug_database_api + +# [SECTION: IMPORTS] +import json +import logging +from superset_tool.client import SupersetClient +from superset_tool.utils.init_clients import setup_clients +from superset_tool.utils.logger import SupersetLogger +# [/SECTION] + +# [DEF:debug_database_api:Function] +# @PURPOSE: Отладка структуры ответа API баз данных. +# @RELATION: CALLS -> setup_clients +# @RELATION: CALLS -> client.get_databases +def debug_database_api(): + logger = SupersetLogger(name="debug_db_api", level=logging.DEBUG) + + # Инициализируем клиенты + clients = setup_clients(logger) + + # Проверяем доступные окружения + print("Доступные окружения:") + for env_name, client in clients.items(): + print(f" {env_name}: {client.config.base_url}") + + # Выбираем два окружения для тестирования + if len(clients) < 2: + print("Недостаточно окружений для тестирования") + return + + env_names = list(clients.keys())[:2] + from_env, to_env = env_names[0], env_names[1] + + from_client = clients[from_env] + to_client = clients[to_env] + + print(f"\nТестируем API для окружений: {from_env} -> {to_env}") + + try: + # Получаем список баз данных из первого окружения + print(f"\nПолучаем список БД из {from_env}:") + count, dbs = from_client.get_databases() + print(f"Найдено {count} баз данных") + print("Полный ответ API:") + print(json.dumps({"count": count, "result": dbs}, indent=2, ensure_ascii=False)) + + # Получаем список баз данных из второго окружения + print(f"\nПолучаем список БД из {to_env}:") + count, dbs = to_client.get_databases() + print(f"Найдено {count} баз данных") + print("Полный ответ API:") + print(json.dumps({"count": count, "result": dbs}, indent=2, ensure_ascii=False)) + + except Exception as e: + print(f"Ошибка при тестировании API: {e}") + import traceback + traceback.print_exc() +# [/DEF:debug_database_api] + +if __name__ == "__main__": + debug_database_api() + +# [/DEF:debug_db_api] diff --git a/get_dataset_structure.py b/get_dataset_structure.py index 4c17045..abfb342 100644 --- a/get_dataset_structure.py +++ b/get_dataset_structure.py @@ -1,26 +1,27 @@ -# -# @SEMANTICS: superset, dataset, structure, debug, json -# @PURPOSE: Этот модуль предназначен для получения и сохранения структуры данных датасета из Superset. Он используется для отладки и анализа данных, возвращаемых API. -# @DEPENDS_ON: superset_tool.client -> Использует SupersetClient для взаимодействия с API. -# @DEPENDS_ON: superset_tool.utils.init_clients -> Для инициализации клиентов Superset. -# @DEPENDS_ON: superset_tool.utils.logger -> Для логирования. +# [DEF:get_dataset_structure:Module] +# +# @SEMANTICS: superset, dataset, structure, debug, json +# @PURPOSE: Этот модуль предназначен для получения и сохранения структуры данных датасета из Superset. Он используется для отладки и анализа данных, возвращаемых API. +# @LAYER: App +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> superset_tool.utils.init_clients +# @RELATION: DEPENDS_ON -> superset_tool.utils.logger +# @PUBLIC_API: get_and_save_dataset -# +# [SECTION: IMPORTS] import argparse import json from superset_tool.utils.init_clients import setup_clients from superset_tool.utils.logger import SupersetLogger -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Получает структуру датасета из Superset и сохраняет ее в JSON-файл. -# @PARAM: env: str - Среда (dev, prod, и т.д.) для подключения. -# @PARAM: dataset_id: int - ID датасета для получения. -# @PARAM: output_path: str - Путь для сохранения JSON-файла. -# @RELATION: CALLS -> setup_clients -# @RELATION: CALLS -> superset_client.get_dataset +# [DEF:get_and_save_dataset:Function] +# @PURPOSE: Получает структуру датасета из Superset и сохраняет ее в JSON-файл. +# @RELATION: CALLS -> setup_clients +# @RELATION: CALLS -> superset_client.get_dataset +# @PARAM: env (str) - Среда (dev, prod, и т.д.) для подключения. +# @PARAM: dataset_id (int) - ID датасета для получения. +# @PARAM: output_path (str) - Путь для сохранения JSON-файла. def get_and_save_dataset(env: str, dataset_id: int, output_path: str): """ Получает структуру датасета и сохраняет в файл. @@ -49,11 +50,8 @@ def get_and_save_dataset(env: str, dataset_id: int, output_path: str): except Exception as e: logger.error("[get_and_save_dataset][Failure] An error occurred: %s", e, exc_info=True) +# [/DEF:get_and_save_dataset] -# - -# -# @PURPOSE: Точка входа для CLI. Парсит аргументы и запускает получение структуры датасета. if __name__ == "__main__": parser = argparse.ArgumentParser(description="Получение структуры датасета из Superset.") parser.add_argument("--dataset-id", required=True, type=int, help="ID датасета.") @@ -62,8 +60,5 @@ if __name__ == "__main__": args = parser.parse_args() get_and_save_dataset(args.env, args.dataset_id, args.output_path) -# -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:get_dataset_structure] diff --git a/migration_script.py b/migration_script.py index a2b6eb1..4f9674f 100644 --- a/migration_script.py +++ b/migration_script.py @@ -1,14 +1,18 @@ -# -# @SEMANTICS: migration, cli, superset, ui, logging, error-recovery, batch-delete -# @PURPOSE: Предоставляет интерактивный CLI для миграции дашбордов Superset между окружениями с возможностью восстановления после ошибок. -# @DEPENDS_ON: superset_tool.client -> Для взаимодействия с API Superset. -# @DEPENDS_ON: superset_tool.utils -> Для инициализации клиентов, работы с файлами, UI и логирования. +# [DEF:migration_script:Module] +# +# @SEMANTICS: migration, cli, superset, ui, logging, error-recovery, batch-delete +# @PURPOSE: Предоставляет интерактивный CLI для миграции дашбордов Superset между окружениями с возможностью восстановления после ошибок. +# @LAYER: App +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> superset_tool.utils +# @PUBLIC_API: Migration -# +# [SECTION: IMPORTS] import json import logging import sys import zipfile +import re from pathlib import Path from typing import List, Optional, Tuple, Dict from superset_tool.client import SupersetClient @@ -16,22 +20,20 @@ from superset_tool.utils.init_clients import setup_clients from superset_tool.utils.fileio import create_temp_file, update_yamls, create_dashboard_export from superset_tool.utils.whiptail_fallback import menu, checklist, yesno, msgbox, inputbox, gauge from superset_tool.utils.logger import SupersetLogger -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Инкапсулирует логику интерактивной миграции дашбордов с возможностью «удалить‑и‑перезаписать» при ошибке импорта. -# @RELATION: CREATES_INSTANCE_OF -> SupersetLogger -# @RELATION: USES -> SupersetClient +# [DEF:Migration:Class] +# @PURPOSE: Инкапсулирует логику интерактивной миграции дашбордов с возможностью «удалить‑и‑перезаписать» при ошибке импорта. +# @RELATION: CREATES_INSTANCE_OF -> SupersetLogger +# @RELATION: USES -> SupersetClient class Migration: """ Интерактивный процесс миграции дашбордов. """ + # [DEF:Migration.__init__:Function] + # @PURPOSE: Инициализирует сервис миграции, настраивает логгер и начальные состояния. + # @POST: `self.logger` готов к использованию; `enable_delete_on_failure` = `False`. def __init__(self) -> None: - # - # @PURPOSE: Инициализирует сервис миграции, настраивает логгер и начальные состояния. - # @POST: `self.logger` готов к использованию; `enable_delete_on_failure` = `False`. default_log_dir = Path.cwd() / "logs" self.logger = SupersetLogger( name="migration_script", @@ -46,17 +48,17 @@ class Migration: self.db_config_replacement: Optional[dict] = None self._failed_imports: List[dict] = [] assert self.logger is not None, "Logger must be instantiated." - # + # [/DEF:Migration.__init__] - # - # @PURPOSE: Точка входа – последовательный запуск всех шагов миграции. - # @PRE: Логгер готов. - # @POST: Скрипт завершён, пользователю выведено сообщение. - # @RELATION: CALLS -> self.ask_delete_on_failure - # @RELATION: CALLS -> self.select_environments - # @RELATION: CALLS -> self.select_dashboards - # @RELATION: CALLS -> self.confirm_db_config_replacement - # @RELATION: CALLS -> self.execute_migration + # [DEF:Migration.run:Function] + # @PURPOSE: Точка входа – последовательный запуск всех шагов миграции. + # @PRE: Логгер готов. + # @POST: Скрипт завершён, пользователю выведено сообщение. + # @RELATION: CALLS -> self.ask_delete_on_failure + # @RELATION: CALLS -> self.select_environments + # @RELATION: CALLS -> self.select_dashboards + # @RELATION: CALLS -> self.confirm_db_config_replacement + # @RELATION: CALLS -> self.execute_migration def run(self) -> None: self.logger.info("[run][Entry] Запуск скрипта миграции.") self.ask_delete_on_failure() @@ -65,12 +67,12 @@ class Migration: self.confirm_db_config_replacement() self.execute_migration() self.logger.info("[run][Exit] Скрипт миграции завершён.") - # + # [/DEF:Migration.run] - # - # @PURPOSE: Запрашивает у пользователя, следует ли удалять дашборд при ошибке импорта. - # @POST: `self.enable_delete_on_failure` установлен. - # @RELATION: CALLS -> yesno + # [DEF:Migration.ask_delete_on_failure:Function] + # @PURPOSE: Запрашивает у пользователя, следует ли удалять дашборд при ошибке импорта. + # @POST: `self.enable_delete_on_failure` установлен. + # @RELATION: CALLS -> yesno def ask_delete_on_failure(self) -> None: self.enable_delete_on_failure = yesno( "Поведение при ошибке импорта", @@ -80,14 +82,14 @@ class Migration: "[ask_delete_on_failure][State] Delete-on-failure = %s", self.enable_delete_on_failure, ) - # + # [/DEF:Migration.ask_delete_on_failure] - # - # @PURPOSE: Позволяет пользователю выбрать исходное и целевое окружения Superset. - # @PRE: `setup_clients` успешно инициализирует все клиенты. - # @POST: `self.from_c` и `self.to_c` установлены. - # @RELATION: CALLS -> setup_clients - # @RELATION: CALLS -> menu + # [DEF:Migration.select_environments:Function] + # @PURPOSE: Позволяет пользователю выбрать исходное и целевое окружения Superset. + # @PRE: `setup_clients` успешно инициализирует все клиенты. + # @POST: `self.from_c` и `self.to_c` установлены. + # @RELATION: CALLS -> setup_clients + # @RELATION: CALLS -> menu def select_environments(self) -> None: self.logger.info("[select_environments][Entry] Шаг 1/5: Выбор окружений.") try: @@ -119,14 +121,14 @@ class Migration: self.to_c = all_clients[to_env_name] self.logger.info("[select_environments][State] to = %s", to_env_name) self.logger.info("[select_environments][Exit] Шаг 1 завершён.") - # + # [/DEF:Migration.select_environments] - # - # @PURPOSE: Позволяет пользователю выбрать набор дашбордов для миграции. - # @PRE: `self.from_c` инициализирован. - # @POST: `self.dashboards_to_migrate` заполнен. - # @RELATION: CALLS -> self.from_c.get_dashboards - # @RELATION: CALLS -> checklist + # [DEF:Migration.select_dashboards:Function] + # @PURPOSE: Позволяет пользователю выбрать набор дашбордов для миграции. + # @PRE: `self.from_c` инициализирован. + # @POST: `self.dashboards_to_migrate` заполнен. + # @RELATION: CALLS -> self.from_c.get_dashboards + # @RELATION: CALLS -> checklist def select_dashboards(self) -> None: self.logger.info("[select_dashboards][Entry] Шаг 2/5: Выбор дашбордов.") try: @@ -135,11 +137,20 @@ class Migration: self.logger.warning("[select_dashboards][State] No dashboards.") msgbox("Информация", "В исходном окружении нет дашбордов.") return - - options = [("ALL", "Все дашборды")] + [ - (str(d["id"]), d["dashboard_title"]) for d in all_dashboards + + rc, regex = inputbox("Поиск", "Введите регулярное выражение для поиска дашбордов:") + if rc != 0: + return + # Ensure regex is a string and perform case‑insensitive search + regex_str = str(regex) + filtered_dashboards = [ + d for d in all_dashboards if re.search(regex_str, d["dashboard_title"], re.IGNORECASE) ] - + + options = [("ALL", "Все дашборды")] + [ + (str(d["id"]), d["dashboard_title"]) for d in filtered_dashboards + ] + rc, selected = checklist( title="Выбор дашбордов", prompt="Отметьте нужные дашборды (введите номера):", @@ -147,14 +158,14 @@ class Migration: ) if rc != 0: return - + if "ALL" in selected: - self.dashboards_to_migrate = list(all_dashboards) + self.dashboards_to_migrate = filtered_dashboards else: self.dashboards_to_migrate = [ - d for d in all_dashboards if str(d["id"]) in selected + d for d in filtered_dashboards if str(d["id"]) in selected ] - + self.logger.info( "[select_dashboards][State] Выбрано %d дашбордов.", len(self.dashboards_to_migrate), @@ -163,32 +174,106 @@ class Migration: self.logger.error("[select_dashboards][Failure] %s", e, exc_info=True) msgbox("Ошибка", "Не удалось получить список дашбордов.") self.logger.info("[select_dashboards][Exit] Шаг 2 завершён.") - # + # [/DEF:Migration.select_dashboards] - # - # @PURPOSE: Запрашивает у пользователя, требуется ли заменить имена БД в YAML-файлах. - # @POST: `self.db_config_replacement` либо `None`, либо заполнен. - # @RELATION: CALLS -> yesno - # @RELATION: CALLS -> inputbox + # [DEF:Migration.confirm_db_config_replacement:Function] + # @PURPOSE: Запрашивает у пользователя, требуется ли заменить имена БД в YAML-файлах. + # @POST: `self.db_config_replacement` либо `None`, либо заполнен. + # @RELATION: CALLS -> yesno + # @RELATION: CALLS -> self._select_databases def confirm_db_config_replacement(self) -> None: if yesno("Замена БД", "Заменить конфигурацию БД в YAML‑файлах?"): - rc, old_name = inputbox("Замена БД", "Старое имя БД (например, db_dev):") - if rc != 0: return - rc, new_name = inputbox("Замена БД", "Новое имя БД (например, db_prod):") - if rc != 0: return - - self.db_config_replacement = { "old": {"database_name": old_name}, "new": {"database_name": new_name} } + old_db, new_db = self._select_databases() + if not old_db or not new_db: + self.logger.info("[confirm_db_config_replacement][State] Selection cancelled.") + return + + self.db_config_replacement = { "old": {"database_name": old_db["database_name"]}, "new": {"database_name": new_db["database_name"]} } self.logger.info("[confirm_db_config_replacement][State] Replacement set: %s", self.db_config_replacement) else: self.logger.info("[confirm_db_config_replacement][State] Skipped.") - # + # [/DEF:Migration.confirm_db_config_replacement] - # - # @PURPOSE: Удаляет набор дашбордов по их ID единым запросом. - # @PRE: `ids` – непустой список целых чисел. - # @POST: Все указанные дашборды удалены (если они существовали). - # @PARAM: ids: List[int] - Список ID дашбордов для удаления. - # @RELATION: CALLS -> self.to_c.network.request + # [DEF:Migration._select_databases:Function] + # @PURPOSE: Позволяет пользователю выбрать исходную и целевую БД через API. + # @POST: Возвращает кортеж (старая БД, новая БД) или (None, None) при отмене. + # @RELATION: CALLS -> self.from_c.get_databases + # @RELATION: CALLS -> self.to_c.get_databases + # @RELATION: CALLS -> self.from_c.get_database + # @RELATION: CALLS -> self.to_c.get_database + # @RELATION: CALLS -> menu + def _select_databases(self) -> tuple: + self.logger.info("[_select_databases][Entry] Selecting databases from both environments.") + + # Получаем список БД из обоих окружений + try: + _, from_dbs = self.from_c.get_databases() + _, to_dbs = self.to_c.get_databases() + except Exception as e: + self.logger.error("[_select_databases][Failure] Failed to fetch databases: %s", e) + msgbox("Ошибка", "Не удалось получить список баз данных.") + return None, None + + # Формируем список для выбора + # По Swagger документации, в ответе API поле называется "database_name" + from_choices = [] + for db in from_dbs: + db_name = db.get("database_name", "Без имени") + from_choices.append((str(db["id"]), db_name)) + + to_choices = [] + for db in to_dbs: + db_name = db.get("database_name", "Без имени") + to_choices.append((str(db["id"]), db_name)) + + # Показываем список БД для исходного окружения + rc, from_sel = menu( + title="Выбор исходной БД", + prompt="Выберите исходную БД:", + choices=[f"{name} (ID: {id})" for id, name in from_choices] + ) + if rc != 0: + return None, None + + # Определяем выбранную БД + from_db_id = from_choices[[choice[1] for choice in from_choices].index(from_sel.split(" (ID: ")[0])] + # Получаем полную информацию о выбранной БД из исходного окружения + try: + from_db = self.from_c.get_database(int(from_db_id)) + except Exception as e: + self.logger.error("[_select_databases][Failure] Failed to fetch database details: %s", e) + msgbox("Ошибка", "Не удалось получить информацию о выбранной базе данных.") + return None, None + + # Показываем список БД для целевого окружения + rc, to_sel = menu( + title="Выбор целевой БД", + prompt="Выберите целевую БД:", + choices=[f"{name} (ID: {id})" for id, name in to_choices] + ) + if rc != 0: + return None, None + + # Определяем выбранную БД + to_db_id = to_choices[[choice[1] for choice in to_choices].index(to_sel.split(" (ID: ")[0])] + # Получаем полную информацию о выбранной БД из целевого окружения + try: + to_db = self.to_c.get_database(int(to_db_id)) + except Exception as e: + self.logger.error("[_select_databases][Failure] Failed to fetch database details: %s", e) + msgbox("Ошибка", "Не удалось получить информацию о выбранной базе данных.") + return None, None + + self.logger.info("[_select_databases][Exit] Selected databases: %s -> %s", from_db.get("database_name", "Без имени"), to_db.get("database_name", "Без имени")) + return from_db, to_db + # [/DEF:Migration._select_databases] + + # [DEF:Migration._batch_delete_by_ids:Function] + # @PURPOSE: Удаляет набор дашбордов по их ID единым запросом. + # @PRE: `ids` – непустой список целых чисел. + # @POST: Все указанные дашборды удалены (если они существовали). + # @RELATION: CALLS -> self.to_c.network.request + # @PARAM: ids (List[int]) - Список ID дашбордов для удаления. def _batch_delete_by_ids(self, ids: List[int]) -> None: if not ids: self.logger.debug("[_batch_delete_by_ids][Skip] Empty ID list – nothing to delete.") @@ -202,18 +287,18 @@ class Migration: self.logger.warning("[_batch_delete_by_ids][Warning] Unexpected delete response: %s", response) else: self.logger.info("[_batch_delete_by_ids][Success] Delete request completed.") - # + # [/DEF:Migration._batch_delete_by_ids] - # - # @PURPOSE: Выполняет экспорт-импорт дашбордов, обрабатывает ошибки и, при необходимости, выполняет процедуру восстановления. - # @PRE: `self.dashboards_to_migrate` не пуст; `self.from_c` и `self.to_c` инициализированы. - # @POST: Успешные дашборды импортированы; неудачные - восстановлены или залогированы. - # @RELATION: CALLS -> self.from_c.export_dashboard - # @RELATION: CALLS -> create_temp_file - # @RELATION: CALLS -> update_yamls - # @RELATION: CALLS -> create_dashboard_export - # @RELATION: CALLS -> self.to_c.import_dashboard - # @RELATION: CALLS -> self._batch_delete_by_ids + # [DEF:Migration.execute_migration:Function] + # @PURPOSE: Выполняет экспорт-импорт дашбордов, обрабатывает ошибки и, при необходимости, выполняет процедуру восстановления. + # @PRE: `self.dashboards_to_migrate` не пуст; `self.from_c` и `self.to_c` инициализированы. + # @POST: Успешные дашборды импортированы; неудачные - восстановлены или залогированы. + # @RELATION: CALLS -> self.from_c.export_dashboard + # @RELATION: CALLS -> create_temp_file + # @RELATION: CALLS -> update_yamls + # @RELATION: CALLS -> create_dashboard_export + # @RELATION: CALLS -> self.to_c.import_dashboard + # @RELATION: CALLS -> self._batch_delete_by_ids def execute_migration(self) -> None: if not self.dashboards_to_migrate: self.logger.warning("[execute_migration][Skip] No dashboards to migrate.") @@ -269,13 +354,11 @@ class Migration: self.logger.info("[execute_migration][Exit] Migration finished.") msgbox("Информация", "Миграция завершена!") - # + # [/DEF:Migration.execute_migration] -# - -# --- Конец кода модуля --- +# [/DEF:Migration] if __name__ == "__main__": Migration().run() -# \ No newline at end of file +# [/DEF:migration_script] diff --git a/run_mapper.py b/run_mapper.py index ad5532f..3f1feb1 100644 --- a/run_mapper.py +++ b/run_mapper.py @@ -1,24 +1,25 @@ -# -# @SEMANTICS: runner, configuration, cli, main -# @PURPOSE: Этот модуль является CLI-точкой входа для запуска процесса меппинга метаданных датасетов. -# @DEPENDS_ON: dataset_mapper -> Использует DatasetMapper для выполнения основной логики. -# @DEPENDS_ON: superset_tool.utils -> Для инициализации клиентов и логирования. +# [DEF:run_mapper:Module] +# +# @SEMANTICS: runner, configuration, cli, main +# @PURPOSE: Этот модуль является CLI-точкой входа для запуска процесса меппинга метаданных датасетов. +# @LAYER: App +# @RELATION: DEPENDS_ON -> superset_tool.utils.dataset_mapper +# @RELATION: DEPENDS_ON -> superset_tool.utils +# @PUBLIC_API: main -# +# [SECTION: IMPORTS] import argparse import keyring from superset_tool.utils.init_clients import setup_clients from superset_tool.utils.logger import SupersetLogger from superset_tool.utils.dataset_mapper import DatasetMapper -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Парсит аргументы командной строки и запускает процесс меппинга. -# @RELATION: CREATES_INSTANCE_OF -> DatasetMapper -# @RELATION: CALLS -> setup_clients -# @RELATION: CALLS -> DatasetMapper.run_mapping +# [DEF:main:Function] +# @PURPOSE: Парсит аргументы командной строки и запускает процесс меппинга. +# @RELATION: CREATES_INSTANCE_OF -> DatasetMapper +# @RELATION: CALLS -> setup_clients +# @RELATION: CALLS -> DatasetMapper.run_mapping def main(): parser = argparse.ArgumentParser(description="Map dataset verbose names in Superset.") parser.add_argument('--source', type=str, required=True, choices=['postgres', 'excel', 'both'], help='The source for the mapping.') @@ -63,11 +64,9 @@ def main(): except Exception as main_exc: logger.error("[main][Failure] An unexpected error occurred: %s", main_exc, exc_info=True) -# +# [/DEF:main] if __name__ == '__main__': main() -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:run_mapper] diff --git a/search_script.py b/search_script.py index 1678987..389f59a 100644 --- a/search_script.py +++ b/search_script.py @@ -1,118 +1,119 @@ -# -# @SEMANTICS: search, superset, dataset, regex, file_output -# @PURPOSE: Предоставляет утилиты для поиска по текстовым паттернам в метаданных датасетов Superset. -# @DEPENDS_ON: superset_tool.client -> Для взаимодействия с API Superset. -# @DEPENDS_ON: superset_tool.utils -> Для логирования и инициализации клиентов. - -# -import logging +# [DEF:search_script:Module] +# +# @SEMANTICS: search, superset, dataset, regex, file_output +# @PURPOSE: Предоставляет утилиты для поиска по текстовым паттернам в метаданных датасетов Superset. +# @LAYER: App +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> superset_tool.utils +# @PUBLIC_API: search_datasets, save_results_to_file, print_search_results, main + +# [SECTION: IMPORTS] +import logging import re import os -from typing import Dict, Optional -from requests.exceptions import RequestException -from superset_tool.client import SupersetClient -from superset_tool.exceptions import SupersetAPIError -from superset_tool.utils.logger import SupersetLogger -from superset_tool.utils.init_clients import setup_clients -# - -# --- Начало кода модуля --- - -# -# @PURPOSE: Выполняет поиск по строковому паттерну в метаданных всех датасетов. -# @PRE: `client` должен быть инициализированным экземпляром `SupersetClient`. -# @PRE: `search_pattern` должен быть валидной строкой регулярного выражения. -# @POST: Возвращает словарь с результатами поиска, где ключ - ID датасета, значение - список совпадений. -# @PARAM: client: SupersetClient - Клиент для доступа к API Superset. -# @PARAM: search_pattern: str - Регулярное выражение для поиска. -# @PARAM: logger: Optional[SupersetLogger] - Инстанс логгера. -# @RETURN: Optional[Dict] - Словарь с результатами или None, если ничего не найдено. -# @THROW: re.error - Если паттерн регулярного выражения невалиден. -# @THROW: SupersetAPIError, RequestException - При критических ошибках API. -# @RELATION: CALLS -> client.get_datasets -def search_datasets( - client: SupersetClient, - search_pattern: str, - logger: Optional[SupersetLogger] = None -) -> Optional[Dict]: - logger = logger or SupersetLogger(name="dataset_search") - logger.info(f"[search_datasets][Enter] Searching for pattern: '{search_pattern}'") - try: - _, datasets = client.get_datasets(query={"columns": ["id", "table_name", "sql", "database", "columns"]}) - - if not datasets: - logger.warning("[search_datasets][State] No datasets found.") - return None - - pattern = re.compile(search_pattern, re.IGNORECASE) - results = {} - - for dataset in datasets: - dataset_id = dataset.get('id') - if not dataset_id: - continue - - matches = [] - for field, value in dataset.items(): - value_str = str(value) - if pattern.search(value_str): - match_obj = pattern.search(value_str) - matches.append({ - "field": field, - "match": match_obj.group() if match_obj else "", - "value": value_str - }) - - if matches: - results[dataset_id] = matches - - logger.info(f"[search_datasets][Success] Found matches in {len(results)} datasets.") - return results - - except re.error as e: - logger.error(f"[search_datasets][Failure] Invalid regex pattern: {e}", exc_info=True) - raise - except (SupersetAPIError, RequestException) as e: - logger.critical(f"[search_datasets][Failure] Critical error during search: {e}", exc_info=True) - raise -# - -# -# @PURPOSE: Сохраняет результаты поиска в текстовый файл. -# @PRE: `results` является словарем, возвращенным `search_datasets`, или `None`. -# @PRE: `filename` должен быть допустимым путем к файлу. -# @POST: Записывает отформатированные результаты в указанный файл. -# @PARAM: results: Optional[Dict] - Словарь с результатами поиска. -# @PARAM: filename: str - Имя файла для сохранения результатов. -# @PARAM: logger: Optional[SupersetLogger] - Инстанс логгера. -# @RETURN: bool - Успешно ли выполнено сохранение. -def save_results_to_file(results: Optional[Dict], filename: str, logger: Optional[SupersetLogger] = None) -> bool: - logger = logger or SupersetLogger(name="file_writer") - logger.info(f"[save_results_to_file][Enter] Saving results to file: {filename}") - try: - formatted_report = print_search_results(results) - with open(filename, 'w', encoding='utf-8') as f: - f.write(formatted_report) - logger.info(f"[save_results_to_file][Success] Results saved to {filename}") - return True - except Exception as e: - logger.error(f"[save_results_to_file][Failure] Failed to save results to file: {e}", exc_info=True) - return False -# - -# -# @PURPOSE: Форматирует результаты поиска для читаемого вывода в консоль. -# @PRE: `results` является словарем, возвращенным `search_datasets`, или `None`. -# @POST: Возвращает отформатированную строку с результатами. -# @PARAM: results: Optional[Dict] - Словарь с результатами поиска. -# @PARAM: context_lines: int - Количество строк контекста для вывода до и после совпадения. -# @RETURN: str - Отформатированный отчет. -def print_search_results(results: Optional[Dict], context_lines: int = 3) -> str: - if not results: - return "Ничего не найдено" - - output = [] - for dataset_id, matches in results.items(): +from typing import Dict, Optional +from requests.exceptions import RequestException +from superset_tool.client import SupersetClient +from superset_tool.exceptions import SupersetAPIError +from superset_tool.utils.logger import SupersetLogger +from superset_tool.utils.init_clients import setup_clients +# [/SECTION] + +# [DEF:search_datasets:Function] +# @PURPOSE: Выполняет поиск по строковому паттерну в метаданных всех датасетов. +# @PRE: `client` должен быть инициализированным экземпляром `SupersetClient`. +# @PRE: `search_pattern` должен быть валидной строкой регулярного выражения. +# @POST: Возвращает словарь с результатами поиска, где ключ - ID датасета, значение - список совпадений. +# @RELATION: CALLS -> client.get_datasets +# @THROW: re.error - Если паттерн регулярного выражения невалиден. +# @THROW: SupersetAPIError, RequestException - При критических ошибках API. +# @PARAM: client (SupersetClient) - Клиент для доступа к API Superset. +# @PARAM: search_pattern (str) - Регулярное выражение для поиска. +# @PARAM: logger (Optional[SupersetLogger]) - Инстанс логгера. +# @RETURN: Optional[Dict] - Словарь с результатами или None, если ничего не найдено. +def search_datasets( + client: SupersetClient, + search_pattern: str, + logger: Optional[SupersetLogger] = None +) -> Optional[Dict]: + logger = logger or SupersetLogger(name="dataset_search") + logger.info(f"[search_datasets][Enter] Searching for pattern: '{search_pattern}'") + try: + _, datasets = client.get_datasets(query={"columns": ["id", "table_name", "sql", "database", "columns"]}) + + if not datasets: + logger.warning("[search_datasets][State] No datasets found.") + return None + + pattern = re.compile(search_pattern, re.IGNORECASE) + results = {} + + for dataset in datasets: + dataset_id = dataset.get('id') + if not dataset_id: + continue + + matches = [] + for field, value in dataset.items(): + value_str = str(value) + if pattern.search(value_str): + match_obj = pattern.search(value_str) + matches.append({ + "field": field, + "match": match_obj.group() if match_obj else "", + "value": value_str + }) + + if matches: + results[dataset_id] = matches + + logger.info(f"[search_datasets][Success] Found matches in {len(results)} datasets.") + return results + + except re.error as e: + logger.error(f"[search_datasets][Failure] Invalid regex pattern: {e}", exc_info=True) + raise + except (SupersetAPIError, RequestException) as e: + logger.critical(f"[search_datasets][Failure] Critical error during search: {e}", exc_info=True) + raise +# [/DEF:search_datasets] + +# [DEF:save_results_to_file:Function] +# @PURPOSE: Сохраняет результаты поиска в текстовый файл. +# @PRE: `results` является словарем, возвращенным `search_datasets`, или `None`. +# @PRE: `filename` должен быть допустимым путем к файлу. +# @POST: Записывает отформатированные результаты в указанный файл. +# @PARAM: results (Optional[Dict]) - Словарь с результатами поиска. +# @PARAM: filename (str) - Имя файла для сохранения результатов. +# @PARAM: logger (Optional[SupersetLogger]) - Инстанс логгера. +# @RETURN: bool - Успешно ли выполнено сохранение. +def save_results_to_file(results: Optional[Dict], filename: str, logger: Optional[SupersetLogger] = None) -> bool: + logger = logger or SupersetLogger(name="file_writer") + logger.info(f"[save_results_to_file][Enter] Saving results to file: {filename}") + try: + formatted_report = print_search_results(results) + with open(filename, 'w', encoding='utf-8') as f: + f.write(formatted_report) + logger.info(f"[save_results_to_file][Success] Results saved to {filename}") + return True + except Exception as e: + logger.error(f"[save_results_to_file][Failure] Failed to save results to file: {e}", exc_info=True) + return False +# [/DEF:save_results_to_file] + +# [DEF:print_search_results:Function] +# @PURPOSE: Форматирует результаты поиска для читаемого вывода в консоль. +# @PRE: `results` является словарем, возвращенным `search_datasets`, или `None`. +# @POST: Возвращает отформатированную строку с результатами. +# @PARAM: results (Optional[Dict]) - Словарь с результатами поиска. +# @PARAM: context_lines (int) - Количество строк контекста для вывода до и после совпадения. +# @RETURN: str - Отформатированный отчет. +def print_search_results(results: Optional[Dict], context_lines: int = 3) -> str: + if not results: + return "Ничего не найдено" + + output = [] + for dataset_id, matches in results.items(): # Получаем информацию о базе данных для текущего датасета database_info = "" # Ищем поле database среди совпадений, чтобы вывести его @@ -131,63 +132,63 @@ def print_search_results(results: Optional[Dict], context_lines: int = 3) -> str output.append(f" Database: {database_info}") output.append("") # Пустая строка для читабельности - for match_info in matches: - field, match_text, full_value = match_info['field'], match_info['match'], match_info['value'] - output.append(f" - Поле: {field}") - output.append(f" Совпадение: '{match_text}'") - - lines = full_value.splitlines() - if not lines: continue - - match_line_index = -1 - for i, line in enumerate(lines): - if match_text in line: - match_line_index = i - break - - if match_line_index != -1: - start = max(0, match_line_index - context_lines) - end = min(len(lines), match_line_index + context_lines + 1) - output.append(" Контекст:") - for i in range(start, end): - prefix = f"{i + 1:5d}: " - line_content = lines[i] - if i == match_line_index: - highlighted = line_content.replace(match_text, f">>>{match_text}<<<") - output.append(f" {prefix}{highlighted}") - else: - output.append(f" {prefix}{line_content}") - output.append("-" * 25) - return "\n".join(output) -# - -# -# @PURPOSE: Основная точка входа для запуска скрипта поиска. -# @RELATION: CALLS -> setup_clients -# @RELATION: CALLS -> search_datasets -# @RELATION: CALLS -> print_search_results -# @RELATION: CALLS -> save_results_to_file -def main(): - logger = SupersetLogger(level=logging.INFO, console=True) - clients = setup_clients(logger) - - target_client = clients['prod'] - search_query = r"from dm_view.[a-z_]*" + for match_info in matches: + field, match_text, full_value = match_info['field'], match_info['match'], match_info['value'] + output.append(f" - Поле: {field}") + output.append(f" Совпадение: '{match_text}'") + + lines = full_value.splitlines() + if not lines: continue + + match_line_index = -1 + for i, line in enumerate(lines): + if match_text in line: + match_line_index = i + break + + if match_line_index != -1: + start = max(0, match_line_index - context_lines) + end = min(len(lines), match_line_index + context_lines + 1) + output.append(" Контекст:") + for i in range(start, end): + prefix = f"{i + 1:5d}: " + line_content = lines[i] + if i == match_line_index: + highlighted = line_content.replace(match_text, f">>>{match_text}<<<") + output.append(f" {prefix}{highlighted}") + else: + output.append(f" {prefix}{line_content}") + output.append("-" * 25) + return "\n".join(output) +# [/DEF:print_search_results] + +# [DEF:main:Function] +# @PURPOSE: Основная точка входа для запуска скрипта поиска. +# @RELATION: CALLS -> setup_clients +# @RELATION: CALLS -> search_datasets +# @RELATION: CALLS -> print_search_results +# @RELATION: CALLS -> save_results_to_file +def main(): + logger = SupersetLogger(level=logging.INFO, console=True) + clients = setup_clients(logger) + + target_client = clients['dev5'] + search_query = r"from dm(_view)*.account_debt" # Генерируем имя файла на основе времени import datetime timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") output_filename = f"search_results_{timestamp}.txt" - results = search_datasets( - client=target_client, - search_pattern=search_query, - logger=logger - ) - - report = print_search_results(results) - - logger.info(f"[main][Success] Search finished. Report:\n{report}") + results = search_datasets( + client=target_client, + search_pattern=search_query, + logger=logger + ) + + report = print_search_results(results) + + logger.info(f"[main][Success] Search finished. Report:\n{report}") # Сохраняем результаты в файл success = save_results_to_file(results, output_filename, logger) @@ -195,12 +196,9 @@ def main(): logger.info(f"[main][Success] Results also saved to file: {output_filename}") else: logger.error(f"[main][Failure] Failed to save results to file: {output_filename}") +# [/DEF:main] -# - -if __name__ == "__main__": - main() - -# --- Конец кода модуля --- - -# \ No newline at end of file +if __name__ == "__main__": + main() + +# [/DEF:search_script] diff --git a/semantic_protocol.md b/semantic_protocol.md index 30f1810..ee92217 100644 --- a/semantic_protocol.md +++ b/semantic_protocol.md @@ -1,120 +1,144 @@ -### **Протокол GRACE-Py: Семантическая Разметка для AI-Агентов на Python** +# 📁 BUNDLE: Engineering Prompting & GRACE Methodology +**Context Transfer Protocol for LLM Agents** -**Версия: 2.2 (Hybrid)** +## 1. Фундаментальная Парадигма (The "Physics" of LLMs) +Мы отказываемся от антропоморфного подхода ("диалог с помощником") в пользу инженерного подхода ("программирование семантического процессора"). -#### **I. Философия и Основные Принципы** +* **Трансформер = GNN (Graph Neural Network):** LLM обрабатывает токены как узлы в полносвязном графе. Чтобы модель работала эффективно, мы должны явно задавать топологию этого графа через семантические связи. +* **Мышление = Навигация по Состояниям (FSM):** Генерация — это переход между "состояниями веры" (Belief States). Мы управляем этими переходами через Якоря и Контракты. +* **Causal Attention & KV Cache:** Модель читает слева-направо. Смысл, обработанный в начале, "замораживается". **Правило:** Контекст и Контракты всегда строго *до* реализации. +* **Sparse Attention & Block Processing:** На больших контекстах (100k+) модель работает не с отдельными токенами, а с семантическими сжатиями блоков (чанков). Наша разметка создает идеальные границы для этих блоков, помогая механизму Top-K retrieval. +* **Проблема "Семантического Казино":** Без жесткой структуры модель играет в рулетку вероятностей. Мы устраняем это через детерминированные структуры (графы, схемы). +* **Проблема "Нейронного Воя" (Neural Howlround):** Самоусиливающиеся ошибки в длинных сессиях. **Решение:** Разделение сессий, жесткие инварианты и использование "суперпозиции" (анализ вариантов перед решением). -Этот протокол является **единственным источником истины** для правил семантического обогащения кода. Его цель — превратить процесс разработки с LLM-агентами из непредсказуемого "диалога" в управляемую **инженерную дисциплину**. +--- -* **Аксиома 1: Код Вторичен.** Первична его семантическая модель (графы, контракты, якоря). -* **Аксиома 2: Когерентность Абсолютна.** Все артефакты (ТЗ, граф, контракты, код) должны быть на 100% семантически согласованы. -* **Аксиома 3: Архитектура GPT — Закон.** Протокол построен на фундаментальных принципах работы трансформеров (Causal Attention, KV Cache, Sparse Attention). +## 2. Методология GRACE (Framework) +Целостная система управления жизненным циклом генерации. -#### **II. Структура Файла (`.py`)** +* **G (Graph):** Глобальная карта проекта. Определяет связи (`DEPENDS_ON`, `CALLS`) между модулями. Служит картой для навигации внимания. +* **R (Rules):** Инварианты и ограничения (Безопасность, Стек, Паттерны). +* **A (Anchors):** Система навигации внутри кода. + * *Открывающий якорь:* Задает контекст. + * *Замыкающий якорь:* **Аккумулятор семантики**. Критически важен для RAG-систем (Cursor, GraphRAG), так как "вбирает" в себя смысл всего блока. +* **C (Contracts):** Принцип **Design by Contract (DbC)**. Спецификация (`@PRE`, `@POST`) всегда пишется *до* кода. Реализация обязана содержать проверки (`assert`/`raise`) этих условий. +* **E (Evaluation):** Логирование как декларация состояния (`[STATE:Validation]`) и проверка когерентности (`[Coherence:OK]`). -Каждый Python-файл ДОЛЖЕН иметь четкую, машиночитаемую структуру, обрамленную якорями. +--- + +## 3. Рабочий Протокол: GRACE-Py v3.1 (Strict Edition) +Это стандарт синтаксиса, к которому мы пришли. Он минимизирует "шум" (интерференцию с XML), использует нативные для Python токены (`def`) и убирает ролевую шелуху. + +**Скопируйте этот блок в System Prompt новой LLM:** + +```markdown +# SYSTEM STANDARD: GRACE-Py CODE GENERATION PROTOCOL + +**OBJECTIVE:** Generate Python code that strictly adheres to the Semantic Coherence standards defined below. All output must be machine-readable, fractal-structured, and optimized for Sparse Attention navigation. + +## I. CORE REQUIREMENTS +1. **Causal Validity:** Semantic definitions (Contracts) must ALWAYS precede implementation code. +2. **Immutability:** Once defined, architectural decisions in the Module Header are treated as immutable constraints. +3. **Format Compliance:** Output must strictly follow the `[DEF]` / `[/DEF]` anchor syntax. + +--- + +## II. SYNTAX SPECIFICATION + +Code must be wrapped in semantic anchors using square brackets to minimize token interference. + +### 1. Entity Anchors (The "Container") +* **Start:** `# [DEF:identifier:Type]` +* **End:** `# [/DEF:identifier]` (MANDATORY for semantic accumulation) +* **Types:** `Module`, `Class`, `Function`, `DataClass`, `Enum`. + +### 2. Metadata Tags (The "Content") +* **Syntax:** `# @KEY: Value` +* **Location:** Inside the `[DEF]` block, before any code. + +### 3. Graph Relations (The "Map") +* **Syntax:** `# @RELATION: TYPE -> TARGET_ID` +* **Types:** `DEPENDS_ON`, `CALLS`, `INHERITS_FROM`, `IMPLEMENTS`, `WRITES_TO`, `READS_FROM`. + +--- + +## III. FILE STRUCTURE STANDARD (Module Header) + +Every `.py` file starts with a Module definition. ```python -# -# @SEMANTICS: domain, usecase, data_processing -# @PURPOSE: Этот модуль отвечает за обработку пользовательских данных. -# @DEPENDS_ON: utils_module -> Использует утилиты для валидации. +# [DEF:module_name:Module] +# +# @SEMANTICS: [keywords for vector search] +# @PURPOSE: [Primary responsibility of the module] +# @LAYER: [Architecture layer: Domain/Infra/UI] +# @RELATION: [Dependencies] +# +# @INVARIANT: [Global immutable rule for this file] +# @CONSTRAINT: [Hard restriction, e.g., "No SQL here"] +# @PUBLIC_API: [Exported symbols] -# -import os -from typing import List -# +# [SECTION: IMPORTS] +... +# [/SECTION] -# --- Начало кода модуля --- +# ... IMPLEMENTATION ... -# ... (классы, функции, константы) ... - -# --- Конец кода модуля --- - -# +# [/DEF:module_name] ``` -#### **III. Компоненты Разметки (Детализация GRACE-Py)** +--- -##### **A. Anchors (Якоря): Навигация и Консолидация** +## IV. FUNCTION & CLASS CONTRACTS (DbC) -1. **Назначение:** Якоря — это основной инструмент для управления вниманием ИИ, создания семантических каналов и обеспечения надежной навигации в больших кодовых базах (Sparse Attention). -2. **Синтаксис:** Используются парные комментарии в псевдо-XML формате. - * **Открывающий:** `# ` - * **Закрывающий (Обязателен!):** `# ` -3. **"Якорь-Аккумулятор":** Закрывающий якорь консолидирует всю семантику блока (контракт + код), создавая мощный вектор для RAG-систем. -4. **Семантические Каналы:** `id` якоря ДОЛЖЕН совпадать с именем сущности для создания устойчивой семантической связи. -5. **Таксономия Типов (`type`):** `Module`, `Class`, `Interface`, `Object`, `DataClass`, `SealedInterface`, `EnumClass`, `Function`, `UseCase`, `ViewModel`, `Repository`. - -##### **C. Contracts (Контракты): Тактические Спецификации** - -1. **Назначение:** Предоставление ИИ точных инструкций для генерации и валидации кода. -2. **Расположение:** Контракт всегда располагается **внутри открывающего якоря**, ДО декларации кода (`def` или `class`). -3. **Синтаксис:** JSDoc-подобный стиль с `@tag` для лаконичности и читаемости. - ```python - # - # @PURPOSE: Валидирует и обрабатывает входящие данные пользователя. - # @SPEC_LINK: tz-req-005 - # @PRE: `raw_data` не должен быть пустым. - # @POST: Возвращаемый словарь содержит ключ 'is_valid'. - # @PARAM: raw_data: Dict[str, any] - Сырые данные от пользователя. - # @RETURN: Dict[str, any] - Обработанные и валидированные данные. - # @TEST: input='{"user_id": 123}', expected_output='{"is_valid": True}' - # @THROW: ValueError - Если 'user_id' отсутствует. - # @RELATION: CALLS -> validate_user_id - # @CONSTRAINT: Не использовать внешние сетевые вызовы. - ``` -4. **Реализация в Коде:** Предусловия и постусловия, описанные в контракте, ДОЛЖНЫ быть реализованы в коде с использованием `assert`, `require()`/`check()` или явных `if...raise`. - -##### **G. Graph (Граф Знаний)** - -1. **Назначение:** Описание высокоуровневых зависимостей между сущностями. -2. **Реализация:** Граф определяется тегами `@RELATION` внутри GRACE блока (якоря). Это создает распределенный граф, который легко парсить. - * **Синтаксис:** `@: -> [опциональное описание]` - * **Таксономия Предикатов (``):** `DEPENDS_ON`, `CALLS`, `CREATES_INSTANCE_OF`, `INHERITS_FROM`, `IMPLEMENTS`, `READS_FROM`, `WRITES_TO`, `DISPATCHES_EVENT`, `OBSERVES`. - -##### **E. Evaluation (Логирование)** - -1. **Назначение:** Декларация `belief state` агента и обеспечение трассируемости для отладки. -2. **Формат:** `logger.level(f"[ANCHOR_ID][STATE] Сообщение")` - * **`ANCHOR_ID`:** `id` якоря, в котором находится лог. - * **`STATE`:** Текущее состояние логики (например, `Entry`, `Validation`, `Exit`, `CoherenceCheckFailed`). -3. **Пример:** `logger.debug(f"[process_data][Validation] Проверка `raw_data`...")` - -#### **IV. Запреты и Ограничения** - -1. **Запрет на Обычные Комментарии:** Комментарии в стиле `//` или `/* */` **ЗАПРЕЩЕНЫ**. Вся мета-информация должна быть в структурированных GRACE блоках. - * **Исключение:** `# [AI_NOTE]: ...` для прямых указаний агенту в конкретной точке кода. - -#### **V. Полный Пример Разметки Функции (GRACE-Py 2.2)** +Contracts are the **Source of Truth**. +**Required Template:** ```python -# -# @PURPOSE: Валидирует и обрабатывает входящие данные пользователя. -# @SPEC_LINK: tz-req-005 -# @PRE: `raw_data` не должен быть пустым. -# @PARAM: raw_data: Dict[str, any] - Сырые данные от пользователя. -# @RETURN: Dict[str, any] - Обработанные и валидированные данные. -# @TEST: input='{}', expected_exception='AssertionError' -# @RELATION: CALLS -> some_helper_function -def process_data(raw_data: dict) -> dict: - """ - Docstring для стандартных инструментов Python. - Не является источником истины для ИИ-агентов. - """ - logger.debug(f"[process_data][Entry] Начало обработки данных.") - - # Реализация контракта - assert raw_data, "Precondition failed: raw_data must not be empty." - - # ... Основная логика ... - processed_data = {"is_valid": True} - processed_data.update(raw_data) - - logger.info(f"[process_data][CoherenceCheck:Passed] Код соответствует контракту.") - logger.debug(f"[process_data][Exit] Завершение обработки.") - - return processed_data -# +# [DEF:func_name:Function] +# @PURPOSE: [Description] +# @SPEC_LINK: [Requirement ID] +# +# @PRE: [Condition required before execution] +# @POST: [Condition guaranteed after execution] +# @PARAM: [name] ([type]) - [desc] +# @RETURN: [type] - [desc] +# @THROW: [Exception] - [Reason] +# +# @RELATION: [Graph connections] +def func_name(...): + # 1. Runtime check of @PRE (Assertions) + # 2. Logic implementation + # 3. Runtime check of @POST + pass +# [/DEF:func_name] ``` +--- + +## V. LOGGING STANDARD (BELIEF STATE) + +Logs define the agent's internal state for debugging and coherence checks. + +**Format:** `logger.level(f"[{ANCHOR_ID}][{STATE}] {MESSAGE} context={...}")` + +**States:** `Entry`, `Validation`, `Action`, `Coherence:OK`, `Coherence:Failed`, `Exit`. + +--- + +## VI. GENERATION WORKFLOW +1. **Analyze Request:** Identify target module and graph position. +2. **Define Structure:** Generate `[DEF]` anchors and Contracts FIRST. +3. **Implement Logic:** Write code satisfying Contracts. +4. **Validate:** If logic conflicts with Contract -> Stop -> Report Error. +``` + +--- + +## 4. Интеграция с RAG (GraphRAG) +Как этот код используется инструментами (например, Cursor): + +1. **Индексация:** RAG-система парсит теги `[DEF]`, `[/DEF]` и `@RELATION`. +2. **Построение Графа:** На основе `@RELATION` и `@DEPENDS_ON` строится граф знаний проекта. +3. **Вектор-Аккумулятор:** Замыкающий тег `[/DEF:func_name]` используется как точка для создания эмбеддинга всего блока. Это позволяет находить функцию не только по имени, но и по её внутренней логике. +4. **Поиск:** При запросе "Где логика авторизации?" система находит модуль по тегу `@SEMANTICS: auth` и переходит к конкретным функциям по графу. diff --git a/superset_tool/__init__.py b/superset_tool/__init__.py index e69de29..5ffe369 100644 --- a/superset_tool/__init__.py +++ b/superset_tool/__init__.py @@ -0,0 +1,14 @@ +# [DEF:superset_tool:Module] +# @SEMANTICS: package, root +# @PURPOSE: Root package for superset_tool. +# @LAYER: Domain +# @PUBLIC_API: SupersetClient, SupersetConfig + +# [SECTION: IMPORTS] +from .client import SupersetClient +from .models import SupersetConfig +# [/SECTION] + +__all__ = ["SupersetClient", "SupersetConfig"] + +# [/DEF:superset_tool] diff --git a/superset_tool/client.py b/superset_tool/client.py index 9fefc20..9e4a429 100644 --- a/superset_tool/client.py +++ b/superset_tool/client.py @@ -1,36 +1,41 @@ -# -# @SEMANTICS: superset, api, client, rest, http, dashboard, dataset, import, export -# @PURPOSE: Предоставляет высокоуровневый клиент для взаимодействия с Superset REST API, инкапсулируя логику запросов, обработку ошибок и пагинацию. -# @DEPENDS_ON: superset_tool.models -> Использует SupersetConfig для конфигурации. -# @DEPENDS_ON: superset_tool.exceptions -> Выбрасывает специализированные исключения. -# @DEPENDS_ON: superset_tool.utils -> Использует утилиты для сети, логгирования и работы с файлами. +# [DEF:superset_tool.client:Module] +# +# @SEMANTICS: superset, api, client, rest, http, dashboard, dataset, import, export +# @PURPOSE: Предоставляет высокоуровневый клиент для взаимодействия с Superset REST API, инкапсулируя логику запросов, обработку ошибок и пагинацию. +# @LAYER: Domain +# @RELATION: DEPENDS_ON -> superset_tool.models +# @RELATION: DEPENDS_ON -> superset_tool.exceptions +# @RELATION: DEPENDS_ON -> superset_tool.utils +# +# @INVARIANT: All network operations must use the internal APIClient instance. +# @CONSTRAINT: No direct use of 'requests' library outside of APIClient. +# @PUBLIC_API: SupersetClient -# +# [SECTION: IMPORTS] import json import zipfile from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import Any, Dict, List, Optional, Tuple, Union, cast from requests import Response from superset_tool.models import SupersetConfig from superset_tool.exceptions import ExportError, InvalidZipFormatError from superset_tool.utils.fileio import get_filename_from_headers from superset_tool.utils.logger import SupersetLogger from superset_tool.utils.network import APIClient -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Класс-обёртка над Superset REST API, предоставляющий методы для работы с дашбордами и датасетами. -# @RELATION: CREATES_INSTANCE_OF -> APIClient -# @RELATION: USES -> SupersetConfig +# [DEF:SupersetClient:Class] +# @PURPOSE: Класс-обёртка над Superset REST API, предоставляющий методы для работы с дашбордами и датасетами. +# @RELATION: CREATES_INSTANCE_OF -> APIClient +# @RELATION: USES -> SupersetConfig class SupersetClient: + # [DEF:SupersetClient.__init__:Function] + # @PURPOSE: Инициализирует клиент, проверяет конфигурацию и создает сетевой клиент. + # @PRE: `config` должен быть валидным объектом SupersetConfig. + # @POST: Атрибуты `logger`, `config`, и `network` созданы и готовы к работе. + # @PARAM: config (SupersetConfig) - Конфигурация подключения. + # @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. def __init__(self, config: SupersetConfig, logger: Optional[SupersetLogger] = None): - # - # @PURPOSE: Инициализирует клиент, проверяет конфигурацию и создает сетевой клиент. - # @PARAM: config: SupersetConfig - Конфигурация подключения. - # @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. - # @POST: Атрибуты `logger`, `config`, и `network` созданы. self.logger = logger or SupersetLogger(name="SupersetClient") self.logger.info("[SupersetClient.__init__][Enter] Initializing SupersetClient.") self._validate_config(config) @@ -43,32 +48,40 @@ class SupersetClient: ) self.delete_before_reimport: bool = False self.logger.info("[SupersetClient.__init__][Exit] SupersetClient initialized.") - # + # [/DEF:SupersetClient.__init__] - # - # @PURPOSE: Проверяет, что переданный объект конфигурации имеет корректный тип. - # @PARAM: config: SupersetConfig - Объект для проверки. - # @THROW: TypeError - Если `config` не является экземпляром `SupersetConfig`. + # [DEF:SupersetClient._validate_config:Function] + # @PURPOSE: Проверяет, что переданный объект конфигурации имеет корректный тип. + # @PRE: `config` должен быть передан. + # @POST: Если проверка пройдена, выполнение продолжается. + # @THROW: TypeError - Если `config` не является экземпляром `SupersetConfig`. + # @PARAM: config (SupersetConfig) - Объект для проверки. def _validate_config(self, config: SupersetConfig) -> None: self.logger.debug("[_validate_config][Enter] Validating SupersetConfig.") assert isinstance(config, SupersetConfig), "Конфигурация должна быть экземпляром SupersetConfig" self.logger.debug("[_validate_config][Exit] Config is valid.") - # + # [/DEF:SupersetClient._validate_config] @property def headers(self) -> dict: - # - # @PURPOSE: Возвращает базовые HTTP-заголовки, используемые сетевым клиентом. + # [DEF:SupersetClient.headers:Function] + # @PURPOSE: Возвращает базовые HTTP-заголовки, используемые сетевым клиентом. + # @PRE: self.network должен быть инициализирован. + # @POST: Возвращаемый словарь содержит актуальные заголовки, включая токен авторизации. return self.network.headers - # + # [/DEF:SupersetClient.headers] - # - # @PURPOSE: Получает полный список дашбордов, автоматически обрабатывая пагинацию. - # @PARAM: query: Optional[Dict] - Дополнительные параметры запроса для API. - # @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список дашбордов). - # @RELATION: CALLS -> self._fetch_total_object_count - # @RELATION: CALLS -> self._fetch_all_pages + # [DEF:SupersetClient.get_dashboards:Function] + # @PURPOSE: Получает полный список дашбордов, автоматически обрабатывая пагинацию. + # @RELATION: CALLS -> self._fetch_total_object_count + # @RELATION: CALLS -> self._fetch_all_pages + # @PRE: self.network должен быть инициализирован. + # @POST: Возвращаемый список содержит все дашборды, доступные по API. + # @THROW: APIError - В случае ошибки сетевого запроса. + # @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса для API. + # @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список дашбордов). def get_dashboards(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]: + assert self.network, "[get_dashboards][PRE] Network client must be initialized." self.logger.info("[get_dashboards][Enter] Fetching dashboards.") validated_query = self._validate_query_params(query) total_count = self._fetch_total_object_count(endpoint="/dashboard/") @@ -78,15 +91,18 @@ class SupersetClient: ) self.logger.info("[get_dashboards][Exit] Found %d dashboards.", total_count) return total_count, paginated_data - # + # [/DEF:SupersetClient.get_dashboards] - # - # @PURPOSE: Экспортирует дашборд в виде ZIP-архива. - # @PARAM: dashboard_id: int - ID дашборда для экспорта. - # @RETURN: Tuple[bytes, str] - Бинарное содержимое ZIP-архива и имя файла. - # @THROW: ExportError - Если экспорт завершился неудачей. - # @RELATION: CALLS -> self.network.request + # [DEF:SupersetClient.export_dashboard:Function] + # @PURPOSE: Экспортирует дашборд в виде ZIP-архива. + # @RELATION: CALLS -> self.network.request + # @PRE: dashboard_id должен быть положительным целым числом. + # @POST: Возвращает бинарное содержимое ZIP-архива и имя файла. + # @THROW: ExportError - Если экспорт завершился неудачей. + # @PARAM: dashboard_id (int) - ID дашборда для экспорта. + # @RETURN: Tuple[bytes, str] - Бинарное содержимое ZIP-архива и имя файла. def export_dashboard(self, dashboard_id: int) -> Tuple[bytes, str]: + assert isinstance(dashboard_id, int) and dashboard_id > 0, "[export_dashboard][PRE] dashboard_id must be a positive integer." self.logger.info("[export_dashboard][Enter] Exporting dashboard %s.", dashboard_id) response = self.network.request( method="GET", @@ -95,22 +111,28 @@ class SupersetClient: stream=True, raw_response=True, ) + response = cast(Response, response) self._validate_export_response(response, dashboard_id) filename = self._resolve_export_filename(response, dashboard_id) self.logger.info("[export_dashboard][Exit] Exported dashboard %s to %s.", dashboard_id, filename) return response.content, filename - # + # [/DEF:SupersetClient.export_dashboard] - # - # @PURPOSE: Импортирует дашборд из ZIP-файла с возможностью автоматического удаления и повторной попытки при ошибке. - # @PARAM: file_name: Union[str, Path] - Путь к ZIP-архиву. - # @PARAM: dash_id: Optional[int] - ID дашборда для удаления при сбое. - # @PARAM: dash_slug: Optional[str] - Slug дашборда для поиска ID, если ID не предоставлен. - # @RETURN: Dict - Ответ API в случае успеха. - # @RELATION: CALLS -> self._do_import - # @RELATION: CALLS -> self.delete_dashboard - # @RELATION: CALLS -> self.get_dashboards + # [DEF:SupersetClient.import_dashboard:Function] + # @PURPOSE: Импортирует дашборд из ZIP-файла с возможностью автоматического удаления и повторной попытки при ошибке. + # @RELATION: CALLS -> self._do_import + # @RELATION: CALLS -> self.delete_dashboard + # @RELATION: CALLS -> self.get_dashboards + # @PRE: Файл, указанный в `file_name`, должен существовать и быть валидным ZIP-архивом Superset. + # @POST: Дашборд успешно импортирован, возвращен ответ API. + # @THROW: FileNotFoundError - Если файл не найден. + # @THROW: InvalidZipFormatError - Если файл не является валидным ZIP-архивом Superset. + # @PARAM: file_name (Union[str, Path]) - Путь к ZIP-архиву. + # @PARAM: dash_id (Optional[int]) - ID дашборда для удаления при сбое. + # @PARAM: dash_slug (Optional[str]) - Slug дашборда для поиска ID, если ID не предоставлен. + # @RETURN: Dict - Ответ API в случае успеха. def import_dashboard(self, file_name: Union[str, Path], dash_id: Optional[int] = None, dash_slug: Optional[str] = None) -> Dict: + assert file_name, "[import_dashboard][PRE] file_name must be provided." file_path = str(file_name) self._validate_import_file(file_path) try: @@ -128,12 +150,18 @@ class SupersetClient: self.delete_dashboard(target_id) self.logger.info("[import_dashboard][State] Deleted dashboard ID %s, retrying import.", target_id) return self._do_import(file_path) - # + # [/DEF:SupersetClient.import_dashboard] - # - # @PURPOSE: Определяет ID дашборда для удаления, используя ID или slug. - # @INTERNAL + # [DEF:SupersetClient._resolve_target_id_for_delete:Function] + # @PURPOSE: Определяет ID дашборда для удаления, используя ID или slug. + # @PARAM: dash_id (Optional[int]) - ID дашборда. + # @PARAM: dash_slug (Optional[str]) - Slug дашборда. + # @PRE: По крайней мере один из параметров (dash_id или dash_slug) должен быть предоставлен. + # @POST: Возвращает ID дашборда, если найден, иначе None. + # @THROW: APIError - В случае ошибки сетевого запроса при поиске по slug. + # @RETURN: Optional[int] - Найденный ID или None. def _resolve_target_id_for_delete(self, dash_id: Optional[int], dash_slug: Optional[str]) -> Optional[int]: + assert dash_id is not None or dash_slug is not None, "[_resolve_target_id_for_delete][PRE] At least one of ID or slug must be provided." if dash_id is not None: return dash_id if dash_slug is not None: @@ -147,37 +175,58 @@ class SupersetClient: except Exception as e: self.logger.warning("[_resolve_target_id_for_delete][Warning] Could not resolve slug '%s' to ID: %s", dash_slug, e) return None - # + # [/DEF:SupersetClient._resolve_target_id_for_delete] - # - # @PURPOSE: Выполняет один запрос на импорт без обработки исключений. - # @INTERNAL + # [DEF:SupersetClient._do_import:Function] + # @PURPOSE: Выполняет один запрос на импорт без обработки исключений. + # @PRE: Файл должен существовать. + # @POST: Файл успешно загружен, возвращен ответ API. + # @THROW: FileNotFoundError - Если файл не существует. + # @PARAM: file_name (Union[str, Path]) - Путь к файлу. + # @RETURN: Dict - Ответ API. def _do_import(self, file_name: Union[str, Path]) -> Dict: + self.logger.debug(f"[_do_import][State] Uploading file: {file_name}") + file_path = Path(file_name) + if file_path.exists(): + self.logger.debug(f"[_do_import][State] File size: {file_path.stat().st_size} bytes") + else: + self.logger.error(f"[_do_import][Failure] File does not exist: {file_name}") + raise FileNotFoundError(f"File does not exist: {file_name}") return self.network.upload_file( endpoint="/dashboard/import/", - file_info={"file_obj": Path(file_name), "file_name": Path(file_name).name, "form_field": "formData"}, + file_info={"file_obj": file_path, "file_name": file_path.name, "form_field": "formData"}, extra_data={"overwrite": "true"}, timeout=self.config.timeout * 2, ) - # + # [/DEF:SupersetClient._do_import] - # - # @PURPOSE: Удаляет дашборд по его ID или slug. - # @PARAM: dashboard_id: Union[int, str] - ID или slug дашборда. - # @RELATION: CALLS -> self.network.request + # [DEF:SupersetClient.delete_dashboard:Function] + # @PURPOSE: Удаляет дашборд по его ID или slug. + # @RELATION: CALLS -> self.network.request + # @PRE: dashboard_id должен быть предоставлен. + # @POST: Дашборд удален или залогировано предупреждение. + # @THROW: APIError - В случае ошибки сетевого запроса. + # @PARAM: dashboard_id (Union[int, str]) - ID или slug дашборда. def delete_dashboard(self, dashboard_id: Union[int, str]) -> None: + assert dashboard_id, "[delete_dashboard][PRE] dashboard_id must be provided." self.logger.info("[delete_dashboard][Enter] Deleting dashboard %s.", dashboard_id) response = self.network.request(method="DELETE", endpoint=f"/dashboard/{dashboard_id}") + response = cast(Dict, response) if response.get("result", True) is not False: self.logger.info("[delete_dashboard][Success] Dashboard %s deleted.", dashboard_id) else: self.logger.warning("[delete_dashboard][Warning] Unexpected response while deleting %s: %s", dashboard_id, response) - # + # [/DEF:SupersetClient.delete_dashboard] - # - # @PURPOSE: Извлекает ID дашборда из `metadata.yaml` внутри ZIP-архива. - # @INTERNAL + # [DEF:SupersetClient._extract_dashboard_id_from_zip:Function] + # @PURPOSE: Извлекает ID дашборда из `metadata.yaml` внутри ZIP-архива. + # @PARAM: file_name (Union[str, Path]) - Путь к ZIP-файлу. + # @PRE: Файл, указанный в `file_name`, должен быть валидным ZIP-архивом. + # @POST: Возвращает ID дашборда, если найден в metadata.yaml, иначе None. + # @THROW: ImportError - Если не установлен `yaml`. + # @RETURN: Optional[int] - ID дашборда или None. def _extract_dashboard_id_from_zip(self, file_name: Union[str, Path]) -> Optional[int]: + assert zipfile.is_zipfile(file_name), "[_extract_dashboard_id_from_zip][PRE] file_name must be a valid zip file." try: import yaml with zipfile.ZipFile(file_name, "r") as zf: @@ -190,12 +239,17 @@ class SupersetClient: except Exception as exc: self.logger.error("[_extract_dashboard_id_from_zip][Failure] %s", exc, exc_info=True) return None - # + # [/DEF:SupersetClient._extract_dashboard_id_from_zip] - # - # @PURPOSE: Извлекает slug дашборда из `metadata.yaml` внутри ZIP-архива. - # @INTERNAL + # [DEF:SupersetClient._extract_dashboard_slug_from_zip:Function] + # @PURPOSE: Извлекает slug дашборда из `metadata.yaml` внутри ZIP-архива. + # @PARAM: file_name (Union[str, Path]) - Путь к ZIP-файлу. + # @PRE: Файл, указанный в `file_name`, должен быть валидным ZIP-архивом. + # @POST: Возвращает slug дашборда, если найден в metadata.yaml, иначе None. + # @THROW: ImportError - Если не установлен `yaml`. + # @RETURN: Optional[str] - Slug дашборда или None. def _extract_dashboard_slug_from_zip(self, file_name: Union[str, Path]) -> Optional[str]: + assert zipfile.is_zipfile(file_name), "[_extract_dashboard_slug_from_zip][PRE] file_name must be a valid zip file." try: import yaml with zipfile.ZipFile(file_name, "r") as zf: @@ -208,79 +262,111 @@ class SupersetClient: except Exception as exc: self.logger.error("[_extract_dashboard_slug_from_zip][Failure] %s", exc, exc_info=True) return None - # + # [/DEF:SupersetClient._extract_dashboard_slug_from_zip] - # - # @PURPOSE: Проверяет, что HTTP-ответ на экспорт является валидным ZIP-архивом. - # @INTERNAL - # @THROW: ExportError - Если ответ не является ZIP-архивом или пуст. + # [DEF:SupersetClient._validate_export_response:Function] + # @PURPOSE: Проверяет, что HTTP-ответ на экспорт является валидным ZIP-архивом. + # @PRE: response должен быть объектом requests.Response. + # @POST: Проверка пройдена, если ответ является непустым ZIP-архивом. + # @THROW: ExportError - Если ответ не является ZIP-архивом или пуст. + # @PARAM: response (Response) - HTTP ответ. + # @PARAM: dashboard_id (int) - ID дашборда. def _validate_export_response(self, response: Response, dashboard_id: int) -> None: + assert isinstance(response, Response), "[_validate_export_response][PRE] response must be a requests.Response object." content_type = response.headers.get("Content-Type", "") if "application/zip" not in content_type: raise ExportError(f"Получен не ZIP-архив (Content-Type: {content_type})") if not response.content: raise ExportError("Получены пустые данные при экспорте") - # + # [/DEF:SupersetClient._validate_export_response] - # - # @PURPOSE: Определяет имя файла для экспорта из заголовков или генерирует его. - # @INTERNAL + # [DEF:SupersetClient._resolve_export_filename:Function] + # @PURPOSE: Определяет имя файла для экспорта из заголовков или генерирует его. + # @PRE: response должен быть объектом requests.Response. + # @POST: Возвращает непустое имя файла. + # @PARAM: response (Response) - HTTP ответ. + # @PARAM: dashboard_id (int) - ID дашборда. + # @RETURN: str - Имя файла. def _resolve_export_filename(self, response: Response, dashboard_id: int) -> str: - filename = get_filename_from_headers(response.headers) + assert isinstance(response, Response), "[_resolve_export_filename][PRE] response must be a requests.Response object." + filename = get_filename_from_headers(dict(response.headers)) if not filename: from datetime import datetime timestamp = datetime.now().strftime("%Y%m%dT%H%M%S") filename = f"dashboard_export_{dashboard_id}_{timestamp}.zip" self.logger.warning("[_resolve_export_filename][Warning] Generated filename: %s", filename) return filename - # + # [/DEF:SupersetClient._resolve_export_filename] - # - # @PURPOSE: Формирует корректный набор параметров запроса с пагинацией. - # @INTERNAL + # [DEF:SupersetClient._validate_query_params:Function] + # @PURPOSE: Формирует корректный набор параметров запроса с пагинацией. + # @PARAM: query (Optional[Dict]) - Исходные параметры. + # @PRE: query, если предоставлен, должен быть словарем. + # @POST: Возвращает словарь, содержащий базовые параметры пагинации, объединенные с `query`. + # @RETURN: Dict - Валидированные параметры. def _validate_query_params(self, query: Optional[Dict]) -> Dict: + assert query is None or isinstance(query, dict), "[_validate_query_params][PRE] query must be a dictionary or None." base_query = {"columns": ["slug", "id", "changed_on_utc", "dashboard_title", "published"], "page": 0, "page_size": 1000} return {**base_query, **(query or {})} - # + # [/DEF:SupersetClient._validate_query_params] - # - # @PURPOSE: Получает общее количество объектов по указанному эндпоинту для пагинации. - # @INTERNAL + # [DEF:SupersetClient._fetch_total_object_count:Function] + # @PURPOSE: Получает общее количество объектов по указанному эндпоинту для пагинации. + # @PARAM: endpoint (str) - API эндпоинт. + # @PRE: endpoint должен быть непустой строкой. + # @POST: Возвращает общее количество объектов (>= 0). + # @THROW: APIError - В случае ошибки сетевого запроса. + # @RETURN: int - Количество объектов. def _fetch_total_object_count(self, endpoint: str) -> int: + assert endpoint and isinstance(endpoint, str), "[_fetch_total_object_count][PRE] endpoint must be a non-empty string." return self.network.fetch_paginated_count( endpoint=endpoint, query_params={"page": 0, "page_size": 1}, count_field="count", ) - # + # [/DEF:SupersetClient._fetch_total_object_count] - # - # @PURPOSE: Итерируется по всем страницам пагинированного API и собирает все данные. - # @INTERNAL + # [DEF:SupersetClient._fetch_all_pages:Function] + # @PURPOSE: Итерируется по всем страницам пагинированного API и собирает все данные. + # @PARAM: endpoint (str) - API эндпоинт. + # @PARAM: pagination_options (Dict) - Опции пагинации. + # @PRE: endpoint должен быть непустой строкой, pagination_options - словарем. + # @POST: Возвращает полный список объектов. + # @THROW: APIError - В случае ошибки сетевого запроса. + # @RETURN: List[Dict] - Список всех объектов. def _fetch_all_pages(self, endpoint: str, pagination_options: Dict) -> List[Dict]: + assert endpoint and isinstance(endpoint, str), "[_fetch_all_pages][PRE] endpoint must be a non-empty string." + assert isinstance(pagination_options, dict), "[_fetch_all_pages][PRE] pagination_options must be a dictionary." return self.network.fetch_paginated_data(endpoint=endpoint, pagination_options=pagination_options) - # + # [/DEF:SupersetClient._fetch_all_pages] - # - # @PURPOSE: Проверяет, что файл существует, является ZIP-архивом и содержит `metadata.yaml`. - # @INTERNAL - # @THROW: FileNotFoundError - Если файл не найден. - # @THROW: InvalidZipFormatError - Если файл не является ZIP или не содержит `metadata.yaml`. + # [DEF:SupersetClient._validate_import_file:Function] + # @PURPOSE: Проверяет, что файл существует, является ZIP-архивом и содержит `metadata.yaml`. + # @PRE: zip_path должен быть предоставлен. + # @POST: Проверка пройдена, если файл существует, является ZIP и содержит `metadata.yaml`. + # @THROW: FileNotFoundError - Если файл не найден. + # @THROW: InvalidZipFormatError - Если файл не является ZIP или не содержит `metadata.yaml`. + # @PARAM: zip_path (Union[str, Path]) - Путь к файлу. def _validate_import_file(self, zip_path: Union[str, Path]) -> None: + assert zip_path, "[_validate_import_file][PRE] zip_path must be provided." path = Path(zip_path) assert path.exists(), f"Файл {zip_path} не существует" assert zipfile.is_zipfile(path), f"Файл {zip_path} не является ZIP-архивом" with zipfile.ZipFile(path, "r") as zf: assert any(n.endswith("metadata.yaml") for n in zf.namelist()), f"Архив {zip_path} не содержит 'metadata.yaml'" - # + # [/DEF:SupersetClient._validate_import_file] - # - # @PURPOSE: Получает полный список датасетов, автоматически обрабатывая пагинацию. - # @PARAM: query: Optional[Dict] - Дополнительные параметры запроса для API. - # @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список датасетов). - # @RELATION: CALLS -> self._fetch_total_object_count - # @RELATION: CALLS -> self._fetch_all_pages + # [DEF:SupersetClient.get_datasets:Function] + # @PURPOSE: Получает полный список датасетов, автоматически обрабатывая пагинацию. + # @RELATION: CALLS -> self._fetch_total_object_count + # @RELATION: CALLS -> self._fetch_all_pages + # @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса. + # @PRE: self.network должен быть инициализирован. + # @POST: Возвращаемый список содержит все датасеты, доступные по API. + # @THROW: APIError - В случае ошибки сетевого запроса. + # @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список датасетов). def get_datasets(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]: + assert self.network, "[get_datasets][PRE] Network client must be initialized." self.logger.info("[get_datasets][Enter] Fetching datasets.") validated_query = self._validate_query_params(query) total_count = self._fetch_total_object_count(endpoint="/dataset/") @@ -290,27 +376,76 @@ class SupersetClient: ) self.logger.info("[get_datasets][Exit] Found %d datasets.", total_count) return total_count, paginated_data - # + # [/DEF:SupersetClient.get_datasets] - # - # @PURPOSE: Получает информацию о конкретном датасете по его ID. - # @PARAM: dataset_id: int - ID датасета. - # @RETURN: Dict - Словарь с информацией о датасете. - # @RELATION: CALLS -> self.network.request + # [DEF:SupersetClient.get_databases:Function] + # @PURPOSE: Получает полный список баз данных, автоматически обрабатывая пагинацию. + # @RELATION: CALLS -> self._fetch_total_object_count + # @RELATION: CALLS -> self._fetch_all_pages + # @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса. + # @PRE: self.network должен быть инициализирован. + # @POST: Возвращаемый список содержит все базы данных, доступные по API. + # @THROW: APIError - В случае ошибки сетевого запроса. + # @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список баз данных). + def get_databases(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]: + assert self.network, "[get_databases][PRE] Network client must be initialized." + self.logger.info("[get_databases][Enter] Fetching databases.") + validated_query = self._validate_query_params(query) + total_count = self._fetch_total_object_count(endpoint="/database/") + paginated_data = self._fetch_all_pages( + endpoint="/database/", + pagination_options={"base_query": validated_query, "total_count": total_count, "results_field": "result"}, + ) + self.logger.info("[get_databases][Exit] Found %d databases.", total_count) + return total_count, paginated_data + # [/DEF:SupersetClient.get_databases] + + # [DEF:SupersetClient.get_dataset:Function] + # @PURPOSE: Получает информацию о конкретном датасете по его ID. + # @RELATION: CALLS -> self.network.request + # @PARAM: dataset_id (int) - ID датасета. + # @PRE: dataset_id должен быть положительным целым числом. + # @POST: Возвращает словарь с информацией о датасете. + # @THROW: APIError - В случае ошибки сетевого запроса или если датасет не найден. + # @RETURN: Dict - Информация о датасете. def get_dataset(self, dataset_id: int) -> Dict: + assert isinstance(dataset_id, int) and dataset_id > 0, "[get_dataset][PRE] dataset_id must be a positive integer." self.logger.info("[get_dataset][Enter] Fetching dataset %s.", dataset_id) response = self.network.request(method="GET", endpoint=f"/dataset/{dataset_id}") + response = cast(Dict, response) self.logger.info("[get_dataset][Exit] Got dataset %s.", dataset_id) return response - # + # [/DEF:SupersetClient.get_dataset] - # - # @PURPOSE: Обновляет данные датасета по его ID. - # @PARAM: dataset_id: int - ID датасета для обновления. - # @PARAM: data: Dict - Словарь с данными для обновления. - # @RETURN: Dict - Ответ API. - # @RELATION: CALLS -> self.network.request + # [DEF:SupersetClient.get_database:Function] + # @PURPOSE: Получает информацию о конкретной базе данных по её ID. + # @RELATION: CALLS -> self.network.request + # @PARAM: database_id (int) - ID базы данных. + # @PRE: database_id должен быть положительным целым числом. + # @POST: Возвращает словарь с информацией о базе данных. + # @THROW: APIError - В случае ошибки сетевого запроса или если база данных не найдена. + # @RETURN: Dict - Информация о базе данных. + def get_database(self, database_id: int) -> Dict: + assert isinstance(database_id, int) and database_id > 0, "[get_database][PRE] database_id must be a positive integer." + self.logger.info("[get_database][Enter] Fetching database %s.", database_id) + response = self.network.request(method="GET", endpoint=f"/database/{database_id}") + response = cast(Dict, response) + self.logger.info("[get_database][Exit] Got database %s.", database_id) + return response + # [/DEF:SupersetClient.get_database] + + # [DEF:SupersetClient.update_dataset:Function] + # @PURPOSE: Обновляет данные датасета по его ID. + # @RELATION: CALLS -> self.network.request + # @PARAM: dataset_id (int) - ID датасета. + # @PARAM: data (Dict) - Данные для обновления. + # @PRE: dataset_id должен быть положительным целым числом, data - непустым словарем. + # @POST: Датасет успешно обновлен, возвращен ответ API. + # @THROW: APIError - В случае ошибки сетевого запроса. + # @RETURN: Dict - Ответ API. def update_dataset(self, dataset_id: int, data: Dict) -> Dict: + assert isinstance(dataset_id, int) and dataset_id > 0, "[update_dataset][PRE] dataset_id must be a positive integer." + assert isinstance(data, dict) and data, "[update_dataset][PRE] data must be a non-empty dictionary." self.logger.info("[update_dataset][Enter] Updating dataset %s.", dataset_id) response = self.network.request( method="PUT", @@ -318,12 +453,11 @@ class SupersetClient: data=json.dumps(data), headers={'Content-Type': 'application/json'} ) + response = cast(Dict, response) self.logger.info("[update_dataset][Exit] Updated dataset %s.", dataset_id) return response - # + # [/DEF:SupersetClient.update_dataset] -# +# [/DEF:SupersetClient] -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:superset_tool.client] diff --git a/superset_tool/exceptions.py b/superset_tool/exceptions.py index 5502d87..7fdece8 100644 --- a/superset_tool/exceptions.py +++ b/superset_tool/exceptions.py @@ -1,110 +1,128 @@ -# -# @SEMANTICS: exception, error, hierarchy -# @PURPOSE: Определяет иерархию пользовательских исключений для всего инструмента, обеспечивая единую точку обработки ошибок. -# @RELATION: ALL_CLASSES -> INHERITS_FROM -> SupersetToolError (or other exception in this module) +# [DEF:superset_tool.exceptions:Module] +# @PURPOSE: Определяет иерархию пользовательских исключений для всего инструмента, обеспечивая единую точку обработки ошибок. +# @SEMANTICS: exception, error, hierarchy +# @LAYER: Infra -# +# [SECTION: IMPORTS] from pathlib import Path from typing import Optional, Dict, Any, Union -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Базовый класс для всех ошибок, генерируемых инструментом. -# @INHERITS_FROM: Exception +# [DEF:SupersetToolError:Class] +# @PURPOSE: Базовый класс для всех ошибок, генерируемых инструментом. +# @RELATION: INHERITS_FROM -> Exception +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Optional[Dict[str, Any]]) - Дополнительный контекст ошибки. class SupersetToolError(Exception): def __init__(self, message: str, context: Optional[Dict[str, Any]] = None): self.context = context or {} super().__init__(f"{message} | Context: {self.context}") -# +# [/DEF:SupersetToolError] -# -# @PURPOSE: Ошибки, связанные с аутентификацией или авторизацией. -# @INHERITS_FROM: SupersetToolError +# [DEF:AuthenticationError:Class] +# @PURPOSE: Ошибки, связанные с аутентификацией или авторизацией. +# @RELATION: INHERITS_FROM -> SupersetToolError +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class AuthenticationError(SupersetToolError): def __init__(self, message: str = "Authentication failed", **context: Any): super().__init__(f"[AUTH_FAILURE] {message}", context={"type": "authentication", **context}) -# +# [/DEF:AuthenticationError] -# -# @PURPOSE: Ошибка, возникающая при отказе в доступе к ресурсу. -# @INHERITS_FROM: AuthenticationError +# [DEF:PermissionDeniedError:Class] +# @PURPOSE: Ошибка, возникающая при отказе в доступе к ресурсу. +# @RELATION: INHERITS_FROM -> AuthenticationError +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: required_permission (Optional[str]) - Требуемое разрешение. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class PermissionDeniedError(AuthenticationError): def __init__(self, message: str = "Permission denied", required_permission: Optional[str] = None, **context: Any): full_message = f"Permission denied: {required_permission}" if required_permission else message super().__init__(full_message, context={"required_permission": required_permission, **context}) -# +# [/DEF:PermissionDeniedError] -# -# @PURPOSE: Общие ошибки при взаимодействии с Superset API. -# @INHERITS_FROM: SupersetToolError +# [DEF:SupersetAPIError:Class] +# @PURPOSE: Общие ошибки при взаимодействии с Superset API. +# @RELATION: INHERITS_FROM -> SupersetToolError +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class SupersetAPIError(SupersetToolError): def __init__(self, message: str = "Superset API error", **context: Any): super().__init__(f"[API_FAILURE] {message}", context={"type": "api_call", **context}) -# +# [/DEF:SupersetAPIError] -# -# @PURPOSE: Ошибки, специфичные для операций экспорта. -# @INHERITS_FROM: SupersetAPIError +# [DEF:ExportError:Class] +# @PURPOSE: Ошибки, специфичные для операций экспорта. +# @RELATION: INHERITS_FROM -> SupersetAPIError +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class ExportError(SupersetAPIError): def __init__(self, message: str = "Dashboard export failed", **context: Any): super().__init__(f"[EXPORT_FAILURE] {message}", context={"subtype": "export", **context}) -# +# [/DEF:ExportError] -# -# @PURPOSE: Ошибка, когда запрошенный дашборд или ресурс не найден (404). -# @INHERITS_FROM: SupersetAPIError +# [DEF:DashboardNotFoundError:Class] +# @PURPOSE: Ошибка, когда запрошенный дашборд или ресурс не найден (404). +# @RELATION: INHERITS_FROM -> SupersetAPIError +# @PARAM: dashboard_id_or_slug (Union[int, str]) - ID или slug дашборда. +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class DashboardNotFoundError(SupersetAPIError): def __init__(self, dashboard_id_or_slug: Union[int, str], message: str = "Dashboard not found", **context: Any): super().__init__(f"[NOT_FOUND] Dashboard '{dashboard_id_or_slug}' {message}", context={"subtype": "not_found", "resource_id": dashboard_id_or_slug, **context}) -# +# [/DEF:DashboardNotFoundError] -# -# @PURPOSE: Ошибка, когда запрашиваемый набор данных не существует (404). -# @INHERITS_FROM: SupersetAPIError +# [DEF:DatasetNotFoundError:Class] +# @PURPOSE: Ошибка, когда запрашиваемый набор данных не существует (404). +# @RELATION: INHERITS_FROM -> SupersetAPIError +# @PARAM: dataset_id_or_slug (Union[int, str]) - ID или slug набора данных. +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class DatasetNotFoundError(SupersetAPIError): def __init__(self, dataset_id_or_slug: Union[int, str], message: str = "Dataset not found", **context: Any): super().__init__(f"[NOT_FOUND] Dataset '{dataset_id_or_slug}' {message}", context={"subtype": "not_found", "resource_id": dataset_id_or_slug, **context}) -# +# [/DEF:DatasetNotFoundError] -# -# @PURPOSE: Ошибка, указывающая на некорректный формат или содержимое ZIP-архива. -# @INHERITS_FROM: SupersetToolError +# [DEF:InvalidZipFormatError:Class] +# @PURPOSE: Ошибка, указывающая на некорректный формат или содержимое ZIP-архива. +# @RELATION: INHERITS_FROM -> SupersetToolError +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: file_path (Optional[Union[str, Path]]) - Путь к файлу. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class InvalidZipFormatError(SupersetToolError): def __init__(self, message: str = "Invalid ZIP format or content", file_path: Optional[Union[str, Path]] = None, **context: Any): super().__init__(f"[FILE_ERROR] {message}", context={"type": "file_validation", "file_path": str(file_path) if file_path else "N/A", **context}) -# +# [/DEF:InvalidZipFormatError] -# -# @PURPOSE: Ошибки, связанные с сетевым соединением. -# @INHERITS_FROM: SupersetToolError +# [DEF:NetworkError:Class] +# @PURPOSE: Ошибки, связанные с сетевым соединением. +# @RELATION: INHERITS_FROM -> SupersetToolError +# @PARAM: message (str) - Сообщение об ошибке. +# @PARAM: context (Any) - Дополнительный контекст ошибки. class NetworkError(SupersetToolError): def __init__(self, message: str = "Network connection failed", **context: Any): super().__init__(f"[NETWORK_FAILURE] {message}", context={"type": "network", **context}) -# +# [/DEF:NetworkError] -# -# @PURPOSE: Общие ошибки файловых операций (I/O). -# @INHERITS_FROM: SupersetToolError +# [DEF:FileOperationError:Class] +# @PURPOSE: Общие ошибки файловых операций (I/O). +# @RELATION: INHERITS_FROM -> SupersetToolError class FileOperationError(SupersetToolError): pass -# +# [/DEF:FileOperationError] -# -# @PURPOSE: Ошибка, указывающая на некорректную структуру файлов или директорий. -# @INHERITS_FROM: FileOperationError +# [DEF:InvalidFileStructureError:Class] +# @PURPOSE: Ошибка, указывающая на некорректную структуру файлов или директорий. +# @RELATION: INHERITS_FROM -> FileOperationError class InvalidFileStructureError(FileOperationError): pass -# +# [/DEF:InvalidFileStructureError] -# -# @PURPOSE: Ошибки, связанные с неверной конфигурацией инструмента. -# @INHERITS_FROM: SupersetToolError +# [DEF:ConfigurationError:Class] +# @PURPOSE: Ошибки, связанные с неверной конфигурацией инструмента. +# @RELATION: INHERITS_FROM -> SupersetToolError class ConfigurationError(SupersetToolError): pass -# +# [/DEF:ConfigurationError] -# --- Конец кода модуля --- - -# +# [/DEF:superset_tool.exceptions] \ No newline at end of file diff --git a/superset_tool/models.py b/superset_tool/models.py index 1ee832b..1ed2510 100644 --- a/superset_tool/models.py +++ b/superset_tool/models.py @@ -1,21 +1,22 @@ -# -# @SEMANTICS: pydantic, model, config, validation, data-structure -# @PURPOSE: Определяет Pydantic-модели для конфигурации инструмента, обеспечивая валидацию данных. -# @DEPENDS_ON: pydantic -> Для создания моделей и валидации. -# @DEPENDS_ON: superset_tool.utils.logger -> Для логирования в процессе валидации. +# [DEF:superset_tool.models:Module] +# +# @SEMANTICS: pydantic, model, config, validation, data-structure +# @PURPOSE: Определяет Pydantic-модели для конфигурации инструмента, обеспечивая валидацию данных. +# @LAYER: Infra +# @RELATION: DEPENDS_ON -> pydantic +# @RELATION: DEPENDS_ON -> superset_tool.utils.logger +# @PUBLIC_API: SupersetConfig, DatabaseConfig -# +# [SECTION: IMPORTS] import re from typing import Optional, Dict, Any from pydantic import BaseModel, validator, Field from .utils.logger import SupersetLogger -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Модель конфигурации для подключения к одному экземпляру Superset API. -# @INHERITS_FROM: pydantic.BaseModel +# [DEF:SupersetConfig:Class] +# @PURPOSE: Модель конфигурации для подключения к одному экземпляру Superset API. +# @RELATION: INHERITS_FROM -> pydantic.BaseModel class SupersetConfig(BaseModel): env: str = Field(..., description="Название окружения (например, dev, prod).") base_url: str = Field(..., description="Базовый URL Superset API, включая /api/v1.") @@ -24,59 +25,60 @@ class SupersetConfig(BaseModel): timeout: int = Field(30, description="Таймаут в секундах для HTTP-запросов.") logger: Optional[SupersetLogger] = Field(None, description="Экземпляр логгера для логирования.") - # - # @PURPOSE: Проверяет, что словарь `auth` содержит все необходимые для аутентификации поля. - # @PRE: `v` должен быть словарем. - # @POST: Возвращает `v`, если все обязательные поля (`provider`, `username`, `password`, `refresh`) присутствуют. - # @THROW: ValueError - Если отсутствуют обязательные поля. + # [DEF:SupersetConfig.validate_auth:Function] + # @PURPOSE: Проверяет, что словарь `auth` содержит все необходимые для аутентификации поля. + # @PRE: `v` должен быть словарем. + # @POST: Возвращает `v`, если все обязательные поля (`provider`, `username`, `password`, `refresh`) присутствуют. + # @THROW: ValueError - Если отсутствуют обязательные поля. + # @PARAM: v (Dict[str, str]) - Значение поля auth. @validator('auth') def validate_auth(cls, v: Dict[str, str]) -> Dict[str, str]: required = {'provider', 'username', 'password', 'refresh'} if not required.issubset(v.keys()): raise ValueError(f"Словарь 'auth' должен содержать поля: {required}. Отсутствующие: {required - v.keys()}") return v - # + # [/DEF:SupersetConfig.validate_auth] - # - # @PURPOSE: Проверяет, что `base_url` соответствует формату URL и содержит `/api/v1`. - # @PRE: `v` должна быть строкой. - # @POST: Возвращает очищенный `v`, если формат корректен. - # @THROW: ValueError - Если формат URL невалиден. + # [DEF:SupersetConfig.check_base_url_format:Function] + # @PURPOSE: Проверяет, что `base_url` соответствует формату URL и содержит `/api/v1`. + # @PRE: `v` должна быть строкой. + # @POST: Возвращает очищенный `v`, если формат корректен. + # @THROW: ValueError - Если формат URL невалиден. + # @PARAM: v (str) - Значение поля base_url. @validator('base_url') def check_base_url_format(cls, v: str) -> str: v = v.strip() if not re.fullmatch(r'https?://.+/api/v1/?(?:.*)?', v): raise ValueError(f"Invalid URL format: {v}. Must include '/api/v1'.") return v - # + # [/DEF:SupersetConfig.check_base_url_format] class Config: arbitrary_types_allowed = True -# +# [/DEF:SupersetConfig] -# -# @PURPOSE: Модель для параметров трансформации баз данных при миграции дашбордов. -# @INHERITS_FROM: pydantic.BaseModel +# [DEF:DatabaseConfig:Class] +# @PURPOSE: Модель для параметров трансформации баз данных при миграции дашбордов. +# @RELATION: INHERITS_FROM -> pydantic.BaseModel class DatabaseConfig(BaseModel): database_config: Dict[str, Dict[str, Any]] = Field(..., description="Словарь, содержащий 'old' и 'new' конфигурации базы данных.") logger: Optional[SupersetLogger] = Field(None, description="Экземпляр логгера для логирования.") - # - # @PURPOSE: Проверяет, что словарь `database_config` содержит ключи 'old' и 'new'. - # @PRE: `v` должен быть словарем. - # @POST: Возвращает `v`, если ключи 'old' и 'new' присутствуют. - # @THROW: ValueError - Если отсутствуют обязательные ключи. + # [DEF:DatabaseConfig.validate_config:Function] + # @PURPOSE: Проверяет, что словарь `database_config` содержит ключи 'old' и 'new'. + # @PRE: `v` должен быть словарем. + # @POST: Возвращает `v`, если ключи 'old' и 'new' присутствуют. + # @THROW: ValueError - Если отсутствуют обязательные ключи. + # @PARAM: v (Dict[str, Dict[str, Any]]) - Значение поля database_config. @validator('database_config') def validate_config(cls, v: Dict[str, Dict[str, Any]]) -> Dict[str, Dict[str, Any]]: if not {'old', 'new'}.issubset(v.keys()): raise ValueError("'database_config' должен содержать ключи 'old' и 'new'.") return v - # + # [/DEF:DatabaseConfig.validate_config] class Config: arbitrary_types_allowed = True -# +# [/DEF:DatabaseConfig] -# --- Конец кода модуля --- - -# +# [/DEF:superset_tool.models] diff --git a/superset_tool/utils/__init__.py b/superset_tool/utils/__init__.py new file mode 100644 index 0000000..ab99c65 --- /dev/null +++ b/superset_tool/utils/__init__.py @@ -0,0 +1,5 @@ +# [DEF:superset_tool.utils:Module] +# @SEMANTICS: package, utils +# @PURPOSE: Utility package for superset_tool. +# @LAYER: Infra +# [/DEF:superset_tool.utils] diff --git a/superset_tool/utils/dataset_mapper.py b/superset_tool/utils/dataset_mapper.py index 44f9311..8ab180d 100644 --- a/superset_tool/utils/dataset_mapper.py +++ b/superset_tool/utils/dataset_mapper.py @@ -1,37 +1,38 @@ -# -# @SEMANTICS: dataset, mapping, postgresql, xlsx, superset -# @PURPOSE: Этот модуль отвечает за обновление метаданных (verbose_map) в датасетах Superset, извлекая их из PostgreSQL или XLSX-файлов. -# @DEPENDS_ON: superset_tool.client -> Использует SupersetClient для взаимодействия с API. -# @DEPENDS_ON: pandas -> для чтения XLSX-файлов. -# @DEPENDS_ON: psycopg2 -> для подключения к PostgreSQL. - -# -import pandas as pd -import psycopg2 +# [DEF:superset_tool.utils.dataset_mapper:Module] +# +# @SEMANTICS: dataset, mapping, postgresql, xlsx, superset +# @PURPOSE: Этот модуль отвечает за обновление метаданных (verbose_map) в датасетах Superset, извлекая их из PostgreSQL или XLSX-файлов. +# @LAYER: Domain +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> pandas +# @RELATION: DEPENDS_ON -> psycopg2 +# @PUBLIC_API: DatasetMapper + +# [SECTION: IMPORTS] +import pandas as pd # type: ignore +import psycopg2 # type: ignore from superset_tool.client import SupersetClient from superset_tool.utils.init_clients import setup_clients from superset_tool.utils.logger import SupersetLogger from typing import Dict, List, Optional, Any -# - -# --- Начало кода модуля --- - -# -# @PURPOSE: Класс для меппинга и обновления verbose_map в датасетах Superset. +# [/SECTION] + +# [DEF:DatasetMapper:Class] +# @PURPOSE: Класс для меппинга и обновления verbose_map в датасетах Superset. class DatasetMapper: def __init__(self, logger: SupersetLogger): self.logger = logger - - # - # @PURPOSE: Извлекает комментарии к колонкам из системного каталога PostgreSQL. - # @PRE: `db_config` должен содержать валидные креды для подключения к PostgreSQL. - # @PRE: `table_name` и `table_schema` должны быть строками. - # @POST: Возвращается словарь с меппингом `column_name` -> `column_comment`. - # @PARAM: db_config: Dict - Конфигурация для подключения к БД. - # @PARAM: table_name: str - Имя таблицы. - # @PARAM: table_schema: str - Схема таблицы. - # @RETURN: Dict[str, str] - Словарь с комментариями к колонкам. - # @THROW: Exception - При ошибках подключения или выполнения запроса к БД. + + # [DEF:DatasetMapper.get_postgres_comments:Function] + # @PURPOSE: Извлекает комментарии к колонкам из системного каталога PostgreSQL. + # @PRE: `db_config` должен содержать валидные креды для подключения к PostgreSQL. + # @PRE: `table_name` и `table_schema` должны быть строками. + # @POST: Возвращается словарь с меппингом `column_name` -> `column_comment`. + # @THROW: Exception - При ошибках подключения или выполнения запроса к БД. + # @PARAM: db_config (Dict) - Конфигурация для подключения к БД. + # @PARAM: table_name (str) - Имя таблицы. + # @PARAM: table_schema (str) - Схема таблицы. + # @RETURN: Dict[str, str] - Словарь с комментариями к колонкам. def get_postgres_comments(self, db_config: Dict, table_name: str, table_schema: str) -> Dict[str, str]: self.logger.info("[get_postgres_comments][Enter] Fetching comments from PostgreSQL for %s.%s.", table_schema, table_name) query = f""" @@ -84,15 +85,15 @@ class DatasetMapper: self.logger.error("[get_postgres_comments][Failure] %s", e, exc_info=True) raise return comments - # - - # - # @PURPOSE: Загружает меппинги 'column_name' -> 'column_comment' из XLSX файла. - # @PRE: `file_path` должен быть валидным путем к XLSX файлу с колонками 'column_name' и 'column_comment'. - # @POST: Возвращается словарь с меппингами. - # @PARAM: file_path: str - Путь к XLSX файлу. - # @RETURN: Dict[str, str] - Словарь с меппингами. - # @THROW: Exception - При ошибках чтения файла или парсинга. + # [/DEF:DatasetMapper.get_postgres_comments] + + # [DEF:DatasetMapper.load_excel_mappings:Function] + # @PURPOSE: Загружает меппинги 'column_name' -> 'column_comment' из XLSX файла. + # @PRE: `file_path` должен быть валидным путем к XLSX файлу с колонками 'column_name' и 'column_comment'. + # @POST: Возвращается словарь с меппингами. + # @THROW: Exception - При ошибках чтения файла или парсинга. + # @PARAM: file_path (str) - Путь к XLSX файлу. + # @RETURN: Dict[str, str] - Словарь с меппингами. def load_excel_mappings(self, file_path: str) -> Dict[str, str]: self.logger.info("[load_excel_mappings][Enter] Loading mappings from %s.", file_path) try: @@ -103,21 +104,21 @@ class DatasetMapper: except Exception as e: self.logger.error("[load_excel_mappings][Failure] %s", e, exc_info=True) raise - # - - # - # @PURPOSE: Основная функция для выполнения меппинга и обновления verbose_map датасета в Superset. - # @PARAM: superset_client: SupersetClient - Клиент Superset. - # @PARAM: dataset_id: int - ID датасета для обновления. - # @PARAM: source: str - Источник данных ('postgres', 'excel', 'both'). - # @PARAM: postgres_config: Optional[Dict] - Конфигурация для подключения к PostgreSQL. - # @PARAM: excel_path: Optional[str] - Путь к XLSX файлу. - # @PARAM: table_name: Optional[str] - Имя таблицы в PostgreSQL. - # @PARAM: table_schema: Optional[str] - Схема таблицы в PostgreSQL. - # @RELATION: CALLS -> self.get_postgres_comments - # @RELATION: CALLS -> self.load_excel_mappings - # @RELATION: CALLS -> superset_client.get_dataset - # @RELATION: CALLS -> superset_client.update_dataset + # [/DEF:DatasetMapper.load_excel_mappings] + + # [DEF:DatasetMapper.run_mapping:Function] + # @PURPOSE: Основная функция для выполнения меппинга и обновления verbose_map датасета в Superset. + # @RELATION: CALLS -> self.get_postgres_comments + # @RELATION: CALLS -> self.load_excel_mappings + # @RELATION: CALLS -> superset_client.get_dataset + # @RELATION: CALLS -> superset_client.update_dataset + # @PARAM: superset_client (SupersetClient) - Клиент Superset. + # @PARAM: dataset_id (int) - ID датасета для обновления. + # @PARAM: source (str) - Источник данных ('postgres', 'excel', 'both'). + # @PARAM: postgres_config (Optional[Dict]) - Конфигурация для подключения к PostgreSQL. + # @PARAM: excel_path (Optional[str]) - Путь к XLSX файлу. + # @PARAM: table_name (Optional[str]) - Имя таблицы в PostgreSQL. + # @PARAM: table_schema (Optional[str]) - Схема таблицы в PostgreSQL. def run_mapping(self, superset_client: SupersetClient, dataset_id: int, source: str, postgres_config: Optional[Dict] = None, excel_path: Optional[str] = None, table_name: Optional[str] = None, table_schema: Optional[str] = None): self.logger.info("[run_mapping][Enter] Starting dataset mapping for ID %d from source '%s'.", dataset_id, source) mappings: Dict[str, str] = {} @@ -132,14 +133,14 @@ class DatasetMapper: if source not in ['postgres', 'excel', 'both']: self.logger.error("[run_mapping][Failure] Invalid source: %s.", source) return - + dataset_response = superset_client.get_dataset(dataset_id) dataset_data = dataset_response['result'] original_columns = dataset_data.get('columns', []) updated_columns = [] changes_made = False - + for column in original_columns: col_name = column.get('column_name') @@ -161,7 +162,7 @@ class DatasetMapper: } new_column = {k: v for k, v in new_column.items() if v is not None} - + if col_name in mappings: mapping_value = mappings[col_name] if isinstance(mapping_value, str) and new_column.get('verbose_name') != mapping_value: @@ -169,7 +170,7 @@ class DatasetMapper: changes_made = True updated_columns.append(new_column) - + updated_metrics = [] for metric in dataset_data.get("metrics", []): new_metric = { @@ -186,7 +187,7 @@ class DatasetMapper: "uuid": metric.get("uuid"), } updated_metrics.append({k: v for k, v in new_metric.items() if v is not None}) - + if changes_made: payload_for_update = { "database_id": dataset_data.get("database", {}).get("id"), @@ -213,18 +214,16 @@ class DatasetMapper: } payload_for_update = {k: v for k, v in payload_for_update.items() if v is not None} - + superset_client.update_dataset(dataset_id, payload_for_update) self.logger.info("[run_mapping][Success] Dataset %d columns' verbose_name updated.", dataset_id) else: self.logger.info("[run_mapping][State] No changes in columns' verbose_name, skipping update.") - + except (AssertionError, FileNotFoundError, Exception) as e: self.logger.error("[run_mapping][Failure] %s", e, exc_info=True) return - # -# - -# --- Конец кода модуля --- - -# \ No newline at end of file + # [/DEF:DatasetMapper.run_mapping] +# [/DEF:DatasetMapper] + +# [/DEF:superset_tool.utils.dataset_mapper] diff --git a/superset_tool/utils/fileio.py b/superset_tool/utils/fileio.py index 4ba3fbf..75705c0 100644 --- a/superset_tool/utils/fileio.py +++ b/superset_tool/utils/fileio.py @@ -1,16 +1,19 @@ -# -# @SEMANTICS: file, io, zip, yaml, temp, archive, utility -# @PURPOSE: Предоставляет набор утилит для управления файловыми операциями, включая работу с временными файлами, архивами ZIP, файлами YAML и очистку директорий. -# @DEPENDS_ON: superset_tool.exceptions -> Для генерации специфичных ошибок. -# @DEPENDS_ON: superset_tool.utils.logger -> Для логирования операций. -# @DEPENDS_ON: pyyaml -> Для работы с YAML файлами. +# [DEF:superset_tool.utils.fileio:Module] +# +# @SEMANTICS: file, io, zip, yaml, temp, archive, utility +# @PURPOSE: Предоставляет набор утилит для управления файловыми операциями, включая работу с временными файлами, архивами ZIP, файлами YAML и очистку директорий. +# @LAYER: Infra +# @RELATION: DEPENDS_ON -> superset_tool.exceptions +# @RELATION: DEPENDS_ON -> superset_tool.utils.logger +# @RELATION: DEPENDS_ON -> pyyaml +# @PUBLIC_API: create_temp_file, remove_empty_directories, read_dashboard_from_disk, calculate_crc32, RetentionPolicy, archive_exports, save_and_unpack_dashboard, update_yamls, create_dashboard_export, sanitize_filename, get_filename_from_headers, consolidate_archive_folders -# +# [SECTION: IMPORTS] import os import re import zipfile from pathlib import Path -from typing import Any, Optional, Tuple, Dict, List, Union, LiteralString +from typing import Any, Optional, Tuple, Dict, List, Union, LiteralString, Generator from contextlib import contextmanager import tempfile from datetime import date, datetime @@ -21,20 +24,18 @@ from dataclasses import dataclass import yaml from superset_tool.exceptions import InvalidZipFormatError from superset_tool.utils.logger import SupersetLogger -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Контекстный менеджер для создания временного файла или директории с гарантированным удалением. -# @PARAM: content: Optional[bytes] - Бинарное содержимое для записи во временный файл. -# @PARAM: suffix: str - Суффикс ресурса. Если `.dir`, создается директория. -# @PARAM: mode: str - Режим записи в файл (e.g., 'wb'). -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @YIELDS: Path - Путь к временному ресурсу. -# @THROW: IOError - При ошибках создания ресурса. +# [DEF:create_temp_file:Function] +# @PURPOSE: Контекстный менеджер для создания временного файла или директории с гарантированным удалением. +# @PARAM: content (Optional[bytes]) - Бинарное содержимое для записи во временный файл. +# @PARAM: suffix (str) - Суффикс ресурса. Если `.dir`, создается директория. +# @PARAM: mode (str) - Режим записи в файл (e.g., 'wb'). +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. +# @YIELDS: Path - Путь к временному ресурсу. +# @THROW: IOError - При ошибках создания ресурса. @contextmanager -def create_temp_file(content: Optional[bytes] = None, suffix: str = ".zip", mode: str = 'wb', logger: Optional[SupersetLogger] = None) -> Path: +def create_temp_file(content: Optional[bytes] = None, suffix: str = ".zip", mode: str = 'wb', logger: Optional[SupersetLogger] = None) -> Generator[Path, None, None]: logger = logger or SupersetLogger(name="fileio") resource_path = None is_dir = suffix.startswith('.dir') @@ -63,13 +64,13 @@ def create_temp_file(content: Optional[bytes] = None, suffix: str = ".zip", mode logger.debug("[create_temp_file][Cleanup] Removed temporary file: %s", resource_path) except OSError as e: logger.error("[create_temp_file][Failure] Error during cleanup of %s: %s", resource_path, e) -# +# [/DEF:create_temp_file] -# -# @PURPOSE: Рекурсивно удаляет все пустые поддиректории, начиная с указанного пути. -# @PARAM: root_dir: str - Путь к корневой директории для очистки. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @RETURN: int - Количество удаленных директорий. +# [DEF:remove_empty_directories:Function] +# @PURPOSE: Рекурсивно удаляет все пустые поддиректории, начиная с указанного пути. +# @PARAM: root_dir (str) - Путь к корневой директории для очистки. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. +# @RETURN: int - Количество удаленных директорий. def remove_empty_directories(root_dir: str, logger: Optional[SupersetLogger] = None) -> int: logger = logger or SupersetLogger(name="fileio") logger.info("[remove_empty_directories][Enter] Starting cleanup of empty directories in %s", root_dir) @@ -87,14 +88,14 @@ def remove_empty_directories(root_dir: str, logger: Optional[SupersetLogger] = N logger.error("[remove_empty_directories][Failure] Failed to remove %s: %s", current_dir, e) logger.info("[remove_empty_directories][Exit] Removed %d empty directories.", removed_count) return removed_count -# +# [/DEF:remove_empty_directories] -# -# @PURPOSE: Читает бинарное содержимое файла с диска. -# @PARAM: file_path: str - Путь к файлу. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @RETURN: Tuple[bytes, str] - Кортеж (содержимое, имя файла). -# @THROW: FileNotFoundError - Если файл не найден. +# [DEF:read_dashboard_from_disk:Function] +# @PURPOSE: Читает бинарное содержимое файла с диска. +# @PARAM: file_path (str) - Путь к файлу. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. +# @RETURN: Tuple[bytes, str] - Кортеж (содержимое, имя файла). +# @THROW: FileNotFoundError - Если файл не найден. def read_dashboard_from_disk(file_path: str, logger: Optional[SupersetLogger] = None) -> Tuple[bytes, str]: logger = logger or SupersetLogger(name="fileio") path = Path(file_path) @@ -104,36 +105,36 @@ def read_dashboard_from_disk(file_path: str, logger: Optional[SupersetLogger] = if not content: logger.warning("[read_dashboard_from_disk][Warning] File is empty: %s", file_path) return content, path.name -# +# [/DEF:read_dashboard_from_disk] -# -# @PURPOSE: Вычисляет контрольную сумму CRC32 для файла. -# @PARAM: file_path: Path - Путь к файлу. -# @RETURN: str - 8-значное шестнадцатеричное представление CRC32. -# @THROW: IOError - При ошибках чтения файла. +# [DEF:calculate_crc32:Function] +# @PURPOSE: Вычисляет контрольную сумму CRC32 для файла. +# @PARAM: file_path (Path) - Путь к файлу. +# @RETURN: str - 8-значное шестнадцатеричное представление CRC32. +# @THROW: IOError - При ошибках чтения файла. def calculate_crc32(file_path: Path) -> str: with open(file_path, 'rb') as f: crc32_value = zlib.crc32(f.read()) return f"{crc32_value:08x}" -# +# [/DEF:calculate_crc32] -# -# @PURPOSE: Определяет политику хранения для архивов (ежедневные, еженедельные, ежемесячные). +# [DEF:RetentionPolicy:DataClass] +# @PURPOSE: Определяет политику хранения для архивов (ежедневные, еженедельные, ежемесячные). @dataclass class RetentionPolicy: daily: int = 7 weekly: int = 4 monthly: int = 12 -# +# [/DEF:RetentionPolicy] -# -# @PURPOSE: Управляет архивом экспортированных файлов, применяя политику хранения и дедупликацию. -# @PARAM: output_dir: str - Директория с архивами. -# @PARAM: policy: RetentionPolicy - Политика хранения. -# @PARAM: deduplicate: bool - Флаг для включения удаления дубликатов по CRC32. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @RELATION: CALLS -> apply_retention_policy -# @RELATION: CALLS -> calculate_crc32 +# [DEF:archive_exports:Function] +# @PURPOSE: Управляет архивом экспортированных файлов, применяя политику хранения и дедупликацию. +# @RELATION: CALLS -> apply_retention_policy +# @RELATION: CALLS -> calculate_crc32 +# @PARAM: output_dir (str) - Директория с архивами. +# @PARAM: policy (RetentionPolicy) - Политика хранения. +# @PARAM: deduplicate (bool) - Флаг для включения удаления дубликатов по CRC32. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. def archive_exports(output_dir: str, policy: RetentionPolicy, deduplicate: bool = False, logger: Optional[SupersetLogger] = None) -> None: logger = logger or SupersetLogger(name="fileio") output_path = Path(output_dir) @@ -142,16 +143,78 @@ def archive_exports(output_dir: str, policy: RetentionPolicy, deduplicate: bool return logger.info("[archive_exports][Enter] Managing archive in %s", output_dir) - # ... (логика дедупликации и политики хранения) ... -# + + # 1. Collect all zip files + zip_files = list(output_path.glob("*.zip")) + if not zip_files: + logger.info("[archive_exports][State] No zip files found in %s", output_dir) + return -# -# @PURPOSE: (Helper) Применяет политику хранения к списку файлов, возвращая те, что нужно сохранить. -# @INTERNAL -# @PARAM: files_with_dates: List[Tuple[Path, date]] - Список файлов с датами. -# @PARAM: policy: RetentionPolicy - Политика хранения. -# @PARAM: logger: SupersetLogger - Логгер. -# @RETURN: set - Множество путей к файлам, которые должны быть сохранены. + # 2. Deduplication + if deduplicate: + logger.info("[archive_exports][State] Starting deduplication...") + checksums = {} + files_to_remove = [] + + # Sort by modification time (newest first) to keep the latest version + zip_files.sort(key=lambda f: f.stat().st_mtime, reverse=True) + + for file_path in zip_files: + try: + crc = calculate_crc32(file_path) + if crc in checksums: + files_to_remove.append(file_path) + logger.debug("[archive_exports][State] Duplicate found: %s (same as %s)", file_path.name, checksums[crc].name) + else: + checksums[crc] = file_path + except Exception as e: + logger.error("[archive_exports][Failure] Failed to calculate CRC32 for %s: %s", file_path, e) + + for f in files_to_remove: + try: + f.unlink() + zip_files.remove(f) + logger.info("[archive_exports][State] Removed duplicate: %s", f.name) + except OSError as e: + logger.error("[archive_exports][Failure] Failed to remove duplicate %s: %s", f, e) + + # 3. Retention Policy + files_with_dates = [] + for file_path in zip_files: + # Try to extract date from filename + # Pattern: ..._YYYYMMDD_HHMMSS.zip or ..._YYYYMMDD.zip + match = re.search(r'_(\d{8})_', file_path.name) + file_date = None + if match: + try: + date_str = match.group(1) + file_date = datetime.strptime(date_str, "%Y%m%d").date() + except ValueError: + pass + + if not file_date: + # Fallback to modification time + file_date = datetime.fromtimestamp(file_path.stat().st_mtime).date() + + files_with_dates.append((file_path, file_date)) + + files_to_keep = apply_retention_policy(files_with_dates, policy, logger) + + for file_path, _ in files_with_dates: + if file_path not in files_to_keep: + try: + file_path.unlink() + logger.info("[archive_exports][State] Removed by retention policy: %s", file_path.name) + except OSError as e: + logger.error("[archive_exports][Failure] Failed to remove %s: %s", file_path, e) +# [/DEF:archive_exports] + +# [DEF:apply_retention_policy:Function] +# @PURPOSE: (Helper) Применяет политику хранения к списку файлов, возвращая те, что нужно сохранить. +# @PARAM: files_with_dates (List[Tuple[Path, date]]) - Список файлов с датами. +# @PARAM: policy (RetentionPolicy) - Политика хранения. +# @PARAM: logger (SupersetLogger) - Логгер. +# @RETURN: set - Множество путей к файлам, которые должны быть сохранены. def apply_retention_policy(files_with_dates: List[Tuple[Path, date]], policy: RetentionPolicy, logger: SupersetLogger) -> set: # Сортируем по дате (от новой к старой) sorted_files = sorted(files_with_dates, key=lambda x: x[1], reverse=True) @@ -177,17 +240,17 @@ def apply_retention_policy(files_with_dates: List[Tuple[Path, date]], policy: Re files_to_keep.update(monthly_files[:policy.monthly]) logger.debug("[apply_retention_policy][State] Keeping %d files according to retention policy", len(files_to_keep)) return files_to_keep -# +# [/DEF:apply_retention_policy] -# -# @PURPOSE: Сохраняет бинарное содержимое ZIP-архива на диск и опционально распаковывает его. -# @PARAM: zip_content: bytes - Содержимое ZIP-архива. -# @PARAM: output_dir: Union[str, Path] - Директория для сохранения. -# @PARAM: unpack: bool - Флаг, нужно ли распаковывать архив. -# @PARAM: original_filename: Optional[str] - Исходное имя файла для сохранения. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @RETURN: Tuple[Path, Optional[Path]] - Путь к ZIP-файлу и, если применимо, путь к директории с распаковкой. -# @THROW: InvalidZipFormatError - При ошибке формата ZIP. +# [DEF:save_and_unpack_dashboard:Function] +# @PURPOSE: Сохраняет бинарное содержимое ZIP-архива на диск и опционально распаковывает его. +# @PARAM: zip_content (bytes) - Содержимое ZIP-архива. +# @PARAM: output_dir (Union[str, Path]) - Директория для сохранения. +# @PARAM: unpack (bool) - Флаг, нужно ли распаковывать архив. +# @PARAM: original_filename (Optional[str]) - Исходное имя файла для сохранения. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. +# @RETURN: Tuple[Path, Optional[Path]] - Путь к ZIP-файлу и, если применимо, путь к директории с распаковкой. +# @THROW: InvalidZipFormatError - При ошибке формата ZIP. def save_and_unpack_dashboard(zip_content: bytes, output_dir: Union[str, Path], unpack: bool = False, original_filename: Optional[str] = None, logger: Optional[SupersetLogger] = None) -> Tuple[Path, Optional[Path]]: logger = logger or SupersetLogger(name="fileio") logger.info("[save_and_unpack_dashboard][Enter] Processing dashboard. Unpack: %s", unpack) @@ -207,17 +270,17 @@ def save_and_unpack_dashboard(zip_content: bytes, output_dir: Union[str, Path], except zipfile.BadZipFile as e: logger.error("[save_and_unpack_dashboard][Failure] Invalid ZIP archive: %s", e) raise InvalidZipFormatError(f"Invalid ZIP file: {e}") from e -# +# [/DEF:save_and_unpack_dashboard] -# -# @PURPOSE: Обновляет конфигурации в YAML-файлах, заменяя значения или применяя regex. -# @PARAM: db_configs: Optional[List[Dict]] - Список конфигураций для замены. -# @PARAM: path: str - Путь к директории с YAML файлами. -# @PARAM: regexp_pattern: Optional[LiteralString] - Паттерн для поиска. -# @PARAM: replace_string: Optional[LiteralString] - Строка для замены. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @THROW: FileNotFoundError - Если `path` не существует. -# @RELATION: CALLS -> _update_yaml_file +# [DEF:update_yamls:Function] +# @PURPOSE: Обновляет конфигурации в YAML-файлах, заменяя значения или применяя regex. +# @RELATION: CALLS -> _update_yaml_file +# @THROW: FileNotFoundError - Если `path` не существует. +# @PARAM: db_configs (Optional[List[Dict]]) - Список конфигураций для замены. +# @PARAM: path (str) - Путь к директории с YAML файлами. +# @PARAM: regexp_pattern (Optional[LiteralString]) - Паттерн для поиска. +# @PARAM: replace_string (Optional[LiteralString]) - Строка для замены. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. def update_yamls(db_configs: Optional[List[Dict]] = None, path: str = "dashboards", regexp_pattern: Optional[LiteralString] = None, replace_string: Optional[LiteralString] = None, logger: Optional[SupersetLogger] = None) -> None: logger = logger or SupersetLogger(name="fileio") logger.info("[update_yamls][Enter] Starting YAML configuration update.") @@ -228,57 +291,64 @@ def update_yamls(db_configs: Optional[List[Dict]] = None, path: str = "dashboard for file_path in dir_path.rglob("*.yaml"): _update_yaml_file(file_path, configs, regexp_pattern, replace_string, logger) -# +# [/DEF:update_yamls] -# -# @PURPOSE: (Helper) Обновляет один YAML файл. -# @INTERNAL -def _update_yaml_file(file_path: Path, db_configs: List[Dict], regexp_pattern: Optional[str], replace_string: Optional[str], logger: SupersetLogger) -> None: - # Читаем содержимое файла - try: - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - except Exception as e: - logger.error("[_update_yaml_file][Failure] Failed to read %s: %s", file_path, e) - return - # Если задан pattern и replace_string, применяем замену по регулярному выражению - if regexp_pattern and replace_string: - try: - new_content = re.sub(regexp_pattern, replace_string, content) - if new_content != content: - with open(file_path, 'w', encoding='utf-8') as f: - f.write(new_content) - logger.info("[_update_yaml_file][State] Updated %s using regex pattern", file_path) - except Exception as e: - logger.error("[_update_yaml_file][Failure] Error applying regex to %s: %s", file_path, e) - # Если заданы конфигурации, заменяем значения - if db_configs: - try: - parsed_data = yaml.safe_load(content) - if not isinstance(parsed_data, dict): - logger.warning("[_update_yaml_file][Warning] YAML content is not a dictionary in %s", file_path) - return - # Обновляем данные - for config in db_configs: - for key, value in config.items(): - if key in parsed_data: - old_value = parsed_data[key] - parsed_data[key] = value - logger.info("[_update_yaml_file][State] Changed %s.%s from %s to %s", file_path, key, old_value, value) - # Записываем обратно - with open(file_path, 'w', encoding='utf-8') as f: - yaml.dump(parsed_data, f, default_flow_style=False, allow_unicode=True) - except Exception as e: - logger.error("[_update_yaml_file][Failure] Error updating YAML in %s: %s", file_path, e) -# +# [DEF:_update_yaml_file:Function] +# @PURPOSE: (Helper) Обновляет один YAML файл. +# @PARAM: file_path (Path) - Путь к файлу. +# @PARAM: db_configs (List[Dict]) - Конфигурации. +# @PARAM: regexp_pattern (Optional[str]) - Паттерн. +# @PARAM: replace_string (Optional[str]) - Замена. +# @PARAM: logger (SupersetLogger) - Логгер. +def _update_yaml_file(file_path: Path, db_configs: List[Dict], regexp_pattern: Optional[str], replace_string: Optional[str], logger: SupersetLogger) -> None: + # Читаем содержимое файла + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + except Exception as e: + logger.error("[_update_yaml_file][Failure] Failed to read %s: %s", file_path, e) + return + # Если задан pattern и replace_string, применяем замену по регулярному выражению + if regexp_pattern and replace_string: + try: + new_content = re.sub(regexp_pattern, replace_string, content) + if new_content != content: + with open(file_path, 'w', encoding='utf-8') as f: + f.write(new_content) + logger.info("[_update_yaml_file][State] Updated %s using regex pattern", file_path) + except Exception as e: + logger.error("[_update_yaml_file][Failure] Error applying regex to %s: %s", file_path, e) + # Если заданы конфигурации, заменяем значения (поддержка old/new) + if db_configs: + try: + # Прямой текстовый заменитель для старых/новых значений, чтобы сохранить структуру файла + modified_content = content + for cfg in db_configs: + # Ожидаем структуру: {'old': {...}, 'new': {...}} + old_cfg = cfg.get('old', {}) + new_cfg = cfg.get('new', {}) + for key, old_val in old_cfg.items(): + if key in new_cfg: + new_val = new_cfg[key] + # Заменяем только точные совпадения старого значения в тексте YAML + if isinstance(old_val, str): + escaped_old = re.escape(old_val) + modified_content = re.sub(escaped_old, new_val, modified_content) + logger.info("[_update_yaml_file][State] Replaced '%s' with '%s' for key %s in %s", old_val, new_val, key, file_path) + # Записываем обратно изменённый контент без парсинга YAML, сохраняем оригинальное форматирование + with open(file_path, 'w', encoding='utf-8') as f: + f.write(modified_content) + except Exception as e: + logger.error("[_update_yaml_file][Failure] Error performing raw replacement in %s: %s", file_path, e) +# [/DEF:_update_yaml_file] -# -# @PURPOSE: Создает ZIP-архив из указанных исходных путей. -# @PARAM: zip_path: Union[str, Path] - Путь для сохранения ZIP архива. -# @PARAM: source_paths: List[Union[str, Path]] - Список исходных путей для архивации. -# @PARAM: exclude_extensions: Optional[List[str]] - Список расширений для исключения. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @RETURN: bool - `True` при успехе, `False` при ошибке. +# [DEF:create_dashboard_export:Function] +# @PURPOSE: Создает ZIP-архив из указанных исходных путей. +# @PARAM: zip_path (Union[str, Path]) - Путь для сохранения ZIP архива. +# @PARAM: source_paths (List[Union[str, Path]]) - Список исходных путей для архивации. +# @PARAM: exclude_extensions (Optional[List[str]]) - Список расширений для исключения. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. +# @RETURN: bool - `True` при успехе, `False` при ошибке. def create_dashboard_export(zip_path: Union[str, Path], source_paths: List[Union[str, Path]], exclude_extensions: Optional[List[str]] = None, logger: Optional[SupersetLogger] = None) -> bool: logger = logger or SupersetLogger(name="fileio") logger.info("[create_dashboard_export][Enter] Packing dashboard: %s -> %s", source_paths, zip_path) @@ -297,32 +367,32 @@ def create_dashboard_export(zip_path: Union[str, Path], source_paths: List[Union except (IOError, zipfile.BadZipFile, AssertionError) as e: logger.error("[create_dashboard_export][Failure] Error: %s", e, exc_info=True) return False -# +# [/DEF:create_dashboard_export] -# -# @PURPOSE: Очищает строку от символов, недопустимых в именах файлов. -# @PARAM: filename: str - Исходное имя файла. -# @RETURN: str - Очищенная строка. +# [DEF:sanitize_filename:Function] +# @PURPOSE: Очищает строку от символов, недопустимых в именах файлов. +# @PARAM: filename (str) - Исходное имя файла. +# @RETURN: str - Очищенная строка. def sanitize_filename(filename: str) -> str: return re.sub(r'[\\/*?:"<>|]', "_", filename).strip() -# +# [/DEF:sanitize_filename] -# -# @PURPOSE: Извлекает имя файла из HTTP заголовка 'Content-Disposition'. -# @PARAM: headers: dict - Словарь HTTP заголовков. -# @RETURN: Optional[str] - Имя файла или `None`. +# [DEF:get_filename_from_headers:Function] +# @PURPOSE: Извлекает имя файла из HTTP заголовка 'Content-Disposition'. +# @PARAM: headers (dict) - Словарь HTTP заголовков. +# @RETURN: Optional[str] - Имя файла или `None`. def get_filename_from_headers(headers: dict) -> Optional[str]: content_disposition = headers.get("Content-Disposition", "") if match := re.search(r'filename="?([^"]+)"?', content_disposition): return match.group(1).strip() return None -# +# [/DEF:get_filename_from_headers] -# -# @PURPOSE: Консолидирует директории архивов на основе общего слага в имени. -# @PARAM: root_directory: Path - Корневая директория для консолидации. -# @PARAM: logger: Optional[SupersetLogger] - Экземпляр логгера. -# @THROW: TypeError, ValueError - Если `root_directory` невалиден. +# [DEF:consolidate_archive_folders:Function] +# @PURPOSE: Консолидирует директории архивов на основе общего слага в имени. +# @THROW: TypeError, ValueError - Если `root_directory` невалиден. +# @PARAM: root_directory (Path) - Корневая директория для консолидации. +# @PARAM: logger (Optional[SupersetLogger]) - Экземпляр логгера. def consolidate_archive_folders(root_directory: Path, logger: Optional[SupersetLogger] = None) -> None: logger = logger or SupersetLogger(name="fileio") assert isinstance(root_directory, Path), "root_directory must be a Path object." @@ -371,8 +441,6 @@ def consolidate_archive_folders(root_directory: Path, logger: Optional[SupersetL logger.info("[consolidate_archive_folders][State] Removed source directory: %s", source_dir) except Exception as e: logger.error("[consolidate_archive_folders][Failure] Failed to remove source directory %s: %s", source_dir, e) -# +# [/DEF:consolidate_archive_folders] -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:superset_tool.utils.fileio] diff --git a/superset_tool/utils/init_clients.py b/superset_tool/utils/init_clients.py index 93795ae..d93de25 100644 --- a/superset_tool/utils/init_clients.py +++ b/superset_tool/utils/init_clients.py @@ -1,40 +1,43 @@ -# -# @SEMANTICS: utility, factory, client, initialization, configuration -# @PURPOSE: Централизованно инициализирует клиенты Superset для различных окружений (DEV, PROD, SBX, PREPROD), используя `keyring` для безопасного доступа к паролям. -# @DEPENDS_ON: superset_tool.models -> Использует SupersetConfig для создания конфигураций. -# @DEPENDS_ON: superset_tool.client -> Создает экземпляры SupersetClient. -# @DEPENDS_ON: keyring -> Для безопасного получения паролей. +# [DEF:superset_tool.utils.init_clients:Module] +# +# @SEMANTICS: utility, factory, client, initialization, configuration +# @PURPOSE: Централизованно инициализирует клиенты Superset для различных окружений (DEV, PROD, SBX, PREPROD), используя `keyring` для безопасного доступа к паролям. +# @LAYER: Infra +# @RELATION: DEPENDS_ON -> superset_tool.models +# @RELATION: DEPENDS_ON -> superset_tool.client +# @RELATION: DEPENDS_ON -> keyring +# @PUBLIC_API: setup_clients -# +# [SECTION: IMPORTS] import keyring from typing import Dict from superset_tool.models import SupersetConfig from superset_tool.client import SupersetClient from superset_tool.utils.logger import SupersetLogger -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Инициализирует и возвращает словарь клиентов `SupersetClient` для всех предопределенных окружений. -# @PRE: `keyring` должен содержать пароли для систем "dev migrate", "prod migrate", "sbx migrate", "preprod migrate". -# @PRE: `logger` должен быть валидным экземпляром `SupersetLogger`. -# @POST: Возвращает словарь с инициализированными клиентами. -# @PARAM: logger: SupersetLogger - Экземпляр логгера для записи процесса. -# @RETURN: Dict[str, SupersetClient] - Словарь, где ключ - имя окружения, значение - `SupersetClient`. -# @THROW: ValueError - Если пароль для окружения не найден в `keyring`. -# @THROW: Exception - При любых других ошибках инициализации. -# @RELATION: CREATES_INSTANCE_OF -> SupersetConfig -# @RELATION: CREATES_INSTANCE_OF -> SupersetClient +# [DEF:setup_clients:Function] +# @PURPOSE: Инициализирует и возвращает словарь клиентов `SupersetClient` для всех предопределенных окружений. +# @PRE: `keyring` должен содержать пароли для систем "dev migrate", "prod migrate", "sbx migrate", "preprod migrate". +# @PRE: `logger` должен быть валидным экземпляром `SupersetLogger`. +# @POST: Возвращает словарь с инициализированными клиентами. +# @THROW: ValueError - Если пароль для окружения не найден в `keyring`. +# @THROW: Exception - При любых других ошибках инициализации. +# @RELATION: CREATES_INSTANCE_OF -> SupersetConfig +# @RELATION: CREATES_INSTANCE_OF -> SupersetClient +# @PARAM: logger (SupersetLogger) - Экземпляр логгера для записи процесса. +# @RETURN: Dict[str, SupersetClient] - Словарь, где ключ - имя окружения, значение - `SupersetClient`. def setup_clients(logger: SupersetLogger) -> Dict[str, SupersetClient]: logger.info("[setup_clients][Enter] Starting Superset clients initialization.") clients = {} environments = { - "dev": "https://devta.bi.dwh.rusal.com/api/v1/", - "prod": "https://prodta.bi.dwh.rusal.com/api/v1/", - "sbx": "https://sandboxta.bi.dwh.rusal.com/api/v1/", - "preprod": "https://preprodta.bi.dwh.rusal.com/api/v1/" + "dev": "https://devta.bi.dwh.rusal.com/api/v1", + "prod": "https://prodta.bi.dwh.rusal.com/api/v1", + "sbx": "https://sandboxta.bi.dwh.rusal.com/api/v1", + "preprod": "https://preprodta.bi.dwh.rusal.com/api/v1", + "uatta": "https://uatta.bi.dwh.rusal.com/api/v1", + "dev5":"https://dev.bi.dwh.rusal.com/api/v1" } try: @@ -60,8 +63,6 @@ def setup_clients(logger: SupersetLogger) -> Dict[str, SupersetClient]: except Exception as e: logger.critical("[setup_clients][Failure] Critical error during client initialization: %s", e, exc_info=True) raise -# +# [/DEF:setup_clients] -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:superset_tool.utils.init_clients] diff --git a/superset_tool/utils/logger.py b/superset_tool/utils/logger.py index 3863b47..dffaa84 100644 --- a/superset_tool/utils/logger.py +++ b/superset_tool/utils/logger.py @@ -1,29 +1,34 @@ -# -# @SEMANTICS: logging, utility, infrastructure, wrapper -# @PURPOSE: Предоставляет универсальную обёртку над стандартным `logging.Logger` для унифицированного создания и управления логгерами с выводом в консоль и/или файл. +# [DEF:superset_tool.utils.logger:Module] +# +# @SEMANTICS: logging, utility, infrastructure, wrapper +# @PURPOSE: Предоставляет универсальную обёртку над стандартным `logging.Logger` для унифицированного создания и управления логгерами с выводом в консоль и/или файл. +# @LAYER: Infra +# @RELATION: WRAPS -> logging.Logger +# +# @INVARIANT: Логгер всегда должен иметь имя. +# @PUBLIC_API: SupersetLogger -# +# [SECTION: IMPORTS] import logging import sys from datetime import datetime from pathlib import Path from typing import Optional, Any, Mapping -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Обёртка над `logging.Logger`, которая упрощает конфигурацию и использование логгеров. -# @RELATION: WRAPS -> logging.Logger +# [DEF:SupersetLogger:Class] +# @PURPOSE: Обёртка над `logging.Logger`, которая упрощает конфигурацию и использование логгеров. +# @RELATION: WRAPS -> logging.Logger class SupersetLogger: + # [DEF:SupersetLogger.__init__:Function] + # @PURPOSE: Конфигурирует и инициализирует логгер, добавляя обработчики для файла и/или консоли. + # @PRE: Если log_dir указан, путь должен быть валидным (или создаваемым). + # @POST: `self.logger` готов к использованию с настроенными обработчиками. + # @PARAM: name (str) - Идентификатор логгера. + # @PARAM: log_dir (Optional[Path]) - Директория для сохранения лог-файлов. + # @PARAM: level (int) - Уровень логирования (e.g., `logging.INFO`). + # @PARAM: console (bool) - Флаг для включения вывода в консоль. def __init__(self, name: str = "superset_tool", log_dir: Optional[Path] = None, level: int = logging.INFO, console: bool = True) -> None: - # - # @PURPOSE: Конфигурирует и инициализирует логгер, добавляя обработчики для файла и/или консоли. - # @PARAM: name: str - Идентификатор логгера. - # @PARAM: log_dir: Optional[Path] - Директория для сохранения лог-файлов. - # @PARAM: level: int - Уровень логирования (e.g., `logging.INFO`). - # @PARAM: console: bool - Флаг для включения вывода в консоль. - # @POST: `self.logger` готов к использованию с настроенными обработчиками. self.logger = logging.getLogger(name) self.logger.setLevel(level) self.logger.propagate = False @@ -44,52 +49,55 @@ class SupersetLogger: console_handler = logging.StreamHandler(sys.stdout) console_handler.setFormatter(formatter) self.logger.addHandler(console_handler) - # + # [/DEF:SupersetLogger.__init__] - # - # @PURPOSE: (Helper) Универсальный метод для вызова соответствующего уровня логирования. - # @INTERNAL + # [DEF:SupersetLogger._log:Function] + # @PURPOSE: (Helper) Универсальный метод для вызова соответствующего уровня логирования. + # @PARAM: level_method (Any) - Метод логгера (info, debug, etc). + # @PARAM: msg (str) - Сообщение. + # @PARAM: args (Any) - Аргументы форматирования. + # @PARAM: extra (Optional[Mapping[str, Any]]) - Дополнительные данные. + # @PARAM: exc_info (bool) - Добавлять ли информацию об исключении. def _log(self, level_method: Any, msg: str, *args: Any, extra: Optional[Mapping[str, Any]] = None, exc_info: bool = False) -> None: level_method(msg, *args, extra=extra, exc_info=exc_info) - # + # [/DEF:SupersetLogger._log] - # - # @PURPOSE: Записывает сообщение уровня INFO. + # [DEF:SupersetLogger.info:Function] + # @PURPOSE: Записывает сообщение уровня INFO. def info(self, msg: str, *args: Any, extra: Optional[Mapping[str, Any]] = None, exc_info: bool = False) -> None: self._log(self.logger.info, msg, *args, extra=extra, exc_info=exc_info) - # + # [/DEF:SupersetLogger.info] - # - # @PURPOSE: Записывает сообщение уровня DEBUG. + # [DEF:SupersetLogger.debug:Function] + # @PURPOSE: Записывает сообщение уровня DEBUG. def debug(self, msg: str, *args: Any, extra: Optional[Mapping[str, Any]] = None, exc_info: bool = False) -> None: self._log(self.logger.debug, msg, *args, extra=extra, exc_info=exc_info) - # + # [/DEF:SupersetLogger.debug] - # - # @PURPOSE: Записывает сообщение уровня WARNING. + # [DEF:SupersetLogger.warning:Function] + # @PURPOSE: Записывает сообщение уровня WARNING. def warning(self, msg: str, *args: Any, extra: Optional[Mapping[str, Any]] = None, exc_info: bool = False) -> None: self._log(self.logger.warning, msg, *args, extra=extra, exc_info=exc_info) - # + # [/DEF:SupersetLogger.warning] - # - # @PURPOSE: Записывает сообщение уровня ERROR. + # [DEF:SupersetLogger.error:Function] + # @PURPOSE: Записывает сообщение уровня ERROR. def error(self, msg: str, *args: Any, extra: Optional[Mapping[str, Any]] = None, exc_info: bool = False) -> None: self._log(self.logger.error, msg, *args, extra=extra, exc_info=exc_info) - # + # [/DEF:SupersetLogger.error] - # - # @PURPOSE: Записывает сообщение уровня CRITICAL. + # [DEF:SupersetLogger.critical:Function] + # @PURPOSE: Записывает сообщение уровня CRITICAL. def critical(self, msg: str, *args: Any, extra: Optional[Mapping[str, Any]] = None, exc_info: bool = False) -> None: self._log(self.logger.critical, msg, *args, extra=extra, exc_info=exc_info) - # + # [/DEF:SupersetLogger.critical] - # - # @PURPOSE: Записывает сообщение уровня ERROR вместе с трассировкой стека текущего исключения. + # [DEF:SupersetLogger.exception:Function] + # @PURPOSE: Записывает сообщение уровня ERROR вместе с трассировкой стека текущего исключения. def exception(self, msg: str, *args: Any, **kwargs: Any) -> None: self.logger.exception(msg, *args, **kwargs) - # -# + # [/DEF:SupersetLogger.exception] -# --- Конец кода модуля --- +# [/DEF:SupersetLogger] -# \ No newline at end of file +# [/DEF:superset_tool.utils.logger] diff --git a/superset_tool/utils/network.py b/superset_tool/utils/network.py index fcb0548..e50fa3f 100644 --- a/superset_tool/utils/network.py +++ b/superset_tool/utils/network.py @@ -1,49 +1,56 @@ -# -# @SEMANTICS: network, http, client, api, requests, session, authentication -# @PURPOSE: Инкапсулирует низкоуровневую HTTP-логику для взаимодействия с Superset API, включая аутентификацию, управление сессией, retry-логику и обработку ошибок. -# @DEPENDS_ON: superset_tool.exceptions -> Для генерации специфичных сетевых и API ошибок. -# @DEPENDS_ON: superset_tool.utils.logger -> Для детального логирования сетевых операций. -# @DEPENDS_ON: requests -> Основа для выполнения HTTP-запросов. +# [DEF:superset_tool.utils.network:Module] +# +# @SEMANTICS: network, http, client, api, requests, session, authentication +# @PURPOSE: Инкапсулирует низкоуровневую HTTP-логику для взаимодействия с Superset API, включая аутентификацию, управление сессией, retry-логику и обработку ошибок. +# @LAYER: Infra +# @RELATION: DEPENDS_ON -> superset_tool.exceptions +# @RELATION: DEPENDS_ON -> superset_tool.utils.logger +# @RELATION: DEPENDS_ON -> requests +# @PUBLIC_API: APIClient -# -from typing import Optional, Dict, Any, List, Union +# [SECTION: IMPORTS] +from typing import Optional, Dict, Any, List, Union, cast import json import io from pathlib import Path import requests +from requests.adapters import HTTPAdapter import urllib3 +from urllib3.util.retry import Retry from superset_tool.exceptions import AuthenticationError, NetworkError, DashboardNotFoundError, SupersetAPIError, PermissionDeniedError from superset_tool.utils.logger import SupersetLogger -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Инкапсулирует HTTP-логику для работы с API, включая сессии, аутентификацию, и обработку запросов. +# [DEF:APIClient:Class] +# @PURPOSE: Инкапсулирует HTTP-логику для работы с API, включая сессии, аутентификацию, и обработку запросов. class APIClient: DEFAULT_TIMEOUT = 30 + # [DEF:APIClient.__init__:Function] + # @PURPOSE: Инициализирует API клиент с конфигурацией, сессией и логгером. + # @PARAM: config (Dict[str, Any]) - Конфигурация. + # @PARAM: verify_ssl (bool) - Проверять ли SSL. + # @PARAM: timeout (int) - Таймаут запросов. + # @PARAM: logger (Optional[SupersetLogger]) - Логгер. def __init__(self, config: Dict[str, Any], verify_ssl: bool = True, timeout: int = DEFAULT_TIMEOUT, logger: Optional[SupersetLogger] = None): - # - # @PURPOSE: Инициализирует API клиент с конфигурацией, сессией и логгером. self.logger = logger or SupersetLogger(name="APIClient") - self.logger.info("[APIClient.__init__][Enter] Initializing APIClient.") - self.base_url = config.get("base_url") + self.logger.info("[APIClient.__init__][Entry] Initializing APIClient.") + self.base_url: str = config.get("base_url", "") self.auth = config.get("auth") self.request_settings = {"verify_ssl": verify_ssl, "timeout": timeout} self.session = self._init_session() self._tokens: Dict[str, str] = {} self._authenticated = False self.logger.info("[APIClient.__init__][Exit] APIClient initialized.") - # + # [/DEF:APIClient.__init__] + # [DEF:APIClient._init_session:Function] + # @PURPOSE: Создает и настраивает `requests.Session` с retry-логикой. + # @RETURN: requests.Session - Настроенная сессия. def _init_session(self) -> requests.Session: - # - # @PURPOSE: Создает и настраивает `requests.Session` с retry-логикой. - # @INTERNAL session = requests.Session() - retries = requests.adapters.Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]) - adapter = requests.adapters.HTTPAdapter(max_retries=retries) + retries = Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]) + adapter = HTTPAdapter(max_retries=retries) session.mount('http://', adapter) session.mount('https://', adapter) if not self.request_settings["verify_ssl"]: @@ -51,14 +58,14 @@ class APIClient: self.logger.warning("[_init_session][State] SSL verification disabled.") session.verify = self.request_settings["verify_ssl"] return session - # + # [/DEF:APIClient._init_session] + # [DEF:APIClient.authenticate:Function] + # @PURPOSE: Выполняет аутентификацию в Superset API и получает access и CSRF токены. + # @POST: `self._tokens` заполнен, `self._authenticated` установлен в `True`. + # @RETURN: Dict[str, str] - Словарь с токенами. + # @THROW: AuthenticationError, NetworkError - при ошибках. def authenticate(self) -> Dict[str, str]: - # - # @PURPOSE: Выполняет аутентификацию в Superset API и получает access и CSRF токены. - # @POST: `self._tokens` заполнен, `self._authenticated` установлен в `True`. - # @RETURN: Словарь с токенами. - # @THROW: AuthenticationError, NetworkError - при ошибках. self.logger.info("[authenticate][Enter] Authenticating to %s", self.base_url) try: login_url = f"{self.base_url}/security/login" @@ -78,12 +85,12 @@ class APIClient: raise AuthenticationError(f"Authentication failed: {e}") from e except (requests.exceptions.RequestException, KeyError) as e: raise NetworkError(f"Network or parsing error during authentication: {e}") from e - # + # [/DEF:APIClient.authenticate] @property def headers(self) -> Dict[str, str]: - # - # @PURPOSE: Возвращает HTTP-заголовки для аутентифицированных запросов. + # [DEF:APIClient.headers:Function] + # @PURPOSE: Возвращает HTTP-заголовки для аутентифицированных запросов. if not self._authenticated: self.authenticate() return { "Authorization": f"Bearer {self._tokens['access_token']}", @@ -91,13 +98,17 @@ class APIClient: "Referer": self.base_url, "Content-Type": "application/json" } - # + # [/DEF:APIClient.headers] + # [DEF:APIClient.request:Function] + # @PURPOSE: Выполняет универсальный HTTP-запрос к API. + # @RETURN: `requests.Response` если `raw_response=True`, иначе `dict`. + # @THROW: SupersetAPIError, NetworkError и их подклассы. + # @PARAM: method (str) - HTTP метод. + # @PARAM: endpoint (str) - API эндпоинт. + # @PARAM: headers (Optional[Dict]) - Дополнительные заголовки. + # @PARAM: raw_response (bool) - Возвращать ли сырой ответ. def request(self, method: str, endpoint: str, headers: Optional[Dict] = None, raw_response: bool = False, **kwargs) -> Union[requests.Response, Dict[str, Any]]: - # - # @PURPOSE: Выполняет универсальный HTTP-запрос к API. - # @RETURN: `requests.Response` если `raw_response=True`, иначе `dict`. - # @THROW: SupersetAPIError, NetworkError и их подклассы. full_url = f"{self.base_url}{endpoint}" _headers = self.headers.copy() if headers: _headers.update(headers) @@ -110,34 +121,40 @@ class APIClient: self._handle_http_error(e, endpoint) except requests.exceptions.RequestException as e: self._handle_network_error(e, full_url) - # + # [/DEF:APIClient.request] + # [DEF:APIClient._handle_http_error:Function] + # @PURPOSE: (Helper) Преобразует HTTP ошибки в кастомные исключения. + # @PARAM: e (requests.exceptions.HTTPError) - Ошибка. + # @PARAM: endpoint (str) - Эндпоинт. def _handle_http_error(self, e: requests.exceptions.HTTPError, endpoint: str): - # - # @PURPOSE: (Helper) Преобразует HTTP ошибки в кастомные исключения. - # @INTERNAL status_code = e.response.status_code if status_code == 404: raise DashboardNotFoundError(endpoint) from e if status_code == 403: raise PermissionDeniedError() from e if status_code == 401: raise AuthenticationError() from e raise SupersetAPIError(f"API Error {status_code}: {e.response.text}") from e - # + # [/DEF:APIClient._handle_http_error] + # [DEF:APIClient._handle_network_error:Function] + # @PURPOSE: (Helper) Преобразует сетевые ошибки в `NetworkError`. + # @PARAM: e (requests.exceptions.RequestException) - Ошибка. + # @PARAM: url (str) - URL. def _handle_network_error(self, e: requests.exceptions.RequestException, url: str): - # - # @PURPOSE: (Helper) Преобразует сетевые ошибки в `NetworkError`. - # @INTERNAL if isinstance(e, requests.exceptions.Timeout): msg = "Request timeout" elif isinstance(e, requests.exceptions.ConnectionError): msg = "Connection error" else: msg = f"Unknown network error: {e}" raise NetworkError(msg, url=url) from e - # + # [/DEF:APIClient._handle_network_error] + # [DEF:APIClient.upload_file:Function] + # @PURPOSE: Загружает файл на сервер через multipart/form-data. + # @RETURN: Ответ API в виде словаря. + # @THROW: SupersetAPIError, NetworkError, TypeError. + # @PARAM: endpoint (str) - Эндпоинт. + # @PARAM: file_info (Dict[str, Any]) - Информация о файле. + # @PARAM: extra_data (Optional[Dict]) - Дополнительные данные. + # @PARAM: timeout (Optional[int]) - Таймаут. def upload_file(self, endpoint: str, file_info: Dict[str, Any], extra_data: Optional[Dict] = None, timeout: Optional[int] = None) -> Dict: - # - # @PURPOSE: Загружает файл на сервер через multipart/form-data. - # @RETURN: Ответ API в виде словаря. - # @THROW: SupersetAPIError, NetworkError, TypeError. full_url = f"{self.base_url}{endpoint}" _headers = self.headers.copy(); _headers.pop('Content-Type', None) @@ -153,32 +170,51 @@ class APIClient: raise TypeError(f"Unsupported file_obj type: {type(file_obj)}") return self._perform_upload(full_url, files_payload, extra_data, _headers, timeout) - # + # [/DEF:APIClient.upload_file] + # [DEF:APIClient._perform_upload:Function] + # @PURPOSE: (Helper) Выполняет POST запрос с файлом. + # @PARAM: url (str) - URL. + # @PARAM: files (Dict) - Файлы. + # @PARAM: data (Optional[Dict]) - Данные. + # @PARAM: headers (Dict) - Заголовки. + # @PARAM: timeout (Optional[int]) - Таймаут. + # @RETURN: Dict - Ответ. def _perform_upload(self, url: str, files: Dict, data: Optional[Dict], headers: Dict, timeout: Optional[int]) -> Dict: - # - # @PURPOSE: (Helper) Выполняет POST запрос с файлом. - # @INTERNAL try: response = self.session.post(url, files=files, data=data or {}, headers=headers, timeout=timeout or self.request_settings["timeout"]) response.raise_for_status() + # Добавляем логирование для отладки + if response.status_code == 200: + try: + return response.json() + except Exception as json_e: + self.logger.debug(f"[_perform_upload][Debug] Response is not valid JSON: {response.text[:200]}...") + raise SupersetAPIError(f"API error during upload: Response is not valid JSON: {json_e}") from json_e return response.json() except requests.exceptions.HTTPError as e: raise SupersetAPIError(f"API error during upload: {e.response.text}") from e except requests.exceptions.RequestException as e: raise NetworkError(f"Network error during upload: {e}", url=url) from e - # + # [/DEF:APIClient._perform_upload] + # [DEF:APIClient.fetch_paginated_count:Function] + # @PURPOSE: Получает общее количество элементов для пагинации. + # @PARAM: endpoint (str) - Эндпоинт. + # @PARAM: query_params (Dict) - Параметры запроса. + # @PARAM: count_field (str) - Поле с количеством. + # @RETURN: int - Количество. def fetch_paginated_count(self, endpoint: str, query_params: Dict, count_field: str = "count") -> int: - # - # @PURPOSE: Получает общее количество элементов для пагинации. - response_json = self.request("GET", endpoint, params={"q": json.dumps(query_params)}) + response_json = cast(Dict[str, Any], self.request("GET", endpoint, params={"q": json.dumps(query_params)})) return response_json.get(count_field, 0) - # + # [/DEF:APIClient.fetch_paginated_count] + # [DEF:APIClient.fetch_paginated_data:Function] + # @PURPOSE: Автоматически собирает данные со всех страниц пагинированного эндпоинта. + # @PARAM: endpoint (str) - Эндпоинт. + # @PARAM: pagination_options (Dict[str, Any]) - Опции пагинации. + # @RETURN: List[Any] - Список данных. def fetch_paginated_data(self, endpoint: str, pagination_options: Dict[str, Any]) -> List[Any]: - # - # @PURPOSE: Автоматически собирает данные со всех страниц пагинированного эндпоинта. base_query, total_count = pagination_options["base_query"], pagination_options["total_count"] results_field, page_size = pagination_options["results_field"], base_query.get('page_size') assert page_size and page_size > 0, "'page_size' must be a positive number." @@ -186,13 +222,11 @@ class APIClient: results = [] for page in range((total_count + page_size - 1) // page_size): query = {**base_query, 'page': page} - response_json = self.request("GET", endpoint, params={"q": json.dumps(query)}) + response_json = cast(Dict[str, Any], self.request("GET", endpoint, params={"q": json.dumps(query)})) results.extend(response_json.get(results_field, [])) return results - # + # [/DEF:APIClient.fetch_paginated_data] -# +# [/DEF:APIClient] -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:superset_tool.utils.network] diff --git a/superset_tool/utils/whiptail_fallback.py b/superset_tool/utils/whiptail_fallback.py index b253917..f87ea79 100644 --- a/superset_tool/utils/whiptail_fallback.py +++ b/superset_tool/utils/whiptail_fallback.py @@ -1,20 +1,21 @@ -# -# @SEMANTICS: ui, fallback, console, utility, interactive -# @PURPOSE: Предоставляет плотный консольный UI-fallback для интерактивных диалогов, имитируя `whiptail` для систем, где он недоступен. +# [DEF:superset_tool.utils.whiptail_fallback:Module] +# +# @SEMANTICS: ui, fallback, console, utility, interactive +# @PURPOSE: Предоставляет плотный консольный UI-fallback для интерактивных диалогов, имитируя `whiptail` для систем, где он недоступен. +# @LAYER: UI +# @PUBLIC_API: menu, checklist, yesno, msgbox, inputbox, gauge -# +# [SECTION: IMPORTS] import sys from typing import List, Tuple, Optional, Any -# +# [/SECTION] -# --- Начало кода модуля --- - -# -# @PURPOSE: Отображает меню выбора и возвращает выбранный элемент. -# @PARAM: title: str - Заголовок меню. -# @PARAM: prompt: str - Приглашение к вводу. -# @PARAM: choices: List[str] - Список вариантов для выбора. -# @RETURN: Tuple[int, Optional[str]] - Кортеж (код возврата, выбранный элемент). rc=0 - успех. +# [DEF:menu:Function] +# @PURPOSE: Отображает меню выбора и возвращает выбранный элемент. +# @PARAM: title (str) - Заголовок меню. +# @PARAM: prompt (str) - Приглашение к вводу. +# @PARAM: choices (List[str]) - Список вариантов для выбора. +# @RETURN: Tuple[int, Optional[str]] - Кортеж (код возврата, выбранный элемент). rc=0 - успех. def menu(title: str, prompt: str, choices: List[str], **kwargs) -> Tuple[int, Optional[str]]: print(f"\n=== {title} ===\n{prompt}") for idx, item in enumerate(choices, 1): @@ -25,14 +26,14 @@ def menu(title: str, prompt: str, choices: List[str], **kwargs) -> Tuple[int, Op return (0, choices[sel - 1]) if 0 < sel <= len(choices) else (1, None) except (ValueError, IndexError): return 1, None -# +# [/DEF:menu] -# -# @PURPOSE: Отображает список с возможностью множественного выбора. -# @PARAM: title: str - Заголовок. -# @PARAM: prompt: str - Приглашение к вводу. -# @PARAM: options: List[Tuple[str, str]] - Список кортежей (значение, метка). -# @RETURN: Tuple[int, List[str]] - Кортеж (код возврата, список выбранных значений). +# [DEF:checklist:Function] +# @PURPOSE: Отображает список с возможностью множественного выбора. +# @PARAM: title (str) - Заголовок. +# @PARAM: prompt (str) - Приглашение к вводу. +# @PARAM: options (List[Tuple[str, str]]) - Список кортежей (значение, метка). +# @RETURN: Tuple[int, List[str]] - Кортеж (код возврата, список выбранных значений). def checklist(title: str, prompt: str, options: List[Tuple[str, str]], **kwargs) -> Tuple[int, List[str]]: print(f"\n=== {title} ===\n{prompt}") for idx, (val, label) in enumerate(options, 1): @@ -45,40 +46,39 @@ def checklist(title: str, prompt: str, options: List[Tuple[str, str]], **kwargs) return 0, selected_values except (ValueError, IndexError): return 1, [] -# +# [/DEF:checklist] -# -# @PURPOSE: Задает вопрос с ответом да/нет. -# @PARAM: title: str - Заголовок. -# @PARAM: question: str - Вопрос для пользователя. -# @RETURN: bool - `True`, если пользователь ответил "да". +# [DEF:yesno:Function] +# @PURPOSE: Задает вопрос с ответом да/нет. +# @PARAM: title (str) - Заголовок. +# @PARAM: question (str) - Вопрос для пользователя. +# @RETURN: bool - `True`, если пользователь ответил "да". def yesno(title: str, question: str, **kwargs) -> bool: ans = input(f"\n=== {title} ===\n{question} (y/n): ").strip().lower() return ans in ("y", "yes", "да", "д") -# +# [/DEF:yesno] -# -# @PURPOSE: Отображает информационное сообщение. -# @PARAM: title: str - Заголовок. -# @PARAM: msg: str - Текст сообщения. +# [DEF:msgbox:Function] +# @PURPOSE: Отображает информационное сообщение. +# @PARAM: title (str) - Заголовок. +# @PARAM: msg (str) - Текст сообщения. def msgbox(title: str, msg: str, **kwargs) -> None: print(f"\n=== {title} ===\n{msg}\n") -# +# [/DEF:msgbox] -# -# @PURPOSE: Запрашивает у пользователя текстовый ввод. -# @PARAM: title: str - Заголовок. -# @PARAM: prompt: str - Приглашение к вводу. -# @RETURN: Tuple[int, Optional[str]] - Кортеж (код возврата, введенная строка). +# [DEF:inputbox:Function] +# @PURPOSE: Запрашивает у пользователя текстовый ввод. +# @PARAM: title (str) - Заголовок. +# @PARAM: prompt (str) - Приглашение к вводу. +# @RETURN: Tuple[int, Optional[str]] - Кортеж (код возврата, введенная строка). def inputbox(title: str, prompt: str, **kwargs) -> Tuple[int, Optional[str]]: print(f"\n=== {title} ===") val = input(f"{prompt}\n") return (0, val) if val else (1, None) -# +# [/DEF:inputbox] -# -# @PURPOSE: Контекстный менеджер для имитации `whiptail gauge` в консоли. -# @INTERNAL +# [DEF:_ConsoleGauge:Class] +# @PURPOSE: Контекстный менеджер для имитации `whiptail gauge` в консоли. class _ConsoleGauge: def __init__(self, title: str, **kwargs): self.title = title @@ -91,16 +91,14 @@ class _ConsoleGauge: sys.stdout.write(f"\r{txt} "); sys.stdout.flush() def set_percent(self, percent: int) -> None: sys.stdout.write(f"{percent}%"); sys.stdout.flush() -# +# [/DEF:_ConsoleGauge] -# -# @PURPOSE: Создает и возвращает экземпляр `_ConsoleGauge`. -# @PARAM: title: str - Заголовок для индикатора прогресса. -# @RETURN: _ConsoleGauge - Экземпляр контекстного менеджера. +# [DEF:gauge:Function] +# @PURPOSE: Создает и возвращает экземпляр `_ConsoleGauge`. +# @PARAM: title (str) - Заголовок для индикатора прогресса. +# @RETURN: _ConsoleGauge - Экземпляр контекстного менеджера. def gauge(title: str, **kwargs) -> _ConsoleGauge: return _ConsoleGauge(title, **kwargs) -# +# [/DEF:gauge] -# --- Конец кода модуля --- - -# \ No newline at end of file +# [/DEF:superset_tool.utils.whiptail_fallback] diff --git a/tech_spec/PROJECT_SEMANTICS.xml b/tech_spec/PROJECT_SEMANTICS.xml deleted file mode 100644 index 977c090..0000000 --- a/tech_spec/PROJECT_SEMANTICS.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - 1.0 - 2025-08-16T10:00:00Z - - - - Скрипт для создания резервных копий дашбордов и чартов из Superset. - - - Интерактивный скрипт для миграции ассетов Superset между различными окружениями. - - - - - - - - - Скрипт для поиска ассетов в Superset. - - - Временный скрипт для запуска Pylint. - - - Пакет для взаимодействия с Superset API. - - - - - - - Клиент для взаимодействия с Superset API. - - - - - Пользовательские исключения для Superset Tool. - - - Модели данных для Superset. - - - Утилиты для Superset Tool. - - - - - - - Утилиты для работы с файлами. - - - - - Инициализация клиентов для взаимодействия с API. - - - Конфигурация логгера. - - - Сетевые утилиты. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tech_spec/openapi.json b/tech_spec/openapi.json deleted file mode 100644 index bb8858f..0000000 --- a/tech_spec/openapi.json +++ /dev/null @@ -1,28200 +0,0 @@ -{ - "components": { - "responses": { - "400": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Forbidden" - }, - "404": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Not found" - }, - "410": { - "content": { - "application/json": { - "schema": { - "properties": { - "errors": { - "items": { - "properties": { - "error_type": { - "enum": [ - "FRONTEND_CSRF_ERROR", - "FRONTEND_NETWORK_ERROR", - "FRONTEND_TIMEOUT_ERROR", - "GENERIC_DB_ENGINE_ERROR", - "COLUMN_DOES_NOT_EXIST_ERROR", - "TABLE_DOES_NOT_EXIST_ERROR", - "SCHEMA_DOES_NOT_EXIST_ERROR", - "CONNECTION_INVALID_USERNAME_ERROR", - "CONNECTION_INVALID_PASSWORD_ERROR", - "CONNECTION_INVALID_HOSTNAME_ERROR", - "CONNECTION_PORT_CLOSED_ERROR", - "CONNECTION_INVALID_PORT_ERROR", - "CONNECTION_HOST_DOWN_ERROR", - "CONNECTION_ACCESS_DENIED_ERROR", - "CONNECTION_UNKNOWN_DATABASE_ERROR", - "CONNECTION_DATABASE_PERMISSIONS_ERROR", - "CONNECTION_MISSING_PARAMETERS_ERROR", - "OBJECT_DOES_NOT_EXIST_ERROR", - "SYNTAX_ERROR", - "CONNECTION_DATABASE_TIMEOUT", - "VIZ_GET_DF_ERROR", - "UNKNOWN_DATASOURCE_TYPE_ERROR", - "FAILED_FETCHING_DATASOURCE_INFO_ERROR", - "TABLE_SECURITY_ACCESS_ERROR", - "DATASOURCE_SECURITY_ACCESS_ERROR", - "DATABASE_SECURITY_ACCESS_ERROR", - "QUERY_SECURITY_ACCESS_ERROR", - "MISSING_OWNERSHIP_ERROR", - "USER_ACTIVITY_SECURITY_ACCESS_ERROR", - "DASHBOARD_SECURITY_ACCESS_ERROR", - "CHART_SECURITY_ACCESS_ERROR", - "OAUTH2_REDIRECT", - "OAUTH2_REDIRECT_ERROR", - "BACKEND_TIMEOUT_ERROR", - "DATABASE_NOT_FOUND_ERROR", - "TABLE_NOT_FOUND_ERROR", - "MISSING_TEMPLATE_PARAMS_ERROR", - "INVALID_TEMPLATE_PARAMS_ERROR", - "RESULTS_BACKEND_NOT_CONFIGURED_ERROR", - "DML_NOT_ALLOWED_ERROR", - "INVALID_CTAS_QUERY_ERROR", - "INVALID_CVAS_QUERY_ERROR", - "SQLLAB_TIMEOUT_ERROR", - "RESULTS_BACKEND_ERROR", - "ASYNC_WORKERS_ERROR", - "ADHOC_SUBQUERY_NOT_ALLOWED_ERROR", - "INVALID_SQL_ERROR", - "RESULT_TOO_LARGE_ERROR", - "GENERIC_COMMAND_ERROR", - "GENERIC_BACKEND_ERROR", - "INVALID_PAYLOAD_FORMAT_ERROR", - "INVALID_PAYLOAD_SCHEMA_ERROR", - "MARSHMALLOW_ERROR", - "REPORT_NOTIFICATION_ERROR" - ], - "type": "string" - }, - "extra": { - "type": "object" - }, - "level": { - "enum": [ - "info", - "warning", - "error" - ], - "type": "string" - }, - "message": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Gone" - }, - "422": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Could not process entity" - }, - "500": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Fatal error" - } - }, - "schemas": { - "AdvancedDataTypeSchema": { - "properties": { - "display_value": { - "description": "The string representation of the parsed values", - "type": "string" - }, - "error_message": { - "type": "string" - }, - "valid_filter_operators": { - "items": { - "type": "string" - }, - "type": "array" - }, - "values": { - "items": { - "description": "parsed value (can be any value)", - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "AnnotationLayer": { - "properties": { - "annotationType": { - "description": "Type of annotation layer", - "enum": [ - "FORMULA", - "INTERVAL", - "EVENT", - "TIME_SERIES" - ], - "type": "string" - }, - "color": { - "description": "Layer color", - "nullable": true, - "type": "string" - }, - "descriptionColumns": { - "description": "Columns to use as the description. If none are provided, all will be shown.", - "items": { - "type": "string" - }, - "type": "array" - }, - "hideLine": { - "description": "Should line be hidden. Only applies to line annotations", - "nullable": true, - "type": "boolean" - }, - "intervalEndColumn": { - "description": "Column containing end of interval. Only applies to interval layers", - "nullable": true, - "type": "string" - }, - "name": { - "description": "Name of layer", - "type": "string" - }, - "opacity": { - "description": "Opacity of layer", - "enum": [ - "", - "opacityLow", - "opacityMedium", - "opacityHigh" - ], - "nullable": true, - "type": "string" - }, - "overrides": { - "additionalProperties": { - "nullable": true - }, - "description": "which properties should be overridable", - "nullable": true, - "type": "object" - }, - "show": { - "description": "Should the layer be shown", - "type": "boolean" - }, - "showLabel": { - "description": "Should the label always be shown", - "nullable": true, - "type": "boolean" - }, - "showMarkers": { - "description": "Should markers be shown. Only applies to line annotations.", - "type": "boolean" - }, - "sourceType": { - "description": "Type of source for annotation data", - "enum": [ - "", - "line", - "NATIVE", - "table" - ], - "type": "string" - }, - "style": { - "description": "Line style. Only applies to time-series annotations", - "enum": [ - "dashed", - "dotted", - "solid", - "longDashed" - ], - "type": "string" - }, - "timeColumn": { - "description": "Column with event date or interval start date", - "nullable": true, - "type": "string" - }, - "titleColumn": { - "description": "Column with title", - "nullable": true, - "type": "string" - }, - "value": { - "description": "For formula annotations, this contains the formula. For other types, this is the primary key of the source object." - }, - "width": { - "description": "Width of annotation line", - "minimum": 0.0, - "type": "number" - } - }, - "required": [ - "name", - "show", - "showMarkers", - "value" - ], - "type": "object" - }, - "AnnotationLayerRestApi.get": { - "properties": { - "descr": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "AnnotationLayerRestApi.get_list": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.get_list.User1" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.get_list.User" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "descr": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "AnnotationLayerRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "AnnotationLayerRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "AnnotationLayerRestApi.post": { - "properties": { - "descr": { - "description": "Give a description for this annotation layer", - "nullable": true, - "type": "string" - }, - "name": { - "description": "The annotation layer name", - "maxLength": 250, - "minLength": 1, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "AnnotationLayerRestApi.put": { - "properties": { - "descr": { - "description": "Give a description for this annotation layer", - "type": "string" - }, - "name": { - "description": "The annotation layer name", - "maxLength": 250, - "minLength": 1, - "type": "string" - } - }, - "type": "object" - }, - "AnnotationRestApi.get": { - "properties": { - "end_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "json_metadata": { - "nullable": true, - "type": "string" - }, - "layer": { - "$ref": "#/components/schemas/AnnotationRestApi.get.AnnotationLayer" - }, - "long_descr": { - "nullable": true, - "type": "string" - }, - "short_descr": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "start_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - } - }, - "required": [ - "layer" - ], - "type": "object" - }, - "AnnotationRestApi.get.AnnotationLayer": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "AnnotationRestApi.get_list": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/AnnotationRestApi.get_list.User" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/AnnotationRestApi.get_list.User1" - }, - "end_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "long_descr": { - "nullable": true, - "type": "string" - }, - "short_descr": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "start_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "AnnotationRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "first_name" - ], - "type": "object" - }, - "AnnotationRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "first_name" - ], - "type": "object" - }, - "AnnotationRestApi.post": { - "properties": { - "end_dttm": { - "description": "The annotation end date time", - "format": "date-time", - "type": "string" - }, - "json_metadata": { - "description": "JSON metadata", - "nullable": true, - "type": "string" - }, - "long_descr": { - "description": "A long description", - "nullable": true, - "type": "string" - }, - "short_descr": { - "description": "A short description", - "maxLength": 500, - "minLength": 1, - "type": "string" - }, - "start_dttm": { - "description": "The annotation start date time", - "format": "date-time", - "type": "string" - } - }, - "required": [ - "end_dttm", - "short_descr", - "start_dttm" - ], - "type": "object" - }, - "AnnotationRestApi.put": { - "properties": { - "end_dttm": { - "description": "The annotation end date time", - "format": "date-time", - "type": "string" - }, - "json_metadata": { - "description": "JSON metadata", - "nullable": true, - "type": "string" - }, - "long_descr": { - "description": "A long description", - "nullable": true, - "type": "string" - }, - "short_descr": { - "description": "A short description", - "maxLength": 500, - "minLength": 1, - "type": "string" - }, - "start_dttm": { - "description": "The annotation start date time", - "format": "date-time", - "type": "string" - } - }, - "type": "object" - }, - "AvailableDomainsSchema": { - "properties": { - "domains": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "CacheInvalidationRequestSchema": { - "properties": { - "datasource_uids": { - "description": "The uid of the dataset/datasource this new chart will use. A complete datasource identification needs `datasource_uid` ", - "items": { - "type": "string" - }, - "type": "array" - }, - "datasources": { - "description": "A list of the data source and database names", - "items": { - "$ref": "#/components/schemas/Datasource" - }, - "type": "array" - } - }, - "type": "object" - }, - "CacheRestApi.get": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "CacheRestApi.get_list": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "CacheRestApi.post": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "CacheRestApi.put": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "CatalogsResponseSchema": { - "properties": { - "result": { - "items": { - "description": "A database catalog name", - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "ChartCacheScreenshotResponseSchema": { - "properties": { - "cache_key": { - "description": "The cache key", - "type": "string" - }, - "chart_url": { - "description": "The url to render the chart", - "type": "string" - }, - "image_url": { - "description": "The url to fetch the screenshot", - "type": "string" - }, - "task_status": { - "description": "The status of the async screenshot", - "type": "string" - }, - "task_updated_at": { - "description": "The timestamp of the last change in status", - "type": "string" - } - }, - "type": "object" - }, - "ChartCacheWarmUpRequestSchema": { - "properties": { - "chart_id": { - "description": "The ID of the chart to warm up cache for", - "type": "integer" - }, - "dashboard_id": { - "description": "The ID of the dashboard to get filters for when warming cache", - "type": "integer" - }, - "extra_filters": { - "description": "Extra filters to apply when warming up cache", - "type": "string" - } - }, - "required": [ - "chart_id" - ], - "type": "object" - }, - "ChartCacheWarmUpResponseSchema": { - "properties": { - "result": { - "description": "A list of each chart's warmup status and errors if any", - "items": { - "$ref": "#/components/schemas/ChartCacheWarmUpResponseSingle" - }, - "type": "array" - } - }, - "type": "object" - }, - "ChartCacheWarmUpResponseSingle": { - "properties": { - "chart_id": { - "description": "The ID of the chart the status belongs to", - "type": "integer" - }, - "viz_error": { - "description": "Error that occurred when warming cache for chart", - "type": "string" - }, - "viz_status": { - "description": "Status of the underlying query for the viz", - "type": "string" - } - }, - "type": "object" - }, - "ChartDataAdhocMetricSchema": { - "properties": { - "aggregate": { - "description": "Aggregation operator.Only required for simple expression types.", - "enum": [ - "AVG", - "COUNT", - "COUNT_DISTINCT", - "MAX", - "MIN", - "SUM" - ], - "type": "string" - }, - "column": { - "$ref": "#/components/schemas/ChartDataColumn" - }, - "expressionType": { - "description": "Simple or SQL metric", - "enum": [ - "SIMPLE", - "SQL" - ], - "example": "SQL", - "type": "string" - }, - "hasCustomLabel": { - "description": "When false, the label will be automatically generated based on the aggregate expression. When true, a custom label has to be specified.", - "example": true, - "type": "boolean" - }, - "isExtra": { - "description": "Indicates if the filter has been added by a filter component as opposed to being a part of the original query.", - "type": "boolean" - }, - "label": { - "description": "Label for the metric. Is automatically generated unlesshasCustomLabel is true, in which case label must be defined.", - "example": "Weighted observations", - "type": "string" - }, - "optionName": { - "description": "Unique identifier. Can be any string value, as long as all metrics have a unique identifier. If undefined, a random namewill be generated.", - "example": "metric_aec60732-fac0-4b17-b736-93f1a5c93e30", - "type": "string" - }, - "sqlExpression": { - "description": "The metric as defined by a SQL aggregate expression. Only required for SQL expression type.", - "example": "SUM(weight * observations) / SUM(weight)", - "type": "string" - }, - "timeGrain": { - "description": "Optional time grain for temporal filters", - "example": "PT1M", - "type": "string" - } - }, - "required": [ - "expressionType" - ], - "type": "object" - }, - "ChartDataAggregateOptionsSchema": { - "properties": { - "aggregates": { - "description": "The keys are the name of the aggregate column to be created, and the values specify the details of how to apply the aggregation. If an operator requires additional options, these can be passed here to be unpacked in the operator call. The following numpy operators are supported: average, argmin, argmax, cumsum, cumprod, max, mean, median, nansum, nanmin, nanmax, nanmean, nanmedian, min, percentile, prod, product, std, sum, var. Any options required by the operator can be passed to the `options` object.\n\nIn the example, a new column `first_quantile` is created based on values in the column `my_col` using the `percentile` operator with the `q=0.25` parameter.", - "example": { - "first_quantile": { - "column": "my_col", - "operator": "percentile", - "options": { - "q": 0.25 - } - } - }, - "type": "object" - } - }, - "type": "object" - }, - "ChartDataAsyncResponseSchema": { - "properties": { - "channel_id": { - "description": "Unique session async channel ID", - "type": "string" - }, - "job_id": { - "description": "Unique async job ID", - "type": "string" - }, - "result_url": { - "description": "Unique result URL for fetching async query data", - "type": "string" - }, - "status": { - "description": "Status value for async job", - "type": "string" - }, - "user_id": { - "description": "Requesting user ID", - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataBoxplotOptionsSchema": { - "properties": { - "groupby": { - "items": { - "description": "Columns by which to group the query.", - "type": "string" - }, - "nullable": true, - "type": "array" - }, - "metrics": { - "description": "Aggregate expressions. Metrics can be passed as both references to datasource metrics (strings), or ad-hoc metricswhich are defined only within the query object. See `ChartDataAdhocMetricSchema` for the structure of ad-hoc metrics. When metrics is undefined or null, the query is executed without a groupby. However, when metrics is an array (length >= 0), a groupby clause is added to the query.", - "items": {}, - "nullable": true, - "type": "array" - }, - "percentiles": { - "description": "Upper and lower percentiles for percentile whisker type.", - "example": [ - 1, - 99 - ] - }, - "whisker_type": { - "description": "Whisker type. Any numpy function will work.", - "enum": [ - "tukey", - "min/max", - "percentile" - ], - "example": "tukey", - "type": "string" - } - }, - "required": [ - "whisker_type" - ], - "type": "object" - }, - "ChartDataColumn": { - "properties": { - "column_name": { - "description": "The name of the target column", - "example": "mycol", - "type": "string" - }, - "type": { - "description": "Type of target column", - "example": "BIGINT", - "type": "string" - } - }, - "type": "object" - }, - "ChartDataContributionOptionsSchema": { - "properties": { - "orientation": { - "description": "Should cell values be calculated across the row or column.", - "enum": [ - "row", - "column" - ], - "example": "row", - "type": "string" - } - }, - "required": [ - "orientation" - ], - "type": "object" - }, - "ChartDataDatasource": { - "properties": { - "id": { - "description": "Datasource id", - "type": "integer" - }, - "type": { - "description": "Datasource type", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - }, - "ChartDataExtras": { - "properties": { - "having": { - "description": "HAVING clause to be added to aggregate queries using AND operator.", - "type": "string" - }, - "instant_time_comparison_range": { - "description": "This is only set using the new time comparison controls that is made available in some plugins behind the experimental feature flag.", - "nullable": true, - "type": "string" - }, - "relative_end": { - "description": "End time for relative time deltas. Default: `config[\"DEFAULT_RELATIVE_START_TIME\"]`", - "enum": [ - "today", - "now" - ], - "type": "string" - }, - "relative_start": { - "description": "Start time for relative time deltas. Default: `config[\"DEFAULT_RELATIVE_START_TIME\"]`", - "enum": [ - "today", - "now" - ], - "type": "string" - }, - "time_grain_sqla": { - "description": "To what level of granularity should the temporal column be aggregated. Supports [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) durations.", - "enum": [ - "PT1S", - "PT5S", - "PT30S", - "PT1M", - "PT5M", - "PT10M", - "PT15M", - "PT30M", - "PT1H", - "PT6H", - "P1D", - "P1W", - "P1M", - "P3M", - "P1Y", - "1969-12-28T00:00:00Z/P1W", - "1969-12-29T00:00:00Z/P1W", - "P1W/1970-01-03T00:00:00Z", - "P1W/1970-01-04T00:00:00Z" - ], - "example": "P1D", - "nullable": true, - "type": "string" - }, - "where": { - "description": "WHERE clause to be added to queries using AND operator.", - "type": "string" - } - }, - "type": "object" - }, - "ChartDataFilter": { - "properties": { - "col": { - "description": "The column to filter by. Can be either a string (physical or saved expression) or an object (adhoc column)", - "example": "country" - }, - "grain": { - "description": "Optional time grain for temporal filters", - "example": "PT1M", - "type": "string" - }, - "isExtra": { - "description": "Indicates if the filter has been added by a filter component as opposed to being a part of the original query.", - "type": "boolean" - }, - "op": { - "description": "The comparison operator.", - "enum": [ - "==", - "!=", - ">", - "<", - ">=", - "<=", - "LIKE", - "NOT LIKE", - "ILIKE", - "IS NULL", - "IS NOT NULL", - "IN", - "NOT IN", - "IS TRUE", - "IS FALSE", - "TEMPORAL_RANGE" - ], - "example": "IN", - "type": "string" - }, - "val": { - "description": "The value or values to compare against. Can be a string, integer, decimal, None or list, depending on the operator.", - "example": [ - "China", - "France", - "Japan" - ], - "nullable": true - } - }, - "required": [ - "col", - "op" - ], - "type": "object" - }, - "ChartDataGeodeticParseOptionsSchema": { - "properties": { - "altitude": { - "description": "Name of target column for decoded altitude. If omitted, altitude information in geodetic string is ignored.", - "type": "string" - }, - "geodetic": { - "description": "Name of source column containing geodetic point strings", - "type": "string" - }, - "latitude": { - "description": "Name of target column for decoded latitude", - "type": "string" - }, - "longitude": { - "description": "Name of target column for decoded longitude", - "type": "string" - } - }, - "required": [ - "geodetic", - "latitude", - "longitude" - ], - "type": "object" - }, - "ChartDataGeohashDecodeOptionsSchema": { - "properties": { - "geohash": { - "description": "Name of source column containing geohash string", - "type": "string" - }, - "latitude": { - "description": "Name of target column for decoded latitude", - "type": "string" - }, - "longitude": { - "description": "Name of target column for decoded longitude", - "type": "string" - } - }, - "required": [ - "geohash", - "latitude", - "longitude" - ], - "type": "object" - }, - "ChartDataGeohashEncodeOptionsSchema": { - "properties": { - "geohash": { - "description": "Name of target column for encoded geohash string", - "type": "string" - }, - "latitude": { - "description": "Name of source latitude column", - "type": "string" - }, - "longitude": { - "description": "Name of source longitude column", - "type": "string" - } - }, - "required": [ - "geohash", - "latitude", - "longitude" - ], - "type": "object" - }, - "ChartDataPivotOptionsSchema": { - "properties": { - "aggregates": { - "description": "The keys are the name of the aggregate column to be created, and the values specify the details of how to apply the aggregation. If an operator requires additional options, these can be passed here to be unpacked in the operator call. The following numpy operators are supported: average, argmin, argmax, cumsum, cumprod, max, mean, median, nansum, nanmin, nanmax, nanmean, nanmedian, min, percentile, prod, product, std, sum, var. Any options required by the operator can be passed to the `options` object.\n\nIn the example, a new column `first_quantile` is created based on values in the column `my_col` using the `percentile` operator with the `q=0.25` parameter.", - "example": { - "first_quantile": { - "column": "my_col", - "operator": "percentile", - "options": { - "q": 0.25 - } - } - }, - "type": "object" - }, - "column_fill_value": { - "description": "Value to replace missing pivot columns names with.", - "type": "string" - }, - "columns": { - "description": "Columns to group by on the table columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "drop_missing_columns": { - "description": "Do not include columns whose entries are all missing (default: `true`).", - "type": "boolean" - }, - "marginal_distribution_name": { - "description": "Name of marginal distribution row/column. (default: `All`)", - "type": "string" - }, - "marginal_distributions": { - "description": "Add totals for row/column. (default: `false`)", - "type": "boolean" - }, - "metric_fill_value": { - "description": "Value to replace missing values with in aggregate calculations.", - "type": "number" - } - }, - "type": "object" - }, - "ChartDataPostProcessingOperation": { - "properties": { - "operation": { - "description": "Post processing operation type", - "enum": [ - "aggregate", - "boxplot", - "compare", - "contribution", - "cum", - "diff", - "escape_separator", - "flatten", - "geodetic_parse", - "geohash_decode", - "geohash_encode", - "histogram", - "pivot", - "prophet", - "rank", - "rename", - "resample", - "rolling", - "select", - "sort", - "unescape_separator" - ], - "example": "aggregate", - "type": "string" - }, - "options": { - "description": "Options specifying how to perform the operation. Please refer to the respective post processing operation option schemas. For example, `ChartDataPostProcessingOperationOptions` specifies the required options for the pivot operation.", - "example": { - "aggregates": { - "age_mean": { - "column": "age", - "operator": "mean" - }, - "age_q1": { - "column": "age", - "operator": "percentile", - "options": { - "q": 0.25 - } - } - }, - "groupby": [ - "country", - "gender" - ] - }, - "type": "object" - } - }, - "required": [ - "operation" - ], - "type": "object" - }, - "ChartDataProphetOptionsSchema": { - "properties": { - "confidence_interval": { - "description": "Width of predicted confidence interval", - "example": 0.8, - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - "monthly_seasonality": { - "description": "Should monthly seasonality be applied. An integer value will specify Fourier order of seasonality, `None` will automatically detect seasonality.", - "example": false - }, - "periods": { - "description": "Time periods (in units of `time_grain`) to predict into the future", - "example": 7, - "type": "integer" - }, - "time_grain": { - "description": "Time grain used to specify time period increments in prediction. Supports [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) durations.", - "enum": [ - "PT1S", - "PT5S", - "PT30S", - "PT1M", - "PT5M", - "PT10M", - "PT15M", - "PT30M", - "PT1H", - "PT6H", - "P1D", - "P1W", - "P1M", - "P3M", - "P1Y", - "1969-12-28T00:00:00Z/P1W", - "1969-12-29T00:00:00Z/P1W", - "P1W/1970-01-03T00:00:00Z", - "P1W/1970-01-04T00:00:00Z" - ], - "example": "P1D", - "type": "string" - }, - "weekly_seasonality": { - "description": "Should weekly seasonality be applied. An integer value will specify Fourier order of seasonality, `None` will automatically detect seasonality.", - "example": false - }, - "yearly_seasonality": { - "description": "Should yearly seasonality be applied. An integer value will specify Fourier order of seasonality, `None` will automatically detect seasonality.", - "example": false - } - }, - "required": [ - "confidence_interval", - "periods", - "time_grain" - ], - "type": "object" - }, - "ChartDataQueryContextSchema": { - "properties": { - "custom_cache_timeout": { - "description": "Override the default cache timeout", - "nullable": true, - "type": "integer" - }, - "datasource": { - "$ref": "#/components/schemas/ChartDataDatasource" - }, - "force": { - "description": "Should the queries be forced to load from the source. Default: `false`", - "nullable": true, - "type": "boolean" - }, - "form_data": { - "nullable": true - }, - "queries": { - "items": { - "$ref": "#/components/schemas/ChartDataQueryObject" - }, - "type": "array" - }, - "result_format": { - "enum": [ - "csv", - "json", - "xlsx" - ] - }, - "result_type": { - "enum": [ - "columns", - "full", - "query", - "results", - "samples", - "timegrains", - "post_processed", - "drill_detail" - ] - } - }, - "type": "object" - }, - "ChartDataQueryObject": { - "properties": { - "annotation_layers": { - "description": "Annotation layers to apply to chart", - "items": { - "$ref": "#/components/schemas/AnnotationLayer" - }, - "nullable": true, - "type": "array" - }, - "applied_time_extras": { - "description": "A mapping of temporal extras that have been applied to the query", - "example": { - "__time_range": "1 year ago : now" - }, - "nullable": true, - "type": "object" - }, - "apply_fetch_values_predicate": { - "description": "Add fetch values predicate (where clause) to query if defined in datasource", - "nullable": true, - "type": "boolean" - }, - "columns": { - "description": "Columns which to select in the query.", - "items": {}, - "nullable": true, - "type": "array" - }, - "datasource": { - "allOf": [ - { - "$ref": "#/components/schemas/ChartDataDatasource" - } - ], - "nullable": true - }, - "extras": { - "allOf": [ - { - "$ref": "#/components/schemas/ChartDataExtras" - } - ], - "description": "Extra parameters to add to the query.", - "nullable": true - }, - "filters": { - "items": { - "$ref": "#/components/schemas/ChartDataFilter" - }, - "nullable": true, - "type": "array" - }, - "granularity": { - "description": "Name of temporal column used for time filtering. ", - "nullable": true, - "type": "string" - }, - "granularity_sqla": { - "deprecated": true, - "description": "Name of temporal column used for time filtering for SQL datasources. This field is deprecated, use `granularity` instead.", - "nullable": true, - "type": "string" - }, - "groupby": { - "description": "Columns by which to group the query. This field is deprecated, use `columns` instead.", - "items": {}, - "nullable": true, - "type": "array" - }, - "having": { - "deprecated": true, - "description": "HAVING clause to be added to aggregate queries using AND operator. This field is deprecated and should be passed to `extras`.", - "nullable": true, - "type": "string" - }, - "is_rowcount": { - "description": "Should the rowcount of the actual query be returned", - "nullable": true, - "type": "boolean" - }, - "is_timeseries": { - "description": "Is the `query_object` a timeseries.", - "nullable": true, - "type": "boolean" - }, - "metrics": { - "description": "Aggregate expressions. Metrics can be passed as both references to datasource metrics (strings), or ad-hoc metricswhich are defined only within the query object. See `ChartDataAdhocMetricSchema` for the structure of ad-hoc metrics.", - "items": {}, - "nullable": true, - "type": "array" - }, - "order_desc": { - "description": "Reverse order. Default: `false`", - "nullable": true, - "type": "boolean" - }, - "orderby": { - "description": "Expects a list of lists where the first element is the column name which to sort by, and the second element is a boolean.", - "example": [ - [ - "my_col_1", - false - ], - [ - "my_col_2", - true - ] - ], - "items": {}, - "nullable": true, - "type": "array" - }, - "post_processing": { - "description": "Post processing operations to be applied to the result set. Operations are applied to the result set in sequential order.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/ChartDataPostProcessingOperation" - } - ], - "nullable": true - }, - "nullable": true, - "type": "array" - }, - "result_type": { - "enum": [ - "columns", - "full", - "query", - "results", - "samples", - "timegrains", - "post_processed", - "drill_detail" - ], - "nullable": true - }, - "row_limit": { - "description": "Maximum row count (0=disabled). Default: `config[\"ROW_LIMIT\"]`", - "minimum": 0, - "nullable": true, - "type": "integer" - }, - "row_offset": { - "description": "Number of rows to skip. Default: `0`", - "minimum": 0, - "nullable": true, - "type": "integer" - }, - "series_columns": { - "description": "Columns to use when limiting series count. All columns must be present in the `columns` property. Requires `series_limit` and `series_limit_metric` to be set.", - "items": {}, - "nullable": true, - "type": "array" - }, - "series_limit": { - "description": "Maximum number of series. Requires `series` and `series_limit_metric` to be set.", - "nullable": true, - "type": "integer" - }, - "series_limit_metric": { - "description": "Metric used to limit timeseries queries by. Requires `series` and `series_limit` to be set.", - "nullable": true - }, - "time_offsets": { - "items": { - "type": "string" - }, - "nullable": true, - "type": "array" - }, - "time_range": { - "description": "A time rage, either expressed as a colon separated string `since : until` or human readable freeform. Valid formats for `since` and `until` are: \n- ISO 8601\n- X days/years/hours/day/year/weeks\n- X days/years/hours/day/year/weeks ago\n- X days/years/hours/day/year/weeks from now\n\nAdditionally, the following freeform can be used:\n\n- Last day\n- Last week\n- Last month\n- Last quarter\n- Last year\n- No filter\n- Last X seconds/minutes/hours/days/weeks/months/years\n- Next X seconds/minutes/hours/days/weeks/months/years\n", - "example": "Last week", - "nullable": true, - "type": "string" - }, - "time_shift": { - "description": "A human-readable date/time string. Please refer to [parsdatetime](https://github.com/bear/parsedatetime) documentation for details on valid values.", - "nullable": true, - "type": "string" - }, - "timeseries_limit": { - "description": "Maximum row count for timeseries queries. This field is deprecated, use `series_limit` instead.Default: `0`", - "nullable": true, - "type": "integer" - }, - "timeseries_limit_metric": { - "description": "Metric used to limit timeseries queries by. This field is deprecated, use `series_limit_metric` instead.", - "nullable": true - }, - "url_params": { - "additionalProperties": { - "description": "The value of the query parameter", - "type": "string" - }, - "description": "Optional query parameters passed to a dashboard or Explore view", - "nullable": true, - "type": "object" - }, - "where": { - "deprecated": true, - "description": "WHERE clause to be added to queries using AND operator.This field is deprecated and should be passed to `extras`.", - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataResponseResult": { - "properties": { - "annotation_data": { - "description": "All requested annotation data", - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "nullable": true, - "type": "array" - }, - "applied_filters": { - "description": "A list with applied filters", - "items": { - "type": "object" - }, - "type": "array" - }, - "cache_key": { - "description": "Unique cache key for query object", - "nullable": true, - "type": "string" - }, - "cache_timeout": { - "description": "Cache timeout in following order: custom timeout, datasource timeout, cache default timeout, config default cache timeout.", - "nullable": true, - "type": "integer" - }, - "cached_dttm": { - "description": "Cache timestamp", - "nullable": true, - "type": "string" - }, - "colnames": { - "description": "A list of column names", - "items": { - "type": "string" - }, - "type": "array" - }, - "coltypes": { - "description": "A list of generic data types of each column", - "items": { - "type": "integer" - }, - "type": "array" - }, - "data": { - "description": "A list with results", - "items": { - "type": "object" - }, - "type": "array" - }, - "error": { - "description": "Error", - "nullable": true, - "type": "string" - }, - "from_dttm": { - "description": "Start timestamp of time range", - "nullable": true, - "type": "integer" - }, - "is_cached": { - "description": "Is the result cached", - "type": "boolean" - }, - "query": { - "description": "The executed query statement", - "type": "string" - }, - "rejected_filters": { - "description": "A list with rejected filters", - "items": { - "type": "object" - }, - "type": "array" - }, - "rowcount": { - "description": "Amount of rows in result set", - "type": "integer" - }, - "stacktrace": { - "description": "Stacktrace if there was an error", - "nullable": true, - "type": "string" - }, - "status": { - "description": "Status of the query", - "enum": [ - "stopped", - "failed", - "pending", - "running", - "scheduled", - "success", - "timed_out" - ], - "type": "string" - }, - "to_dttm": { - "description": "End timestamp of time range", - "nullable": true, - "type": "integer" - } - }, - "required": [ - "cache_key", - "cache_timeout", - "cached_dttm", - "is_cached", - "query" - ], - "type": "object" - }, - "ChartDataResponseSchema": { - "properties": { - "result": { - "description": "A list of results for each corresponding query in the request.", - "items": { - "$ref": "#/components/schemas/ChartDataResponseResult" - }, - "type": "array" - } - }, - "type": "object" - }, - "ChartDataRestApi.get": { - "properties": { - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "certification_details": { - "nullable": true, - "type": "string" - }, - "certified_by": { - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "dashboards": { - "$ref": "#/components/schemas/ChartDataRestApi.get.Dashboard" - }, - "description": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "owners": { - "$ref": "#/components/schemas/ChartDataRestApi.get.User" - }, - "params": { - "nullable": true, - "type": "string" - }, - "query_context": { - "nullable": true, - "type": "string" - }, - "slice_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "tags": { - "$ref": "#/components/schemas/ChartDataRestApi.get.Tag" - }, - "thumbnail_url": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "viz_type": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataRestApi.get.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "json_metadata": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataRestApi.get.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "ChartDataRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartDataRestApi.get_list": { - "properties": { - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "certification_details": { - "nullable": true, - "type": "string" - }, - "certified_by": { - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User" - }, - "changed_by_name": { - "readOnly": true - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "changed_on_dttm": { - "readOnly": true - }, - "changed_on_utc": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User1" - }, - "created_by_name": { - "readOnly": true - }, - "created_on_delta_humanized": { - "readOnly": true - }, - "dashboards": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.Dashboard" - }, - "datasource_id": { - "nullable": true, - "type": "integer" - }, - "datasource_name_text": { - "readOnly": true - }, - "datasource_type": { - "maxLength": 200, - "nullable": true, - "type": "string" - }, - "datasource_url": { - "readOnly": true - }, - "description": { - "nullable": true, - "type": "string" - }, - "description_markeddown": { - "readOnly": true - }, - "edit_url": { - "readOnly": true - }, - "form_data": { - "readOnly": true - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "last_saved_at": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_saved_by": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User2" - }, - "owners": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User3" - }, - "params": { - "nullable": true, - "type": "string" - }, - "slice_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "slice_url": { - "readOnly": true - }, - "table": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.SqlaTable" - }, - "tags": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.Tag" - }, - "thumbnail_url": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "viz_type": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataRestApi.get_list.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "ChartDataRestApi.get_list.SqlaTable": { - "properties": { - "default_endpoint": { - "nullable": true, - "type": "string" - }, - "table_name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "table_name" - ], - "type": "object" - }, - "ChartDataRestApi.get_list.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "ChartDataRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartDataRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartDataRestApi.get_list.User2": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartDataRestApi.get_list.User3": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartDataRestApi.post": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this chart. Note this defaults to the datasource/table timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "certification_details": { - "description": "Details of the certification", - "nullable": true, - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this chart", - "nullable": true, - "type": "string" - }, - "dashboards": { - "items": { - "description": "A list of dashboards to include this new chart to.", - "type": "integer" - }, - "type": "array" - }, - "datasource_id": { - "description": "The id of the dataset/datasource this new chart will use. A complete datasource identification needs `datasource_id` and `datasource_type`.", - "type": "integer" - }, - "datasource_name": { - "description": "The datasource name.", - "nullable": true, - "type": "string" - }, - "datasource_type": { - "description": "The type of dataset/datasource identified on `datasource_id`.", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "type": "string" - }, - "description": { - "description": "A description of the chart propose.", - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this chart. If left empty you will be one of the owners of the chart.", - "type": "integer" - }, - "type": "array" - }, - "params": { - "description": "Parameters are generated dynamically when clicking the save or overwrite button in the explore view. This JSON object for power users who may want to alter specific parameters.", - "nullable": true, - "type": "string" - }, - "query_context": { - "description": "The query context represents the queries that need to run in order to generate the data the visualization, and in what format the data should be returned.", - "nullable": true, - "type": "string" - }, - "query_context_generation": { - "description": "The query context generation represents whether the query_contextis user generated or not so that it does not update user modifiedstate.", - "nullable": true, - "type": "boolean" - }, - "slice_name": { - "description": "The name of the chart.", - "maxLength": 250, - "minLength": 1, - "type": "string" - }, - "viz_type": { - "description": "The type of chart visualization used.", - "example": [ - "bar", - "area", - "table" - ], - "maxLength": 250, - "minLength": 0, - "type": "string" - } - }, - "required": [ - "datasource_id", - "datasource_type", - "slice_name" - ], - "type": "object" - }, - "ChartDataRestApi.put": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this chart. Note this defaults to the datasource/table timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "certification_details": { - "description": "Details of the certification", - "nullable": true, - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this chart", - "nullable": true, - "type": "string" - }, - "dashboards": { - "items": { - "description": "A list of dashboards to include this new chart to.", - "type": "integer" - }, - "type": "array" - }, - "datasource_id": { - "description": "The id of the dataset/datasource this new chart will use. A complete datasource identification needs `datasource_id` and `datasource_type`.", - "nullable": true, - "type": "integer" - }, - "datasource_type": { - "description": "The type of dataset/datasource identified on `datasource_id`.", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "nullable": true, - "type": "string" - }, - "description": { - "description": "A description of the chart propose.", - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this chart. If left empty you will be one of the owners of the chart.", - "type": "integer" - }, - "type": "array" - }, - "params": { - "description": "Parameters are generated dynamically when clicking the save or overwrite button in the explore view. This JSON object for power users who may want to alter specific parameters.", - "nullable": true, - "type": "string" - }, - "query_context": { - "description": "The query context represents the queries that need to run in order to generate the data the visualization, and in what format the data should be returned.", - "nullable": true, - "type": "string" - }, - "query_context_generation": { - "description": "The query context generation represents whether the query_contextis user generated or not so that it does not update user modifiedstate.", - "nullable": true, - "type": "boolean" - }, - "slice_name": { - "description": "The name of the chart.", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "tags": { - "items": { - "description": "Tags to be associated with the chart", - "type": "integer" - }, - "type": "array" - }, - "viz_type": { - "description": "The type of chart visualization used.", - "example": [ - "bar", - "area", - "table" - ], - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataRollingOptionsSchema": { - "properties": { - "center": { - "description": "Should the label be at the center of the window.Default: `false`", - "example": false, - "type": "boolean" - }, - "min_periods": { - "description": "The minimum amount of periods required for a row to be included in the result set.", - "example": 7, - "type": "integer" - }, - "rolling_type": { - "description": "Type of rolling window. Any numpy function will work.", - "enum": [ - "average", - "argmin", - "argmax", - "cumsum", - "cumprod", - "max", - "mean", - "median", - "nansum", - "nanmin", - "nanmax", - "nanmean", - "nanmedian", - "nanpercentile", - "min", - "percentile", - "prod", - "product", - "std", - "sum", - "var" - ], - "example": "percentile", - "type": "string" - }, - "rolling_type_options": { - "description": "Optional options to pass to rolling method. Needed for e.g. quantile operation.", - "example": {}, - "type": "object" - }, - "win_type": { - "description": "Type of window function. See [SciPy window functions](https://docs.scipy.org/doc/scipy/reference /signal.windows.html#module-scipy.signal.windows) for more details. Some window functions require passing additional parameters to `rolling_type_options`. For instance, to use `gaussian`, the parameter `std` needs to be provided.", - "enum": [ - "boxcar", - "triang", - "blackman", - "hamming", - "bartlett", - "parzen", - "bohman", - "blackmanharris", - "nuttall", - "barthann", - "kaiser", - "gaussian", - "general_gaussian", - "slepian", - "exponential" - ], - "type": "string" - }, - "window": { - "description": "Size of the rolling window in days.", - "example": 7, - "type": "integer" - } - }, - "required": [ - "rolling_type", - "window" - ], - "type": "object" - }, - "ChartDataSelectOptionsSchema": { - "properties": { - "columns": { - "description": "Columns which to select from the input data, in the desired order. If columns are renamed, the original column name should be referenced here.", - "example": [ - "country", - "gender", - "age" - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "exclude": { - "description": "Columns to exclude from selection.", - "example": [ - "my_temp_column" - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "rename": { - "description": "columns which to rename, mapping source column to target column. For instance, `{'y': 'y2'}` will rename the column `y` to `y2`.", - "example": [ - { - "age": "average_age" - } - ], - "items": { - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "ChartDataSortOptionsSchema": { - "properties": { - "aggregates": { - "description": "The keys are the name of the aggregate column to be created, and the values specify the details of how to apply the aggregation. If an operator requires additional options, these can be passed here to be unpacked in the operator call. The following numpy operators are supported: average, argmin, argmax, cumsum, cumprod, max, mean, median, nansum, nanmin, nanmax, nanmean, nanmedian, min, percentile, prod, product, std, sum, var. Any options required by the operator can be passed to the `options` object.\n\nIn the example, a new column `first_quantile` is created based on values in the column `my_col` using the `percentile` operator with the `q=0.25` parameter.", - "example": { - "first_quantile": { - "column": "my_col", - "operator": "percentile", - "options": { - "q": 0.25 - } - } - }, - "type": "object" - }, - "columns": { - "description": "columns by by which to sort. The key specifies the column name, value specifies if sorting in ascending order.", - "example": { - "country": true, - "gender": false - }, - "type": "object" - } - }, - "required": [ - "columns" - ], - "type": "object" - }, - "ChartEntityResponseSchema": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this chart. Note this defaults to the datasource/table timeout if undefined.", - "type": "integer" - }, - "certification_details": { - "description": "Details of the certification", - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this chart", - "type": "string" - }, - "changed_on": { - "description": "The ISO date that the chart was last changed.", - "format": "date-time", - "type": "string" - }, - "description": { - "description": "A description of the chart propose.", - "type": "string" - }, - "description_markeddown": { - "description": "Sanitized HTML version of the chart description.", - "type": "string" - }, - "form_data": { - "description": "Form data from the Explore controls used to form the chart's data query.", - "type": "object" - }, - "id": { - "description": "The id of the chart.", - "type": "integer" - }, - "slice_name": { - "description": "The name of the chart.", - "type": "string" - }, - "slice_url": { - "description": "The URL of the chart.", - "type": "string" - } - }, - "type": "object" - }, - "ChartFavStarResponseResult": { - "properties": { - "id": { - "description": "The Chart id", - "type": "integer" - }, - "value": { - "description": "The FaveStar value", - "type": "boolean" - } - }, - "type": "object" - }, - "ChartGetDatasourceObjectDataResponse": { - "properties": { - "datasource_id": { - "description": "The datasource identifier", - "type": "integer" - }, - "datasource_type": { - "description": "The datasource type", - "type": "integer" - } - }, - "type": "object" - }, - "ChartGetDatasourceObjectResponse": { - "properties": { - "label": { - "description": "The name of the datasource", - "type": "string" - }, - "value": { - "$ref": "#/components/schemas/ChartGetDatasourceObjectDataResponse" - } - }, - "type": "object" - }, - "ChartGetDatasourceResponseSchema": { - "properties": { - "count": { - "description": "The total number of datasources", - "type": "integer" - }, - "result": { - "$ref": "#/components/schemas/ChartGetDatasourceObjectResponse" - } - }, - "type": "object" - }, - "ChartRestApi.get": { - "properties": { - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "certification_details": { - "nullable": true, - "type": "string" - }, - "certified_by": { - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "dashboards": { - "$ref": "#/components/schemas/ChartRestApi.get.Dashboard" - }, - "description": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "owners": { - "$ref": "#/components/schemas/ChartRestApi.get.User" - }, - "params": { - "nullable": true, - "type": "string" - }, - "query_context": { - "nullable": true, - "type": "string" - }, - "slice_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "tags": { - "$ref": "#/components/schemas/ChartRestApi.get.Tag" - }, - "thumbnail_url": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "viz_type": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartRestApi.get.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "json_metadata": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartRestApi.get.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "ChartRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartRestApi.get_list": { - "properties": { - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "certification_details": { - "nullable": true, - "type": "string" - }, - "certified_by": { - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User" - }, - "changed_by_name": { - "readOnly": true - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "changed_on_dttm": { - "readOnly": true - }, - "changed_on_utc": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User1" - }, - "created_by_name": { - "readOnly": true - }, - "created_on_delta_humanized": { - "readOnly": true - }, - "dashboards": { - "$ref": "#/components/schemas/ChartRestApi.get_list.Dashboard" - }, - "datasource_id": { - "nullable": true, - "type": "integer" - }, - "datasource_name_text": { - "readOnly": true - }, - "datasource_type": { - "maxLength": 200, - "nullable": true, - "type": "string" - }, - "datasource_url": { - "readOnly": true - }, - "description": { - "nullable": true, - "type": "string" - }, - "description_markeddown": { - "readOnly": true - }, - "edit_url": { - "readOnly": true - }, - "form_data": { - "readOnly": true - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "last_saved_at": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_saved_by": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User2" - }, - "owners": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User3" - }, - "params": { - "nullable": true, - "type": "string" - }, - "slice_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "slice_url": { - "readOnly": true - }, - "table": { - "$ref": "#/components/schemas/ChartRestApi.get_list.SqlaTable" - }, - "tags": { - "$ref": "#/components/schemas/ChartRestApi.get_list.Tag" - }, - "thumbnail_url": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "viz_type": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartRestApi.get_list.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "ChartRestApi.get_list.SqlaTable": { - "properties": { - "default_endpoint": { - "nullable": true, - "type": "string" - }, - "table_name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "table_name" - ], - "type": "object" - }, - "ChartRestApi.get_list.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "ChartRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartRestApi.get_list.User2": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartRestApi.get_list.User3": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ChartRestApi.post": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this chart. Note this defaults to the datasource/table timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "certification_details": { - "description": "Details of the certification", - "nullable": true, - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this chart", - "nullable": true, - "type": "string" - }, - "dashboards": { - "items": { - "description": "A list of dashboards to include this new chart to.", - "type": "integer" - }, - "type": "array" - }, - "datasource_id": { - "description": "The id of the dataset/datasource this new chart will use. A complete datasource identification needs `datasource_id` and `datasource_type`.", - "type": "integer" - }, - "datasource_name": { - "description": "The datasource name.", - "nullable": true, - "type": "string" - }, - "datasource_type": { - "description": "The type of dataset/datasource identified on `datasource_id`.", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "type": "string" - }, - "description": { - "description": "A description of the chart propose.", - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this chart. If left empty you will be one of the owners of the chart.", - "type": "integer" - }, - "type": "array" - }, - "params": { - "description": "Parameters are generated dynamically when clicking the save or overwrite button in the explore view. This JSON object for power users who may want to alter specific parameters.", - "nullable": true, - "type": "string" - }, - "query_context": { - "description": "The query context represents the queries that need to run in order to generate the data the visualization, and in what format the data should be returned.", - "nullable": true, - "type": "string" - }, - "query_context_generation": { - "description": "The query context generation represents whether the query_contextis user generated or not so that it does not update user modifiedstate.", - "nullable": true, - "type": "boolean" - }, - "slice_name": { - "description": "The name of the chart.", - "maxLength": 250, - "minLength": 1, - "type": "string" - }, - "viz_type": { - "description": "The type of chart visualization used.", - "example": [ - "bar", - "area", - "table" - ], - "maxLength": 250, - "minLength": 0, - "type": "string" - } - }, - "required": [ - "datasource_id", - "datasource_type", - "slice_name" - ], - "type": "object" - }, - "ChartRestApi.put": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this chart. Note this defaults to the datasource/table timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "certification_details": { - "description": "Details of the certification", - "nullable": true, - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this chart", - "nullable": true, - "type": "string" - }, - "dashboards": { - "items": { - "description": "A list of dashboards to include this new chart to.", - "type": "integer" - }, - "type": "array" - }, - "datasource_id": { - "description": "The id of the dataset/datasource this new chart will use. A complete datasource identification needs `datasource_id` and `datasource_type`.", - "nullable": true, - "type": "integer" - }, - "datasource_type": { - "description": "The type of dataset/datasource identified on `datasource_id`.", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "nullable": true, - "type": "string" - }, - "description": { - "description": "A description of the chart propose.", - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this chart. If left empty you will be one of the owners of the chart.", - "type": "integer" - }, - "type": "array" - }, - "params": { - "description": "Parameters are generated dynamically when clicking the save or overwrite button in the explore view. This JSON object for power users who may want to alter specific parameters.", - "nullable": true, - "type": "string" - }, - "query_context": { - "description": "The query context represents the queries that need to run in order to generate the data the visualization, and in what format the data should be returned.", - "nullable": true, - "type": "string" - }, - "query_context_generation": { - "description": "The query context generation represents whether the query_contextis user generated or not so that it does not update user modifiedstate.", - "nullable": true, - "type": "boolean" - }, - "slice_name": { - "description": "The name of the chart.", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "tags": { - "items": { - "description": "Tags to be associated with the chart", - "type": "integer" - }, - "type": "array" - }, - "viz_type": { - "description": "The type of chart visualization used.", - "example": [ - "bar", - "area", - "table" - ], - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "CssTemplateRestApi.get": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/CssTemplateRestApi.get.User" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/CssTemplateRestApi.get.User1" - }, - "css": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "template_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "CssTemplateRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "CssTemplateRestApi.get.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "CssTemplateRestApi.get_list": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/CssTemplateRestApi.get_list.User" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/CssTemplateRestApi.get_list.User1" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "css": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "template_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "CssTemplateRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "CssTemplateRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "CssTemplateRestApi.post": { - "properties": { - "css": { - "nullable": true, - "type": "string" - }, - "template_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "CssTemplateRestApi.put": { - "properties": { - "css": { - "nullable": true, - "type": "string" - }, - "template_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "DashboardCacheScreenshotResponseSchema": { - "properties": { - "cache_key": { - "description": "The cache key", - "type": "string" - }, - "dashboard_url": { - "description": "The url to render the dashboard", - "type": "string" - }, - "image_url": { - "description": "The url to fetch the screenshot", - "type": "string" - }, - "task_status": { - "description": "The status of the async screenshot", - "type": "string" - }, - "task_updated_at": { - "description": "The timestamp of the last change in status", - "type": "string" - } - }, - "type": "object" - }, - "DashboardCopySchema": { - "properties": { - "css": { - "description": "Override CSS for the dashboard.", - "type": "string" - }, - "dashboard_title": { - "description": "A title for the dashboard.", - "maxLength": 500, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "duplicate_slices": { - "description": "Whether or not to also copy all charts on the dashboard", - "type": "boolean" - }, - "json_metadata": { - "description": "This JSON object is generated dynamically when clicking the save or overwrite button in the dashboard view. It is exposed here for reference and for power users who may want to alter specific parameters.", - "type": "string" - } - }, - "required": [ - "json_metadata" - ], - "type": "object" - }, - "DashboardDatasetSchema": { - "properties": { - "always_filter_main_dttm": { - "type": "boolean" - }, - "cache_timeout": { - "type": "integer" - }, - "column_formats": { - "type": "object" - }, - "column_names": { - "items": { - "type": "string" - }, - "type": "array" - }, - "column_types": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "columns": { - "items": { - "type": "object" - }, - "type": "array" - }, - "database": { - "$ref": "#/components/schemas/Database" - }, - "datasource_name": { - "type": "string" - }, - "default_endpoint": { - "type": "string" - }, - "edit_url": { - "type": "string" - }, - "fetch_values_predicate": { - "type": "string" - }, - "filter_select": { - "type": "boolean" - }, - "filter_select_enabled": { - "type": "boolean" - }, - "granularity_sqla": { - "items": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "array" - }, - "health_check_message": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_sqllab_view": { - "type": "boolean" - }, - "main_dttm_col": { - "type": "string" - }, - "metrics": { - "items": { - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "normalize_columns": { - "type": "boolean" - }, - "offset": { - "type": "integer" - }, - "order_by_choices": { - "items": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "array" - }, - "owners": { - "items": { - "type": "object" - }, - "type": "array" - }, - "params": { - "type": "string" - }, - "perm": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "select_star": { - "type": "string" - }, - "sql": { - "type": "string" - }, - "table_name": { - "type": "string" - }, - "template_params": { - "type": "string" - }, - "time_grain_sqla": { - "items": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "uid": { - "type": "string" - }, - "verbose_map": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - }, - "type": "object" - }, - "DashboardGetResponseSchema": { - "properties": { - "certification_details": { - "description": "Details of the certification", - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this dashboard", - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/User" - }, - "changed_by_name": { - "type": "string" - }, - "changed_on": { - "format": "date-time", - "type": "string" - }, - "changed_on_delta_humanized": { - "type": "string" - }, - "charts": { - "items": { - "description": "The names of the dashboard's charts. Names are used for legacy reasons.", - "type": "string" - }, - "type": "array" - }, - "created_by": { - "$ref": "#/components/schemas/User" - }, - "created_on_delta_humanized": { - "type": "string" - }, - "css": { - "description": "Override CSS for the dashboard.", - "type": "string" - }, - "dashboard_title": { - "description": "A title for the dashboard.", - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "json_metadata": { - "description": "This JSON object is generated dynamically when clicking the save or overwrite button in the dashboard view. It is exposed here for reference and for power users who may want to alter specific parameters.", - "type": "string" - }, - "owners": { - "items": { - "$ref": "#/components/schemas/User" - }, - "type": "array" - }, - "position_json": { - "description": "This json object describes the positioning of the widgets in the dashboard. It is dynamically generated when adjusting the widgets size and positions by using drag & drop in the dashboard view", - "type": "string" - }, - "published": { - "type": "boolean" - }, - "roles": { - "items": { - "$ref": "#/components/schemas/Roles" - }, - "type": "array" - }, - "slug": { - "type": "string" - }, - "tags": { - "items": { - "$ref": "#/components/schemas/Tag" - }, - "type": "array" - }, - "thumbnail_url": { - "nullable": true, - "type": "string" - }, - "url": { - "type": "string" - } - }, - "type": "object" - }, - "DashboardPermalinkStateSchema": { - "properties": { - "activeTabs": { - "description": "Current active dashboard tabs", - "items": { - "type": "string" - }, - "nullable": true, - "type": "array" - }, - "anchor": { - "description": "Optional anchor link added to url hash", - "nullable": true, - "type": "string" - }, - "dataMask": { - "description": "Data mask used for native filter state", - "nullable": true, - "type": "object" - }, - "urlParams": { - "description": "URL Parameters", - "items": { - "description": "URL Parameter key-value pair", - "nullable": true - }, - "nullable": true, - "type": "array" - } - }, - "type": "object" - }, - "DashboardRestApi.get": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DashboardRestApi.get_list": { - "properties": { - "certification_details": { - "nullable": true, - "type": "string" - }, - "certified_by": { - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/DashboardRestApi.get_list.User" - }, - "changed_by_name": { - "readOnly": true - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "changed_on_utc": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/DashboardRestApi.get_list.User1" - }, - "created_on_delta_humanized": { - "readOnly": true - }, - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "owners": { - "$ref": "#/components/schemas/DashboardRestApi.get_list.User2" - }, - "published": { - "nullable": true, - "type": "boolean" - }, - "roles": { - "$ref": "#/components/schemas/DashboardRestApi.get_list.Role" - }, - "slug": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "status": { - "readOnly": true - }, - "tags": { - "$ref": "#/components/schemas/DashboardRestApi.get_list.Tag" - }, - "thumbnail_url": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "DashboardRestApi.get_list.Role": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "DashboardRestApi.get_list.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "DashboardRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DashboardRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DashboardRestApi.get_list.User2": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DashboardRestApi.post": { - "properties": { - "certification_details": { - "description": "Details of the certification", - "nullable": true, - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this dashboard", - "nullable": true, - "type": "string" - }, - "css": { - "description": "Override CSS for the dashboard.", - "type": "string" - }, - "dashboard_title": { - "description": "A title for the dashboard.", - "maxLength": 500, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "json_metadata": { - "description": "This JSON object is generated dynamically when clicking the save or overwrite button in the dashboard view. It is exposed here for reference and for power users who may want to alter specific parameters.", - "type": "string" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this dashboard. If left empty you will be one of the owners of the dashboard.", - "type": "integer" - }, - "type": "array" - }, - "position_json": { - "description": "This json object describes the positioning of the widgets in the dashboard. It is dynamically generated when adjusting the widgets size and positions by using drag & drop in the dashboard view", - "type": "string" - }, - "published": { - "description": "Determines whether or not this dashboard is visible in the list of all dashboards.", - "type": "boolean" - }, - "roles": { - "items": { - "description": "Roles is a list which defines access to the dashboard. These roles are always applied in addition to restrictions on dataset level access. If no roles defined then the dashboard is available to all roles.", - "type": "integer" - }, - "type": "array" - }, - "slug": { - "description": "Unique identifying part for the web address of the dashboard.", - "maxLength": 255, - "minLength": 1, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "DashboardRestApi.put": { - "properties": { - "certification_details": { - "description": "Details of the certification", - "nullable": true, - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this dashboard", - "nullable": true, - "type": "string" - }, - "css": { - "description": "Override CSS for the dashboard.", - "nullable": true, - "type": "string" - }, - "dashboard_title": { - "description": "A title for the dashboard.", - "maxLength": 500, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "json_metadata": { - "description": "This JSON object is generated dynamically when clicking the save or overwrite button in the dashboard view. It is exposed here for reference and for power users who may want to alter specific parameters.", - "nullable": true, - "type": "string" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this dashboard. If left empty you will be one of the owners of the dashboard.", - "nullable": true, - "type": "integer" - }, - "type": "array" - }, - "position_json": { - "description": "This json object describes the positioning of the widgets in the dashboard. It is dynamically generated when adjusting the widgets size and positions by using drag & drop in the dashboard view", - "nullable": true, - "type": "string" - }, - "published": { - "description": "Determines whether or not this dashboard is visible in the list of all dashboards.", - "nullable": true, - "type": "boolean" - }, - "roles": { - "items": { - "description": "Roles is a list which defines access to the dashboard. These roles are always applied in addition to restrictions on dataset level access. If no roles defined then the dashboard is available to all roles.", - "nullable": true, - "type": "integer" - }, - "type": "array" - }, - "slug": { - "description": "Unique identifying part for the web address of the dashboard.", - "maxLength": 255, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "tags": { - "items": { - "description": "Tags to be associated with the dashboard", - "nullable": true, - "type": "integer" - }, - "type": "array" - } - }, - "type": "object" - }, - "Database": { - "properties": { - "allow_multi_catalog": { - "type": "boolean" - }, - "allows_cost_estimate": { - "type": "boolean" - }, - "allows_subquery": { - "type": "boolean" - }, - "allows_virtual_table_explore": { - "type": "boolean" - }, - "backend": { - "type": "string" - }, - "disable_data_preview": { - "type": "boolean" - }, - "disable_drill_to_detail": { - "type": "boolean" - }, - "explore_database_id": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "Database1": { - "properties": { - "database_name": { - "type": "string" - } - }, - "type": "object" - }, - "DatabaseConnectionSchema": { - "properties": { - "allow_ctas": { - "description": "Allow CREATE TABLE AS option in SQL Lab", - "type": "boolean" - }, - "allow_cvas": { - "description": "Allow CREATE VIEW AS option in SQL Lab", - "type": "boolean" - }, - "allow_dml": { - "description": "Allow users to run non-SELECT statements (UPDATE, DELETE, CREATE, ...) in SQL Lab", - "type": "boolean" - }, - "allow_file_upload": { - "description": "Allow to upload CSV file data into this databaseIf selected, please set the schemas allowed for csv upload in Extra.", - "type": "boolean" - }, - "allow_run_async": { - "description": "Operate the database in asynchronous mode, meaning that the queries are executed on remote workers as opposed to on the web server itself. This assumes that you have a Celery worker setup as well as a results backend. Refer to the installation docs for more information.", - "type": "boolean" - }, - "backend": { - "description": "SQLAlchemy engine to use", - "nullable": true, - "type": "string" - }, - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for charts of this database. A timeout of 0 indicates that the cache never expires. Note this defaults to the global timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "configuration_method": { - "description": "Configuration_method is used on the frontend to inform the backend whether to explode parameters or to provide only a sqlalchemy_uri.", - "type": "string" - }, - "database_name": { - "description": "A database name to identify this connection.", - "maxLength": 250, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "driver": { - "description": "SQLAlchemy driver to use", - "nullable": true, - "type": "string" - }, - "engine_information": { - "$ref": "#/components/schemas/EngineInformation" - }, - "expose_in_sqllab": { - "description": "Expose this database to SQLLab", - "type": "boolean" - }, - "extra": { - "description": "

JSON string containing extra configuration elements.
1. The engine_params object gets unpacked into the sqlalchemy.create_engine call, while the metadata_params gets unpacked into the sqlalchemy.MetaData call.
2. The metadata_cache_timeout is a cache timeout setting in seconds for metadata fetch of this database. Specify it as \"metadata_cache_timeout\": {\"schema_cache_timeout\": 600, \"table_cache_timeout\": 600}. If unset, cache will not be enabled for the functionality. A timeout of 0 indicates that the cache never expires.
3. The schemas_allowed_for_file_upload is a comma separated list of schemas that CSVs are allowed to upload to. Specify it as \"schemas_allowed_for_file_upload\": [\"public\", \"csv_upload\"]. If database flavor does not support schema or any schema is allowed to be accessed, just leave the list empty
4. The version field is a string specifying the this db's version. This should be used with Presto DBs so that the syntax is correct
5. The allows_virtual_table_explore field is a boolean specifying whether or not the Explore button in SQL Lab results is shown.
6. The disable_data_preview field is a boolean specifying whether or not data preview queries will be run when fetching table metadata in SQL Lab.7. The disable_drill_to_detail field is a boolean specifying whether or notdrill to detail is disabled for the database.8. The allow_multi_catalog indicates if the database allows changing the default catalog when running queries and creating datasets.

", - "type": "string" - }, - "force_ctas_schema": { - "description": "When allowing CREATE TABLE AS option in SQL Lab, this option forces the table to be created in this schema", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "id": { - "description": "Database ID (for updates)", - "type": "integer" - }, - "impersonate_user": { - "description": "If Presto, all the queries in SQL Lab are going to be executed as the currently logged on user who must have permission to run them.
If Hive and hive.server2.enable.doAs is enabled, will run the queries as service account, but impersonate the currently logged on user via hive.server2.proxy.user property.", - "type": "boolean" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "masked_encrypted_extra": { - "description": "

JSON string containing additional connection configuration.
This is used to provide connection information for systems like Hive, Presto, and BigQuery, which do not conform to the username:password syntax normally used by SQLAlchemy.

", - "nullable": true, - "type": "string" - }, - "parameters": { - "additionalProperties": {}, - "description": "DB-specific parameters for configuration", - "type": "object" - }, - "parameters_schema": { - "additionalProperties": {}, - "description": "JSONSchema for configuring the database by parameters instead of SQLAlchemy URI", - "type": "object" - }, - "server_cert": { - "description": "

Optional CA_BUNDLE contents to validate HTTPS requests. Only available on certain database engines.

", - "nullable": true, - "type": "string" - }, - "sqlalchemy_uri": { - "description": "

Refer to the SqlAlchemy docs for more information on how to structure your URI.

", - "maxLength": 1024, - "minLength": 1, - "type": "string" - }, - "ssh_tunnel": { - "allOf": [ - { - "$ref": "#/components/schemas/DatabaseSSHTunnel" - } - ], - "nullable": true - }, - "uuid": { - "type": "string" - } - }, - "type": "object" - }, - "DatabaseFunctionNamesResponse": { - "properties": { - "function_names": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatabaseRelatedChart": { - "properties": { - "id": { - "type": "integer" - }, - "slice_name": { - "type": "string" - }, - "viz_type": { - "type": "string" - } - }, - "type": "object" - }, - "DatabaseRelatedCharts": { - "properties": { - "count": { - "description": "Chart count", - "type": "integer" - }, - "result": { - "description": "A list of dashboards", - "items": { - "$ref": "#/components/schemas/DatabaseRelatedChart" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatabaseRelatedDashboard": { - "properties": { - "id": { - "type": "integer" - }, - "json_metadata": { - "type": "object" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - } - }, - "type": "object" - }, - "DatabaseRelatedDashboards": { - "properties": { - "count": { - "description": "Dashboard count", - "type": "integer" - }, - "result": { - "description": "A list of dashboards", - "items": { - "$ref": "#/components/schemas/DatabaseRelatedDashboard" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatabaseRelatedObjectsResponse": { - "properties": { - "charts": { - "$ref": "#/components/schemas/DatabaseRelatedCharts" - }, - "dashboards": { - "$ref": "#/components/schemas/DatabaseRelatedDashboards" - } - }, - "type": "object" - }, - "DatabaseRestApi.get": { - "properties": { - "allow_ctas": { - "nullable": true, - "type": "boolean" - }, - "allow_cvas": { - "nullable": true, - "type": "boolean" - }, - "allow_dml": { - "nullable": true, - "type": "boolean" - }, - "allow_file_upload": { - "nullable": true, - "type": "boolean" - }, - "allow_run_async": { - "nullable": true, - "type": "boolean" - }, - "backend": { - "readOnly": true - }, - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "configuration_method": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "database_name": { - "maxLength": 250, - "type": "string" - }, - "driver": { - "readOnly": true - }, - "engine_information": { - "readOnly": true - }, - "expose_in_sqllab": { - "nullable": true, - "type": "boolean" - }, - "force_ctas_schema": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "impersonate_user": { - "nullable": true, - "type": "boolean" - }, - "is_managed_externally": { - "type": "boolean" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "DatabaseRestApi.get_list": { - "properties": { - "allow_ctas": { - "nullable": true, - "type": "boolean" - }, - "allow_cvas": { - "nullable": true, - "type": "boolean" - }, - "allow_dml": { - "nullable": true, - "type": "boolean" - }, - "allow_file_upload": { - "nullable": true, - "type": "boolean" - }, - "allow_multi_catalog": { - "readOnly": true - }, - "allow_run_async": { - "nullable": true, - "type": "boolean" - }, - "allows_cost_estimate": { - "readOnly": true - }, - "allows_subquery": { - "readOnly": true - }, - "allows_virtual_table_explore": { - "readOnly": true - }, - "backend": { - "readOnly": true - }, - "changed_by": { - "$ref": "#/components/schemas/DatabaseRestApi.get_list.User" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/DatabaseRestApi.get_list.User1" - }, - "database_name": { - "maxLength": 250, - "type": "string" - }, - "disable_data_preview": { - "readOnly": true - }, - "disable_drill_to_detail": { - "readOnly": true - }, - "engine_information": { - "readOnly": true - }, - "explore_database_id": { - "readOnly": true - }, - "expose_in_sqllab": { - "nullable": true, - "type": "boolean" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "force_ctas_schema": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "DatabaseRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatabaseRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatabaseRestApi.post": { - "properties": { - "allow_ctas": { - "description": "Allow CREATE TABLE AS option in SQL Lab", - "type": "boolean" - }, - "allow_cvas": { - "description": "Allow CREATE VIEW AS option in SQL Lab", - "type": "boolean" - }, - "allow_dml": { - "description": "Allow users to run non-SELECT statements (UPDATE, DELETE, CREATE, ...) in SQL Lab", - "type": "boolean" - }, - "allow_file_upload": { - "description": "Allow to upload CSV file data into this databaseIf selected, please set the schemas allowed for csv upload in Extra.", - "type": "boolean" - }, - "allow_run_async": { - "description": "Operate the database in asynchronous mode, meaning that the queries are executed on remote workers as opposed to on the web server itself. This assumes that you have a Celery worker setup as well as a results backend. Refer to the installation docs for more information.", - "type": "boolean" - }, - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for charts of this database. A timeout of 0 indicates that the cache never expires. Note this defaults to the global timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "configuration_method": { - "default": "sqlalchemy_form", - "description": "Configuration_method is used on the frontend to inform the backend whether to explode parameters or to provide only a sqlalchemy_uri.", - "enum": [ - "sqlalchemy_form", - "dynamic_form" - ] - }, - "database_name": { - "description": "A database name to identify this connection.", - "maxLength": 250, - "minLength": 1, - "type": "string" - }, - "driver": { - "description": "SQLAlchemy driver to use", - "nullable": true, - "type": "string" - }, - "engine": { - "description": "SQLAlchemy engine to use", - "nullable": true, - "type": "string" - }, - "expose_in_sqllab": { - "description": "Expose this database to SQLLab", - "type": "boolean" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "extra": { - "description": "

JSON string containing extra configuration elements.
1. The engine_params object gets unpacked into the sqlalchemy.create_engine call, while the metadata_params gets unpacked into the sqlalchemy.MetaData call.
2. The metadata_cache_timeout is a cache timeout setting in seconds for metadata fetch of this database. Specify it as \"metadata_cache_timeout\": {\"schema_cache_timeout\": 600, \"table_cache_timeout\": 600}. If unset, cache will not be enabled for the functionality. A timeout of 0 indicates that the cache never expires.
3. The schemas_allowed_for_file_upload is a comma separated list of schemas that CSVs are allowed to upload to. Specify it as \"schemas_allowed_for_file_upload\": [\"public\", \"csv_upload\"]. If database flavor does not support schema or any schema is allowed to be accessed, just leave the list empty
4. The version field is a string specifying the this db's version. This should be used with Presto DBs so that the syntax is correct
5. The allows_virtual_table_explore field is a boolean specifying whether or not the Explore button in SQL Lab results is shown.
6. The disable_data_preview field is a boolean specifying whether or not data preview queries will be run when fetching table metadata in SQL Lab.7. The disable_drill_to_detail field is a boolean specifying whether or notdrill to detail is disabled for the database.8. The allow_multi_catalog indicates if the database allows changing the default catalog when running queries and creating datasets.

", - "type": "string" - }, - "force_ctas_schema": { - "description": "When allowing CREATE TABLE AS option in SQL Lab, this option forces the table to be created in this schema", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "impersonate_user": { - "description": "If Presto, all the queries in SQL Lab are going to be executed as the currently logged on user who must have permission to run them.
If Hive and hive.server2.enable.doAs is enabled, will run the queries as service account, but impersonate the currently logged on user via hive.server2.proxy.user property.", - "type": "boolean" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "masked_encrypted_extra": { - "description": "

JSON string containing additional connection configuration.
This is used to provide connection information for systems like Hive, Presto, and BigQuery, which do not conform to the username:password syntax normally used by SQLAlchemy.

", - "nullable": true, - "type": "string" - }, - "parameters": { - "additionalProperties": {}, - "description": "DB-specific parameters for configuration", - "type": "object" - }, - "server_cert": { - "description": "

Optional CA_BUNDLE contents to validate HTTPS requests. Only available on certain database engines.

", - "nullable": true, - "type": "string" - }, - "sqlalchemy_uri": { - "description": "

Refer to the SqlAlchemy docs for more information on how to structure your URI.

", - "maxLength": 1024, - "minLength": 1, - "type": "string" - }, - "ssh_tunnel": { - "allOf": [ - { - "$ref": "#/components/schemas/DatabaseSSHTunnel" - } - ], - "nullable": true - }, - "uuid": { - "type": "string" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "DatabaseRestApi.put": { - "properties": { - "allow_ctas": { - "description": "Allow CREATE TABLE AS option in SQL Lab", - "type": "boolean" - }, - "allow_cvas": { - "description": "Allow CREATE VIEW AS option in SQL Lab", - "type": "boolean" - }, - "allow_dml": { - "description": "Allow users to run non-SELECT statements (UPDATE, DELETE, CREATE, ...) in SQL Lab", - "type": "boolean" - }, - "allow_file_upload": { - "description": "Allow to upload CSV file data into this databaseIf selected, please set the schemas allowed for csv upload in Extra.", - "type": "boolean" - }, - "allow_run_async": { - "description": "Operate the database in asynchronous mode, meaning that the queries are executed on remote workers as opposed to on the web server itself. This assumes that you have a Celery worker setup as well as a results backend. Refer to the installation docs for more information.", - "type": "boolean" - }, - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for charts of this database. A timeout of 0 indicates that the cache never expires. Note this defaults to the global timeout if undefined.", - "nullable": true, - "type": "integer" - }, - "configuration_method": { - "default": "sqlalchemy_form", - "description": "Configuration_method is used on the frontend to inform the backend whether to explode parameters or to provide only a sqlalchemy_uri.", - "enum": [ - "sqlalchemy_form", - "dynamic_form" - ] - }, - "database_name": { - "description": "A database name to identify this connection.", - "maxLength": 250, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "driver": { - "description": "SQLAlchemy driver to use", - "nullable": true, - "type": "string" - }, - "engine": { - "description": "SQLAlchemy engine to use", - "nullable": true, - "type": "string" - }, - "expose_in_sqllab": { - "description": "Expose this database to SQLLab", - "type": "boolean" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "extra": { - "description": "

JSON string containing extra configuration elements.
1. The engine_params object gets unpacked into the sqlalchemy.create_engine call, while the metadata_params gets unpacked into the sqlalchemy.MetaData call.
2. The metadata_cache_timeout is a cache timeout setting in seconds for metadata fetch of this database. Specify it as \"metadata_cache_timeout\": {\"schema_cache_timeout\": 600, \"table_cache_timeout\": 600}. If unset, cache will not be enabled for the functionality. A timeout of 0 indicates that the cache never expires.
3. The schemas_allowed_for_file_upload is a comma separated list of schemas that CSVs are allowed to upload to. Specify it as \"schemas_allowed_for_file_upload\": [\"public\", \"csv_upload\"]. If database flavor does not support schema or any schema is allowed to be accessed, just leave the list empty
4. The version field is a string specifying the this db's version. This should be used with Presto DBs so that the syntax is correct
5. The allows_virtual_table_explore field is a boolean specifying whether or not the Explore button in SQL Lab results is shown.
6. The disable_data_preview field is a boolean specifying whether or not data preview queries will be run when fetching table metadata in SQL Lab.7. The disable_drill_to_detail field is a boolean specifying whether or notdrill to detail is disabled for the database.8. The allow_multi_catalog indicates if the database allows changing the default catalog when running queries and creating datasets.

", - "type": "string" - }, - "force_ctas_schema": { - "description": "When allowing CREATE TABLE AS option in SQL Lab, this option forces the table to be created in this schema", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "impersonate_user": { - "description": "If Presto, all the queries in SQL Lab are going to be executed as the currently logged on user who must have permission to run them.
If Hive and hive.server2.enable.doAs is enabled, will run the queries as service account, but impersonate the currently logged on user via hive.server2.proxy.user property.", - "type": "boolean" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "masked_encrypted_extra": { - "description": "

JSON string containing additional connection configuration.
This is used to provide connection information for systems like Hive, Presto, and BigQuery, which do not conform to the username:password syntax normally used by SQLAlchemy.

", - "nullable": true, - "type": "string" - }, - "parameters": { - "additionalProperties": {}, - "description": "DB-specific parameters for configuration", - "type": "object" - }, - "server_cert": { - "description": "

Optional CA_BUNDLE contents to validate HTTPS requests. Only available on certain database engines.

", - "nullable": true, - "type": "string" - }, - "sqlalchemy_uri": { - "description": "

Refer to the SqlAlchemy docs for more information on how to structure your URI.

", - "maxLength": 1024, - "minLength": 0, - "type": "string" - }, - "ssh_tunnel": { - "allOf": [ - { - "$ref": "#/components/schemas/DatabaseSSHTunnel" - } - ], - "nullable": true - }, - "uuid": { - "type": "string" - } - }, - "type": "object" - }, - "DatabaseSSHTunnel": { - "properties": { - "id": { - "description": "SSH Tunnel ID (for updates)", - "nullable": true, - "type": "integer" - }, - "password": { - "type": "string" - }, - "private_key": { - "type": "string" - }, - "private_key_password": { - "type": "string" - }, - "server_address": { - "type": "string" - }, - "server_port": { - "type": "integer" - }, - "username": { - "type": "string" - } - }, - "type": "object" - }, - "DatabaseSchemaAccessForFileUploadResponse": { - "properties": { - "schemas": { - "description": "The list of schemas allowed for the database to upload information", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatabaseTablesResponse": { - "properties": { - "extra": { - "description": "Extra data used to specify column metadata", - "type": "object" - }, - "type": { - "description": "table or view", - "type": "string" - }, - "value": { - "description": "The table or view name", - "type": "string" - } - }, - "type": "object" - }, - "DatabaseTestConnectionSchema": { - "properties": { - "configuration_method": { - "default": "sqlalchemy_form", - "description": "Configuration_method is used on the frontend to inform the backend whether to explode parameters or to provide only a sqlalchemy_uri.", - "enum": [ - "sqlalchemy_form", - "dynamic_form" - ] - }, - "database_name": { - "description": "A database name to identify this connection.", - "maxLength": 250, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "driver": { - "description": "SQLAlchemy driver to use", - "nullable": true, - "type": "string" - }, - "engine": { - "description": "SQLAlchemy engine to use", - "nullable": true, - "type": "string" - }, - "extra": { - "description": "

JSON string containing extra configuration elements.
1. The engine_params object gets unpacked into the sqlalchemy.create_engine call, while the metadata_params gets unpacked into the sqlalchemy.MetaData call.
2. The metadata_cache_timeout is a cache timeout setting in seconds for metadata fetch of this database. Specify it as \"metadata_cache_timeout\": {\"schema_cache_timeout\": 600, \"table_cache_timeout\": 600}. If unset, cache will not be enabled for the functionality. A timeout of 0 indicates that the cache never expires.
3. The schemas_allowed_for_file_upload is a comma separated list of schemas that CSVs are allowed to upload to. Specify it as \"schemas_allowed_for_file_upload\": [\"public\", \"csv_upload\"]. If database flavor does not support schema or any schema is allowed to be accessed, just leave the list empty
4. The version field is a string specifying the this db's version. This should be used with Presto DBs so that the syntax is correct
5. The allows_virtual_table_explore field is a boolean specifying whether or not the Explore button in SQL Lab results is shown.
6. The disable_data_preview field is a boolean specifying whether or not data preview queries will be run when fetching table metadata in SQL Lab.7. The disable_drill_to_detail field is a boolean specifying whether or notdrill to detail is disabled for the database.8. The allow_multi_catalog indicates if the database allows changing the default catalog when running queries and creating datasets.

", - "type": "string" - }, - "impersonate_user": { - "description": "If Presto, all the queries in SQL Lab are going to be executed as the currently logged on user who must have permission to run them.
If Hive and hive.server2.enable.doAs is enabled, will run the queries as service account, but impersonate the currently logged on user via hive.server2.proxy.user property.", - "type": "boolean" - }, - "masked_encrypted_extra": { - "description": "

JSON string containing additional connection configuration.
This is used to provide connection information for systems like Hive, Presto, and BigQuery, which do not conform to the username:password syntax normally used by SQLAlchemy.

", - "nullable": true, - "type": "string" - }, - "parameters": { - "additionalProperties": {}, - "description": "DB-specific parameters for configuration", - "type": "object" - }, - "server_cert": { - "description": "

Optional CA_BUNDLE contents to validate HTTPS requests. Only available on certain database engines.

", - "nullable": true, - "type": "string" - }, - "sqlalchemy_uri": { - "description": "

Refer to the SqlAlchemy docs for more information on how to structure your URI.

", - "maxLength": 1024, - "minLength": 1, - "type": "string" - }, - "ssh_tunnel": { - "allOf": [ - { - "$ref": "#/components/schemas/DatabaseSSHTunnel" - } - ], - "nullable": true - } - }, - "type": "object" - }, - "DatabaseValidateParametersSchema": { - "properties": { - "catalog": { - "additionalProperties": { - "nullable": true - }, - "description": "Gsheets specific column for managing label to sheet urls", - "type": "object" - }, - "configuration_method": { - "description": "Configuration_method is used on the frontend to inform the backend whether to explode parameters or to provide only a sqlalchemy_uri.", - "enum": [ - "sqlalchemy_form", - "dynamic_form" - ] - }, - "database_name": { - "description": "A database name to identify this connection.", - "maxLength": 250, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "driver": { - "description": "SQLAlchemy driver to use", - "nullable": true, - "type": "string" - }, - "engine": { - "description": "SQLAlchemy engine to use", - "type": "string" - }, - "extra": { - "description": "

JSON string containing extra configuration elements.
1. The engine_params object gets unpacked into the sqlalchemy.create_engine call, while the metadata_params gets unpacked into the sqlalchemy.MetaData call.
2. The metadata_cache_timeout is a cache timeout setting in seconds for metadata fetch of this database. Specify it as \"metadata_cache_timeout\": {\"schema_cache_timeout\": 600, \"table_cache_timeout\": 600}. If unset, cache will not be enabled for the functionality. A timeout of 0 indicates that the cache never expires.
3. The schemas_allowed_for_file_upload is a comma separated list of schemas that CSVs are allowed to upload to. Specify it as \"schemas_allowed_for_file_upload\": [\"public\", \"csv_upload\"]. If database flavor does not support schema or any schema is allowed to be accessed, just leave the list empty
4. The version field is a string specifying the this db's version. This should be used with Presto DBs so that the syntax is correct
5. The allows_virtual_table_explore field is a boolean specifying whether or not the Explore button in SQL Lab results is shown.
6. The disable_data_preview field is a boolean specifying whether or not data preview queries will be run when fetching table metadata in SQL Lab.7. The disable_drill_to_detail field is a boolean specifying whether or notdrill to detail is disabled for the database.8. The allow_multi_catalog indicates if the database allows changing the default catalog when running queries and creating datasets.

", - "type": "string" - }, - "id": { - "description": "Database ID (for updates)", - "nullable": true, - "type": "integer" - }, - "impersonate_user": { - "description": "If Presto, all the queries in SQL Lab are going to be executed as the currently logged on user who must have permission to run them.
If Hive and hive.server2.enable.doAs is enabled, will run the queries as service account, but impersonate the currently logged on user via hive.server2.proxy.user property.", - "type": "boolean" - }, - "masked_encrypted_extra": { - "description": "

JSON string containing additional connection configuration.
This is used to provide connection information for systems like Hive, Presto, and BigQuery, which do not conform to the username:password syntax normally used by SQLAlchemy.

", - "nullable": true, - "type": "string" - }, - "parameters": { - "additionalProperties": { - "nullable": true - }, - "description": "DB-specific parameters for configuration", - "type": "object" - }, - "server_cert": { - "description": "

Optional CA_BUNDLE contents to validate HTTPS requests. Only available on certain database engines.

", - "nullable": true, - "type": "string" - } - }, - "required": [ - "configuration_method", - "engine" - ], - "type": "object" - }, - "Dataset": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this dataset.", - "type": "integer" - }, - "column_formats": { - "description": "Column formats.", - "type": "object" - }, - "columns": { - "description": "Columns metadata.", - "items": { - "type": "object" - }, - "type": "array" - }, - "database": { - "description": "Database associated with the dataset.", - "type": "object" - }, - "datasource_name": { - "description": "Dataset name.", - "type": "string" - }, - "default_endpoint": { - "description": "Default endpoint for the dataset.", - "type": "string" - }, - "description": { - "description": "Dataset description.", - "type": "string" - }, - "edit_url": { - "description": "The URL for editing the dataset.", - "type": "string" - }, - "extra": { - "description": "JSON string containing extra configuration elements.", - "type": "object" - }, - "fetch_values_predicate": { - "description": "Predicate used when fetching values from the dataset.", - "type": "string" - }, - "filter_select": { - "description": "SELECT filter applied to the dataset.", - "type": "boolean" - }, - "filter_select_enabled": { - "description": "If the SELECT filter is enabled.", - "type": "boolean" - }, - "granularity_sqla": { - "description": "Name of temporal column used for time filtering for SQL datasources. This field is deprecated, use `granularity` instead.", - "items": { - "items": { - "type": "object" - }, - "type": "array" - }, - "type": "array" - }, - "health_check_message": { - "description": "Health check message.", - "type": "string" - }, - "id": { - "description": "Dataset ID.", - "type": "integer" - }, - "is_sqllab_view": { - "description": "If the dataset is a SQL Lab view.", - "type": "boolean" - }, - "main_dttm_col": { - "description": "The main temporal column.", - "type": "string" - }, - "metrics": { - "description": "Dataset metrics.", - "items": { - "type": "object" - }, - "type": "array" - }, - "name": { - "description": "Dataset name.", - "type": "string" - }, - "offset": { - "description": "Dataset offset.", - "type": "integer" - }, - "order_by_choices": { - "description": "List of order by columns.", - "items": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "array" - }, - "owners": { - "description": "List of owners identifiers", - "items": { - "type": "integer" - }, - "type": "array" - }, - "params": { - "description": "Extra params for the dataset.", - "type": "object" - }, - "perm": { - "description": "Permission expression.", - "type": "string" - }, - "schema": { - "description": "Dataset schema.", - "type": "string" - }, - "select_star": { - "description": "Select all clause.", - "type": "string" - }, - "sql": { - "description": "A SQL statement that defines the dataset.", - "type": "string" - }, - "table_name": { - "description": "The name of the table associated with the dataset.", - "type": "string" - }, - "template_params": { - "description": "Table template params.", - "type": "object" - }, - "time_grain_sqla": { - "description": "List of temporal granularities supported by the dataset.", - "items": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "array" - }, - "type": { - "description": "Dataset type.", - "type": "string" - }, - "uid": { - "description": "Dataset unique identifier.", - "type": "string" - }, - "verbose_map": { - "description": "Mapping from raw name to verbose name.", - "type": "object" - } - }, - "type": "object" - }, - "DatasetCacheWarmUpRequestSchema": { - "properties": { - "dashboard_id": { - "description": "The ID of the dashboard to get filters for when warming cache", - "type": "integer" - }, - "db_name": { - "description": "The name of the database where the table is located", - "type": "string" - }, - "extra_filters": { - "description": "Extra filters to apply when warming up cache", - "type": "string" - }, - "table_name": { - "description": "The name of the table to warm up cache for", - "type": "string" - } - }, - "required": [ - "db_name", - "table_name" - ], - "type": "object" - }, - "DatasetCacheWarmUpResponseSchema": { - "properties": { - "result": { - "description": "A list of each chart's warmup status and errors if any", - "items": { - "$ref": "#/components/schemas/DatasetCacheWarmUpResponseSingle" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatasetCacheWarmUpResponseSingle": { - "properties": { - "chart_id": { - "description": "The ID of the chart the status belongs to", - "type": "integer" - }, - "viz_error": { - "description": "Error that occurred when warming cache for chart", - "type": "string" - }, - "viz_status": { - "description": "Status of the underlying query for the viz", - "type": "string" - } - }, - "type": "object" - }, - "DatasetColumnsPut": { - "properties": { - "advanced_data_type": { - "maxLength": 255, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "column_name": { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "expression": { - "nullable": true, - "type": "string" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "filterable": { - "type": "boolean" - }, - "groupby": { - "type": "boolean" - }, - "id": { - "type": "integer" - }, - "is_active": { - "nullable": true, - "type": "boolean" - }, - "is_dttm": { - "nullable": true, - "type": "boolean" - }, - "python_date_format": { - "maxLength": 255, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "type": { - "nullable": true, - "type": "string" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "verbose_name": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "column_name" - ], - "type": "object" - }, - "DatasetColumnsRestApi.get": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetColumnsRestApi.get_list": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetColumnsRestApi.post": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetColumnsRestApi.put": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetDuplicateSchema": { - "properties": { - "base_model_id": { - "type": "integer" - }, - "table_name": { - "maxLength": 250, - "minLength": 1, - "type": "string" - } - }, - "required": [ - "base_model_id", - "table_name" - ], - "type": "object" - }, - "DatasetMetricRestApi.get": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetMetricRestApi.get_list": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetMetricRestApi.post": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetMetricRestApi.put": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "DatasetMetricsPut": { - "properties": { - "currency": { - "maxLength": 128, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "d3format": { - "maxLength": 128, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "expression": { - "type": "string" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "metric_name": { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - "metric_type": { - "maxLength": 32, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "verbose_name": { - "nullable": true, - "type": "string" - }, - "warning_text": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "expression", - "metric_name" - ], - "type": "object" - }, - "DatasetRelatedChart": { - "properties": { - "id": { - "type": "integer" - }, - "slice_name": { - "type": "string" - }, - "viz_type": { - "type": "string" - } - }, - "type": "object" - }, - "DatasetRelatedCharts": { - "properties": { - "count": { - "description": "Chart count", - "type": "integer" - }, - "result": { - "description": "A list of dashboards", - "items": { - "$ref": "#/components/schemas/DatasetRelatedChart" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatasetRelatedDashboard": { - "properties": { - "id": { - "type": "integer" - }, - "json_metadata": { - "type": "object" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - } - }, - "type": "object" - }, - "DatasetRelatedDashboards": { - "properties": { - "count": { - "description": "Dashboard count", - "type": "integer" - }, - "result": { - "description": "A list of dashboards", - "items": { - "$ref": "#/components/schemas/DatasetRelatedDashboard" - }, - "type": "array" - } - }, - "type": "object" - }, - "DatasetRelatedObjectsResponse": { - "properties": { - "charts": { - "$ref": "#/components/schemas/DatasetRelatedCharts" - }, - "dashboards": { - "$ref": "#/components/schemas/DatasetRelatedDashboards" - } - }, - "type": "object" - }, - "DatasetRestApi.get": { - "properties": { - "always_filter_main_dttm": { - "nullable": true, - "type": "boolean" - }, - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "catalog": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/DatasetRestApi.get.User2" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "changed_on_humanized": { - "readOnly": true - }, - "column_formats": { - "readOnly": true - }, - "columns": { - "$ref": "#/components/schemas/DatasetRestApi.get.TableColumn" - }, - "created_by": { - "$ref": "#/components/schemas/DatasetRestApi.get.User1" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "created_on_humanized": { - "readOnly": true - }, - "database": { - "$ref": "#/components/schemas/DatasetRestApi.get.Database" - }, - "datasource_name": { - "readOnly": true - }, - "datasource_type": { - "readOnly": true - }, - "default_endpoint": { - "nullable": true, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "fetch_values_predicate": { - "nullable": true, - "type": "string" - }, - "filter_select_enabled": { - "nullable": true, - "type": "boolean" - }, - "folders": { - "nullable": true - }, - "granularity_sqla": { - "readOnly": true - }, - "id": { - "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "is_sqllab_view": { - "nullable": true, - "type": "boolean" - }, - "kind": { - "readOnly": true - }, - "main_dttm_col": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "metrics": { - "$ref": "#/components/schemas/DatasetRestApi.get.SqlMetric" - }, - "name": { - "readOnly": true - }, - "normalize_columns": { - "nullable": true, - "type": "boolean" - }, - "offset": { - "nullable": true, - "type": "integer" - }, - "order_by_choices": { - "readOnly": true - }, - "owners": { - "$ref": "#/components/schemas/DatasetRestApi.get.User" - }, - "schema": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "select_star": { - "readOnly": true - }, - "sql": { - "nullable": true, - "type": "string" - }, - "table_name": { - "maxLength": 250, - "type": "string" - }, - "template_params": { - "nullable": true, - "type": "string" - }, - "time_grain_sqla": { - "readOnly": true - }, - "uid": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "verbose_map": { - "readOnly": true - } - }, - "required": [ - "columns", - "database", - "metrics", - "table_name" - ], - "type": "object" - }, - "DatasetRestApi.get.Database": { - "properties": { - "allow_multi_catalog": { - "readOnly": true - }, - "backend": { - "readOnly": true - }, - "database_name": { - "maxLength": 250, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "DatasetRestApi.get.SqlMetric": { - "properties": { - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "currency": { - "nullable": true - }, - "d3format": { - "maxLength": 128, - "nullable": true, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "expression": { - "type": "string" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "metric_name": { - "maxLength": 255, - "type": "string" - }, - "metric_type": { - "maxLength": 32, - "nullable": true, - "type": "string" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "verbose_name": { - "maxLength": 1024, - "nullable": true, - "type": "string" - }, - "warning_text": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "expression", - "metric_name" - ], - "type": "object" - }, - "DatasetRestApi.get.TableColumn": { - "properties": { - "advanced_data_type": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "column_name": { - "maxLength": 255, - "type": "string" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "expression": { - "nullable": true, - "type": "string" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "filterable": { - "nullable": true, - "type": "boolean" - }, - "groupby": { - "nullable": true, - "type": "boolean" - }, - "id": { - "type": "integer" - }, - "is_active": { - "nullable": true, - "type": "boolean" - }, - "is_dttm": { - "nullable": true, - "type": "boolean" - }, - "python_date_format": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "type": { - "nullable": true, - "type": "string" - }, - "type_generic": { - "readOnly": true - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "verbose_name": { - "maxLength": 1024, - "nullable": true, - "type": "string" - } - }, - "required": [ - "column_name" - ], - "type": "object" - }, - "DatasetRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatasetRestApi.get.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatasetRestApi.get.User2": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatasetRestApi.get_list": { - "properties": { - "catalog": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/DatasetRestApi.get_list.User" - }, - "changed_by_name": { - "readOnly": true - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "changed_on_utc": { - "readOnly": true - }, - "database": { - "$ref": "#/components/schemas/DatasetRestApi.get_list.Database" - }, - "datasource_type": { - "readOnly": true - }, - "default_endpoint": { - "nullable": true, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "explore_url": { - "readOnly": true - }, - "extra": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "kind": { - "readOnly": true - }, - "owners": { - "$ref": "#/components/schemas/DatasetRestApi.get_list.User1" - }, - "schema": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "table_name": { - "maxLength": 250, - "type": "string" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - } - }, - "required": [ - "database", - "table_name" - ], - "type": "object" - }, - "DatasetRestApi.get_list.Database": { - "properties": { - "database_name": { - "maxLength": 250, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "DatasetRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatasetRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "DatasetRestApi.post": { - "properties": { - "always_filter_main_dttm": { - "default": false, - "type": "boolean" - }, - "catalog": { - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "database": { - "type": "integer" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "normalize_columns": { - "default": false, - "type": "boolean" - }, - "owners": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "schema": { - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "table_name": { - "maxLength": 250, - "minLength": 1, - "type": "string" - } - }, - "required": [ - "database", - "table_name" - ], - "type": "object" - }, - "DatasetRestApi.put": { - "properties": { - "always_filter_main_dttm": { - "default": false, - "type": "boolean" - }, - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "catalog": { - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "columns": { - "items": { - "$ref": "#/components/schemas/DatasetColumnsPut" - }, - "type": "array" - }, - "database_id": { - "type": "integer" - }, - "default_endpoint": { - "nullable": true, - "type": "string" - }, - "description": { - "nullable": true, - "type": "string" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "extra": { - "nullable": true, - "type": "string" - }, - "fetch_values_predicate": { - "maxLength": 1000, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "filter_select_enabled": { - "nullable": true, - "type": "boolean" - }, - "folders": { - "items": { - "$ref": "#/components/schemas/Folder" - }, - "type": "array" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "is_sqllab_view": { - "nullable": true, - "type": "boolean" - }, - "main_dttm_col": { - "nullable": true, - "type": "string" - }, - "metrics": { - "items": { - "$ref": "#/components/schemas/DatasetMetricsPut" - }, - "type": "array" - }, - "normalize_columns": { - "nullable": true, - "type": "boolean" - }, - "offset": { - "nullable": true, - "type": "integer" - }, - "owners": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "schema": { - "maxLength": 255, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "table_name": { - "maxLength": 250, - "minLength": 1, - "nullable": true, - "type": "string" - }, - "template_params": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "Datasource": { - "properties": { - "catalog": { - "description": "Datasource catalog", - "nullable": true, - "type": "string" - }, - "database_name": { - "description": "Datasource name", - "type": "string" - }, - "datasource_name": { - "description": "The datasource name.", - "type": "string" - }, - "datasource_type": { - "description": "The type of dataset/datasource identified on `datasource_id`.", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "type": "string" - }, - "schema": { - "description": "Datasource schema", - "type": "string" - } - }, - "required": [ - "datasource_type" - ], - "type": "object" - }, - "DistincResponseSchema": { - "properties": { - "count": { - "description": "The total number of distinct values", - "type": "integer" - }, - "result": { - "items": { - "$ref": "#/components/schemas/DistinctResultResponse" - }, - "type": "array" - } - }, - "type": "object" - }, - "DistinctResultResponse": { - "properties": { - "text": { - "description": "The distinct item", - "type": "string" - } - }, - "type": "object" - }, - "EmbeddedDashboardConfig": { - "properties": { - "allowed_domains": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "allowed_domains" - ], - "type": "object" - }, - "EmbeddedDashboardResponseSchema": { - "properties": { - "allowed_domains": { - "items": { - "type": "string" - }, - "type": "array" - }, - "changed_by": { - "$ref": "#/components/schemas/User1" - }, - "changed_on": { - "format": "date-time", - "type": "string" - }, - "dashboard_id": { - "type": "string" - }, - "uuid": { - "type": "string" - } - }, - "type": "object" - }, - "EmbeddedDashboardRestApi.get": { - "properties": { - "uuid": { - "format": "uuid", - "type": "string" - } - }, - "type": "object" - }, - "EmbeddedDashboardRestApi.get_list": { - "properties": { - "uuid": { - "format": "uuid", - "type": "string" - } - }, - "type": "object" - }, - "EmbeddedDashboardRestApi.post": { - "properties": { - "uuid": { - "format": "uuid", - "type": "string" - } - }, - "type": "object" - }, - "EmbeddedDashboardRestApi.put": { - "properties": { - "uuid": { - "format": "uuid", - "type": "string" - } - }, - "type": "object" - }, - "EngineInformation": { - "properties": { - "disable_ssh_tunneling": { - "description": "SSH tunnel is not available to the database", - "type": "boolean" - }, - "supports_dynamic_catalog": { - "description": "The database supports multiple catalogs in a single connection", - "type": "boolean" - }, - "supports_file_upload": { - "description": "Users can upload files to the database", - "type": "boolean" - }, - "supports_oauth2": { - "description": "The database supports OAuth2", - "type": "boolean" - } - }, - "type": "object" - }, - "EstimateQueryCostSchema": { - "properties": { - "catalog": { - "description": "The database catalog", - "nullable": true, - "type": "string" - }, - "database_id": { - "description": "The database id", - "type": "integer" - }, - "schema": { - "description": "The database schema", - "nullable": true, - "type": "string" - }, - "sql": { - "description": "The SQL query to estimate", - "type": "string" - }, - "template_params": { - "description": "The SQL query template params", - "type": "object" - } - }, - "required": [ - "database_id", - "sql" - ], - "type": "object" - }, - "ExecutePayloadSchema": { - "properties": { - "catalog": { - "nullable": true, - "type": "string" - }, - "client_id": { - "nullable": true, - "type": "string" - }, - "ctas_method": { - "nullable": true, - "type": "string" - }, - "database_id": { - "type": "integer" - }, - "expand_data": { - "nullable": true, - "type": "boolean" - }, - "json": { - "nullable": true, - "type": "boolean" - }, - "queryLimit": { - "nullable": true, - "type": "integer" - }, - "runAsync": { - "nullable": true, - "type": "boolean" - }, - "schema": { - "nullable": true, - "type": "string" - }, - "select_as_cta": { - "nullable": true, - "type": "boolean" - }, - "sql": { - "type": "string" - }, - "sql_editor_id": { - "nullable": true, - "type": "string" - }, - "tab": { - "nullable": true, - "type": "string" - }, - "templateParams": { - "nullable": true, - "type": "string" - }, - "tmp_table_name": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "database_id", - "sql" - ], - "type": "object" - }, - "ExploreContextSchema": { - "properties": { - "dataset": { - "$ref": "#/components/schemas/Dataset" - }, - "form_data": { - "description": "Form data from the Explore controls used to form the chart's data query.", - "type": "object" - }, - "message": { - "description": "Any message related to the processed request.", - "type": "string" - }, - "slice": { - "$ref": "#/components/schemas/Slice" - } - }, - "type": "object" - }, - "ExplorePermalinkStateSchema": { - "properties": { - "formData": { - "description": "Chart form data", - "type": "object" - }, - "urlParams": { - "description": "URL Parameters", - "items": { - "description": "URL Parameter key-value pair", - "nullable": true - }, - "nullable": true, - "type": "array" - } - }, - "required": [ - "formData" - ], - "type": "object" - }, - "Folder": { - "properties": { - "children": { - "items": { - "$ref": "#/components/schemas/Folder" - }, - "nullable": true, - "type": "array" - }, - "description": { - "maxLength": 1000, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "name": { - "maxLength": 250, - "minLength": 1, - "type": "string" - }, - "type": { - "enum": [ - "metric", - "column", - "folder" - ], - "type": "string" - }, - "uuid": { - "format": "uuid", - "type": "string" - } - }, - "required": [ - "uuid" - ], - "type": "object" - }, - "FormDataPostSchema": { - "properties": { - "chart_id": { - "description": "The chart ID", - "type": "integer" - }, - "datasource_id": { - "description": "The datasource ID", - "type": "integer" - }, - "datasource_type": { - "description": "The datasource type", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "type": "string" - }, - "form_data": { - "description": "Any type of JSON supported text.", - "type": "string" - } - }, - "required": [ - "datasource_id", - "datasource_type", - "form_data" - ], - "type": "object" - }, - "FormDataPutSchema": { - "properties": { - "chart_id": { - "description": "The chart ID", - "type": "integer" - }, - "datasource_id": { - "description": "The datasource ID", - "type": "integer" - }, - "datasource_type": { - "description": "The datasource type", - "enum": [ - "table", - "dataset", - "query", - "saved_query", - "view" - ], - "type": "string" - }, - "form_data": { - "description": "Any type of JSON supported text.", - "type": "string" - } - }, - "required": [ - "datasource_id", - "datasource_type", - "form_data" - ], - "type": "object" - }, - "GetFavStarIdsSchema": { - "properties": { - "result": { - "description": "A list of results for each corresponding chart in the request", - "items": { - "$ref": "#/components/schemas/ChartFavStarResponseResult" - }, - "type": "array" - } - }, - "type": "object" - }, - "GetOrCreateDatasetSchema": { - "properties": { - "always_filter_main_dttm": { - "default": false, - "type": "boolean" - }, - "catalog": { - "description": "The catalog the table belongs to", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "database_id": { - "description": "ID of database table belongs to", - "type": "integer" - }, - "normalize_columns": { - "default": false, - "type": "boolean" - }, - "schema": { - "description": "The schema the table belongs to", - "maxLength": 250, - "minLength": 0, - "nullable": true, - "type": "string" - }, - "table_name": { - "description": "Name of table", - "type": "string" - }, - "template_params": { - "description": "Template params for the table", - "type": "string" - } - }, - "required": [ - "database_id", - "table_name" - ], - "type": "object" - }, - "GuestTokenCreate": { - "properties": { - "resources": { - "items": { - "$ref": "#/components/schemas/Resource" - }, - "type": "array" - }, - "rls": { - "items": { - "$ref": "#/components/schemas/RlsRule" - }, - "type": "array" - }, - "user": { - "$ref": "#/components/schemas/User2" - } - }, - "required": [ - "resources", - "rls" - ], - "type": "object" - }, - "ImportV1Database": { - "properties": { - "allow_csv_upload": { - "type": "boolean" - }, - "allow_ctas": { - "type": "boolean" - }, - "allow_cvas": { - "type": "boolean" - }, - "allow_dml": { - "type": "boolean" - }, - "allow_run_async": { - "type": "boolean" - }, - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "database_name": { - "type": "string" - }, - "encrypted_extra": { - "nullable": true, - "type": "string" - }, - "expose_in_sqllab": { - "type": "boolean" - }, - "external_url": { - "nullable": true, - "type": "string" - }, - "extra": { - "$ref": "#/components/schemas/ImportV1DatabaseExtra" - }, - "impersonate_user": { - "type": "boolean" - }, - "is_managed_externally": { - "nullable": true, - "type": "boolean" - }, - "password": { - "nullable": true, - "type": "string" - }, - "sqlalchemy_uri": { - "type": "string" - }, - "ssh_tunnel": { - "allOf": [ - { - "$ref": "#/components/schemas/DatabaseSSHTunnel" - } - ], - "nullable": true - }, - "uuid": { - "format": "uuid", - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "database_name", - "sqlalchemy_uri", - "uuid", - "version" - ], - "type": "object" - }, - "ImportV1DatabaseExtra": { - "properties": { - "allow_multi_catalog": { - "type": "boolean" - }, - "allows_virtual_table_explore": { - "type": "boolean" - }, - "cancel_query_on_windows_unload": { - "type": "boolean" - }, - "cost_estimate_enabled": { - "type": "boolean" - }, - "disable_data_preview": { - "type": "boolean" - }, - "disable_drill_to_detail": { - "type": "boolean" - }, - "engine_params": { - "additionalProperties": {}, - "type": "object" - }, - "metadata_cache_timeout": { - "additionalProperties": { - "type": "integer" - }, - "type": "object" - }, - "metadata_params": { - "additionalProperties": {}, - "type": "object" - }, - "schema_options": { - "additionalProperties": {}, - "type": "object" - }, - "schemas_allowed_for_csv_upload": { - "items": { - "type": "string" - }, - "type": "array" - }, - "version": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "LogRestApi.get": { - "properties": { - "action": { - "maxLength": 512, - "nullable": true, - "type": "string" - }, - "dashboard_id": { - "nullable": true, - "type": "integer" - }, - "dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "duration_ms": { - "nullable": true, - "type": "integer" - }, - "json": { - "nullable": true, - "type": "string" - }, - "referrer": { - "maxLength": 1024, - "nullable": true, - "type": "string" - }, - "slice_id": { - "nullable": true, - "type": "integer" - }, - "user": { - "$ref": "#/components/schemas/LogRestApi.get.User" - }, - "user_id": { - "nullable": true, - "type": "integer" - } - }, - "type": "object" - }, - "LogRestApi.get.User": { - "properties": { - "username": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "username" - ], - "type": "object" - }, - "LogRestApi.get_list": { - "properties": { - "action": { - "maxLength": 512, - "nullable": true, - "type": "string" - }, - "dashboard_id": { - "nullable": true, - "type": "integer" - }, - "dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "duration_ms": { - "nullable": true, - "type": "integer" - }, - "json": { - "nullable": true, - "type": "string" - }, - "referrer": { - "maxLength": 1024, - "nullable": true, - "type": "string" - }, - "slice_id": { - "nullable": true, - "type": "integer" - }, - "user": { - "$ref": "#/components/schemas/LogRestApi.get_list.User" - }, - "user_id": { - "nullable": true, - "type": "integer" - } - }, - "type": "object" - }, - "LogRestApi.get_list.User": { - "properties": { - "username": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "username" - ], - "type": "object" - }, - "LogRestApi.post": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "LogRestApi.put": { - "properties": { - "action": { - "maxLength": 512, - "nullable": true, - "type": "string" - }, - "dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "json": { - "nullable": true, - "type": "string" - }, - "user": { - "nullable": true - } - }, - "type": "object" - }, - "PermissionApi.get": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionApi.get_list": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionApi.post": { - "properties": { - "name": { - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionApi.put": { - "properties": { - "name": { - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionViewMenuApi.get": { - "properties": { - "id": { - "type": "integer" - }, - "permission": { - "$ref": "#/components/schemas/PermissionViewMenuApi.get.Permission" - }, - "view_menu": { - "$ref": "#/components/schemas/PermissionViewMenuApi.get.ViewMenu" - } - }, - "type": "object" - }, - "PermissionViewMenuApi.get.Permission": { - "properties": { - "name": { - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionViewMenuApi.get.ViewMenu": { - "properties": { - "name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionViewMenuApi.get_list": { - "properties": { - "id": { - "type": "integer" - }, - "permission": { - "$ref": "#/components/schemas/PermissionViewMenuApi.get_list.Permission" - }, - "view_menu": { - "$ref": "#/components/schemas/PermissionViewMenuApi.get_list.ViewMenu" - } - }, - "type": "object" - }, - "PermissionViewMenuApi.get_list.Permission": { - "properties": { - "name": { - "maxLength": 100, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionViewMenuApi.get_list.ViewMenu": { - "properties": { - "name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "PermissionViewMenuApi.post": { - "properties": { - "permission_id": { - "nullable": true, - "type": "integer" - }, - "view_menu_id": { - "nullable": true, - "type": "integer" - } - }, - "type": "object" - }, - "PermissionViewMenuApi.put": { - "properties": { - "permission_id": { - "nullable": true, - "type": "integer" - }, - "view_menu_id": { - "nullable": true, - "type": "integer" - } - }, - "type": "object" - }, - "QueryExecutionResponseSchema": { - "properties": { - "columns": { - "items": { - "type": "object" - }, - "type": "array" - }, - "data": { - "items": { - "type": "object" - }, - "type": "array" - }, - "expanded_columns": { - "items": { - "type": "object" - }, - "type": "array" - }, - "query": { - "$ref": "#/components/schemas/QueryResult" - }, - "query_id": { - "type": "integer" - }, - "selected_columns": { - "items": { - "type": "object" - }, - "type": "array" - }, - "status": { - "type": "string" - } - }, - "type": "object" - }, - "QueryRestApi.get": { - "properties": { - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "client_id": { - "maxLength": 11, - "type": "string" - }, - "database": { - "$ref": "#/components/schemas/QueryRestApi.get.Database" - }, - "end_result_backend_time": { - "nullable": true, - "type": "number" - }, - "end_time": { - "nullable": true, - "type": "number" - }, - "error_message": { - "nullable": true, - "type": "string" - }, - "executed_sql": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "limit": { - "nullable": true, - "type": "integer" - }, - "progress": { - "nullable": true, - "type": "integer" - }, - "results_key": { - "maxLength": 64, - "nullable": true, - "type": "string" - }, - "rows": { - "nullable": true, - "type": "integer" - }, - "schema": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "select_as_cta": { - "nullable": true, - "type": "boolean" - }, - "select_as_cta_used": { - "nullable": true, - "type": "boolean" - }, - "select_sql": { - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "sql_editor_id": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "start_running_time": { - "nullable": true, - "type": "number" - }, - "start_time": { - "nullable": true, - "type": "number" - }, - "status": { - "maxLength": 16, - "nullable": true, - "type": "string" - }, - "tab_name": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "tmp_schema_name": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "tmp_table_name": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "tracking_url": { - "readOnly": true - } - }, - "required": [ - "client_id", - "database" - ], - "type": "object" - }, - "QueryRestApi.get.Database": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "QueryRestApi.get_list": { - "properties": { - "changed_on": { - "format": "date-time", - "type": "string" - }, - "database": { - "$ref": "#/components/schemas/Database1" - }, - "end_time": { - "type": "number" - }, - "executed_sql": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "rows": { - "type": "integer" - }, - "schema": { - "type": "string" - }, - "sql": { - "type": "string" - }, - "sql_tables": { - "readOnly": true - }, - "start_time": { - "type": "number" - }, - "status": { - "type": "string" - }, - "tab_name": { - "type": "string" - }, - "tmp_table_name": { - "type": "string" - }, - "tracking_url": { - "type": "string" - }, - "user": { - "$ref": "#/components/schemas/User" - } - }, - "type": "object" - }, - "QueryRestApi.post": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "QueryRestApi.put": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "QueryResult": { - "properties": { - "changed_on": { - "format": "date-time", - "type": "string" - }, - "ctas": { - "type": "boolean" - }, - "db": { - "type": "string" - }, - "dbId": { - "type": "integer" - }, - "endDttm": { - "type": "number" - }, - "errorMessage": { - "nullable": true, - "type": "string" - }, - "executedSql": { - "type": "string" - }, - "extra": { - "type": "object" - }, - "id": { - "type": "string" - }, - "limit": { - "type": "integer" - }, - "limitingFactor": { - "type": "string" - }, - "progress": { - "type": "integer" - }, - "queryId": { - "type": "integer" - }, - "resultsKey": { - "type": "string" - }, - "rows": { - "type": "integer" - }, - "schema": { - "type": "string" - }, - "serverId": { - "type": "integer" - }, - "sql": { - "type": "string" - }, - "sqlEditorId": { - "type": "string" - }, - "startDttm": { - "type": "number" - }, - "state": { - "type": "string" - }, - "tab": { - "type": "string" - }, - "tempSchema": { - "nullable": true, - "type": "string" - }, - "tempTable": { - "nullable": true, - "type": "string" - }, - "trackingUrl": { - "nullable": true, - "type": "string" - }, - "user": { - "type": "string" - }, - "userId": { - "type": "integer" - } - }, - "type": "object" - }, - "RLSRestApi.get": { - "properties": { - "clause": { - "description": "clause_description", - "type": "string" - }, - "description": { - "description": "description_description", - "type": "string" - }, - "filter_type": { - "description": "filter_type_description", - "enum": [ - "Regular", - "Base" - ], - "type": "string" - }, - "group_key": { - "description": "group_key_description", - "type": "string" - }, - "id": { - "description": "id_description", - "type": "integer" - }, - "name": { - "description": "name_description", - "type": "string" - }, - "roles": { - "items": { - "$ref": "#/components/schemas/Roles1" - }, - "type": "array" - }, - "tables": { - "items": { - "$ref": "#/components/schemas/Tables" - }, - "type": "array" - } - }, - "type": "object" - }, - "RLSRestApi.get_list": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/User" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "clause": { - "description": "clause_description", - "type": "string" - }, - "description": { - "description": "description_description", - "type": "string" - }, - "filter_type": { - "description": "filter_type_description", - "enum": [ - "Regular", - "Base" - ], - "type": "string" - }, - "group_key": { - "description": "group_key_description", - "type": "string" - }, - "id": { - "description": "id_description", - "type": "integer" - }, - "name": { - "description": "name_description", - "type": "string" - }, - "roles": { - "items": { - "$ref": "#/components/schemas/Roles1" - }, - "type": "array" - }, - "tables": { - "items": { - "$ref": "#/components/schemas/Tables" - }, - "type": "array" - } - }, - "type": "object" - }, - "RLSRestApi.post": { - "properties": { - "clause": { - "description": "clause_description", - "type": "string" - }, - "description": { - "description": "description_description", - "nullable": true, - "type": "string" - }, - "filter_type": { - "description": "filter_type_description", - "enum": [ - "Regular", - "Base" - ], - "type": "string" - }, - "group_key": { - "description": "group_key_description", - "nullable": true, - "type": "string" - }, - "name": { - "description": "name_description", - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - "roles": { - "description": "roles_description", - "items": { - "type": "integer" - }, - "type": "array" - }, - "tables": { - "description": "tables_description", - "items": { - "type": "integer" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "clause", - "filter_type", - "name", - "roles", - "tables" - ], - "type": "object" - }, - "RLSRestApi.put": { - "properties": { - "clause": { - "description": "clause_description", - "type": "string" - }, - "description": { - "description": "description_description", - "nullable": true, - "type": "string" - }, - "filter_type": { - "description": "filter_type_description", - "enum": [ - "Regular", - "Base" - ], - "type": "string" - }, - "group_key": { - "description": "group_key_description", - "nullable": true, - "type": "string" - }, - "name": { - "description": "name_description", - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - "roles": { - "description": "roles_description", - "items": { - "type": "integer" - }, - "type": "array" - }, - "tables": { - "description": "tables_description", - "items": { - "type": "integer" - }, - "type": "array" - } - }, - "type": "object" - }, - "RecentActivity": { - "properties": { - "action": { - "description": "Action taken describing type of activity", - "type": "string" - }, - "item_title": { - "description": "Title of item", - "type": "string" - }, - "item_type": { - "description": "Type of item, e.g. slice or dashboard", - "type": "string" - }, - "item_url": { - "description": "URL to item", - "type": "string" - }, - "time": { - "description": "Time of activity, in epoch milliseconds", - "type": "number" - }, - "time_delta_humanized": { - "description": "Human-readable description of how long ago activity took place.", - "type": "string" - } - }, - "type": "object" - }, - "RecentActivityResponseSchema": { - "properties": { - "result": { - "description": "A list of recent activity objects", - "items": { - "$ref": "#/components/schemas/RecentActivity" - }, - "type": "array" - } - }, - "type": "object" - }, - "RecentActivitySchema": { - "properties": { - "action": { - "description": "Action taken describing type of activity", - "type": "string" - }, - "item_title": { - "description": "Title of item", - "type": "string" - }, - "item_type": { - "description": "Type of item, e.g. slice or dashboard", - "type": "string" - }, - "item_url": { - "description": "URL to item", - "type": "string" - }, - "time": { - "description": "Time of activity, in epoch milliseconds", - "type": "number" - }, - "time_delta_humanized": { - "description": "Human-readable description of how long ago activity took place.", - "type": "string" - } - }, - "type": "object" - }, - "RelatedResponseSchema": { - "properties": { - "count": { - "description": "The total number of related values", - "type": "integer" - }, - "result": { - "items": { - "$ref": "#/components/schemas/RelatedResultResponse" - }, - "type": "array" - } - }, - "type": "object" - }, - "RelatedResultResponse": { - "properties": { - "extra": { - "description": "The extra metadata for related item", - "type": "object" - }, - "text": { - "description": "The related item string representation", - "type": "string" - }, - "value": { - "description": "The related item identifier", - "type": "integer" - } - }, - "type": "object" - }, - "ReportExecutionLogRestApi.get": { - "properties": { - "end_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "error_message": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "scheduled_dttm": { - "format": "date-time", - "type": "string" - }, - "start_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "state": { - "maxLength": 50, - "type": "string" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "value": { - "nullable": true, - "type": "number" - }, - "value_row_json": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "scheduled_dttm", - "state" - ], - "type": "object" - }, - "ReportExecutionLogRestApi.get_list": { - "properties": { - "end_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "error_message": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "scheduled_dttm": { - "format": "date-time", - "type": "string" - }, - "start_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "state": { - "maxLength": 50, - "type": "string" - }, - "uuid": { - "format": "uuid", - "nullable": true, - "type": "string" - }, - "value": { - "nullable": true, - "type": "number" - }, - "value_row_json": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "scheduled_dttm", - "state" - ], - "type": "object" - }, - "ReportExecutionLogRestApi.post": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "ReportExecutionLogRestApi.put": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "ReportRecipient": { - "properties": { - "recipient_config_json": { - "$ref": "#/components/schemas/ReportRecipientConfigJSON" - }, - "type": { - "description": "The recipient type, check spec for valid options", - "enum": [ - "Email", - "Slack", - "SlackV2" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "ReportRecipientConfigJSON": { - "properties": { - "bccTarget": { - "type": "string" - }, - "ccTarget": { - "type": "string" - }, - "target": { - "type": "string" - } - }, - "type": "object" - }, - "ReportScheduleRestApi.get": { - "properties": { - "active": { - "nullable": true, - "type": "boolean" - }, - "chart": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get.Slice" - }, - "context_markdown": { - "nullable": true, - "type": "string" - }, - "creation_method": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "crontab": { - "maxLength": 1000, - "type": "string" - }, - "custom_width": { - "nullable": true, - "type": "integer" - }, - "dashboard": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get.Dashboard" - }, - "database": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get.Database" - }, - "description": { - "nullable": true, - "type": "string" - }, - "email_subject": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "extra": { - "readOnly": true - }, - "force_screenshot": { - "nullable": true, - "type": "boolean" - }, - "grace_period": { - "nullable": true, - "type": "integer" - }, - "id": { - "type": "integer" - }, - "last_eval_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_state": { - "maxLength": 50, - "nullable": true, - "type": "string" - }, - "last_value": { - "nullable": true, - "type": "number" - }, - "last_value_row_json": { - "nullable": true, - "type": "string" - }, - "log_retention": { - "nullable": true, - "type": "integer" - }, - "name": { - "maxLength": 150, - "type": "string" - }, - "owners": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get.User" - }, - "recipients": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get.ReportRecipients" - }, - "report_format": { - "maxLength": 50, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "timezone": { - "maxLength": 100, - "type": "string" - }, - "type": { - "maxLength": 50, - "type": "string" - }, - "validator_config_json": { - "nullable": true, - "type": "string" - }, - "validator_type": { - "maxLength": 100, - "nullable": true, - "type": "string" - }, - "working_timeout": { - "nullable": true, - "type": "integer" - } - }, - "required": [ - "crontab", - "name", - "recipients", - "type" - ], - "type": "object" - }, - "ReportScheduleRestApi.get.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "ReportScheduleRestApi.get.Database": { - "properties": { - "database_name": { - "maxLength": 250, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "ReportScheduleRestApi.get.ReportRecipients": { - "properties": { - "id": { - "type": "integer" - }, - "recipient_config_json": { - "nullable": true, - "type": "string" - }, - "type": { - "maxLength": 50, - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "ReportScheduleRestApi.get.Slice": { - "properties": { - "id": { - "type": "integer" - }, - "slice_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "viz_type": { - "maxLength": 250, - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ReportScheduleRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ReportScheduleRestApi.get_list": { - "properties": { - "active": { - "nullable": true, - "type": "boolean" - }, - "changed_by": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.User" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "chart_id": { - "nullable": true, - "type": "integer" - }, - "created_by": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.User1" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "creation_method": { - "maxLength": 255, - "nullable": true, - "type": "string" - }, - "crontab": { - "maxLength": 1000, - "type": "string" - }, - "crontab_humanized": { - "readOnly": true - }, - "dashboard_id": { - "nullable": true, - "type": "integer" - }, - "description": { - "nullable": true, - "type": "string" - }, - "extra": { - "readOnly": true - }, - "id": { - "type": "integer" - }, - "last_eval_dttm": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_state": { - "maxLength": 50, - "nullable": true, - "type": "string" - }, - "name": { - "maxLength": 150, - "type": "string" - }, - "owners": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.User2" - }, - "recipients": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.ReportRecipients" - }, - "timezone": { - "maxLength": 100, - "type": "string" - }, - "type": { - "maxLength": 50, - "type": "string" - } - }, - "required": [ - "crontab", - "name", - "recipients", - "type" - ], - "type": "object" - }, - "ReportScheduleRestApi.get_list.ReportRecipients": { - "properties": { - "id": { - "type": "integer" - }, - "type": { - "maxLength": 50, - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "ReportScheduleRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ReportScheduleRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ReportScheduleRestApi.get_list.User2": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "ReportScheduleRestApi.post": { - "properties": { - "active": { - "type": "boolean" - }, - "chart": { - "nullable": true, - "type": "integer" - }, - "context_markdown": { - "description": "Markdown description", - "nullable": true, - "type": "string" - }, - "creation_method": { - "description": "Creation method is used to inform the frontend whether the report/alert was created in the dashboard, chart, or alerts and reports UI.", - "enum": [ - "charts", - "dashboards", - "alerts_reports" - ] - }, - "crontab": { - "description": "A CRON expression.[Crontab Guru](https://crontab.guru/) is a helpful resource that can help you craft a CRON expression.", - "example": "*/5 * * * *", - "maxLength": 1000, - "minLength": 1, - "type": "string" - }, - "custom_width": { - "description": "Custom width of the screenshot in pixels", - "example": 1000, - "nullable": true, - "type": "integer" - }, - "dashboard": { - "nullable": true, - "type": "integer" - }, - "database": { - "type": "integer" - }, - "description": { - "description": "Use a nice description to give context to this Alert/Report", - "example": "Daily sales dashboard to marketing", - "nullable": true, - "type": "string" - }, - "email_subject": { - "description": "The report schedule subject line", - "example": "[Report] Report name: Dashboard or chart name", - "nullable": true, - "type": "string" - }, - "extra": { - "type": "object" - }, - "force_screenshot": { - "type": "boolean" - }, - "grace_period": { - "description": "Once an alert is triggered, how long, in seconds, before Superset nags you again. (in seconds)", - "example": 14400, - "minimum": 1, - "type": "integer" - }, - "log_retention": { - "description": "How long to keep the logs around for this report (in days)", - "example": 90, - "minimum": 1, - "type": "integer" - }, - "name": { - "description": "The report schedule name.", - "example": "Daily dashboard email", - "maxLength": 150, - "minLength": 1, - "type": "string" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this report. If left empty you will be one of the owners of the report.", - "type": "integer" - }, - "type": "array" - }, - "recipients": { - "items": { - "$ref": "#/components/schemas/ReportRecipient" - }, - "type": "array" - }, - "report_format": { - "enum": [ - "PDF", - "PNG", - "CSV", - "TEXT" - ], - "type": "string" - }, - "selected_tabs": { - "items": { - "type": "integer" - }, - "nullable": true, - "type": "array" - }, - "sql": { - "description": "A SQL statement that defines whether the alert should get triggered or not. The query is expected to return either NULL or a number value.", - "example": "SELECT value FROM time_series_table", - "type": "string" - }, - "timezone": { - "description": "A timezone string that represents the location of the timezone.", - "enum": [ - "Africa/Abidjan", - "Africa/Accra", - "Africa/Addis_Ababa", - "Africa/Algiers", - "Africa/Asmara", - "Africa/Asmera", - "Africa/Bamako", - "Africa/Bangui", - "Africa/Banjul", - "Africa/Bissau", - "Africa/Blantyre", - "Africa/Brazzaville", - "Africa/Bujumbura", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Ceuta", - "Africa/Conakry", - "Africa/Dakar", - "Africa/Dar_es_Salaam", - "Africa/Djibouti", - "Africa/Douala", - "Africa/El_Aaiun", - "Africa/Freetown", - "Africa/Gaborone", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Juba", - "Africa/Kampala", - "Africa/Khartoum", - "Africa/Kigali", - "Africa/Kinshasa", - "Africa/Lagos", - "Africa/Libreville", - "Africa/Lome", - "Africa/Luanda", - "Africa/Lubumbashi", - "Africa/Lusaka", - "Africa/Malabo", - "Africa/Maputo", - "Africa/Maseru", - "Africa/Mbabane", - "Africa/Mogadishu", - "Africa/Monrovia", - "Africa/Nairobi", - "Africa/Ndjamena", - "Africa/Niamey", - "Africa/Nouakchott", - "Africa/Ouagadougou", - "Africa/Porto-Novo", - "Africa/Sao_Tome", - "Africa/Timbuktu", - "Africa/Tripoli", - "Africa/Tunis", - "Africa/Windhoek", - "America/Adak", - "America/Anchorage", - "America/Anguilla", - "America/Antigua", - "America/Araguaina", - "America/Argentina/Buenos_Aires", - "America/Argentina/Catamarca", - "America/Argentina/ComodRivadavia", - "America/Argentina/Cordoba", - "America/Argentina/Jujuy", - "America/Argentina/La_Rioja", - "America/Argentina/Mendoza", - "America/Argentina/Rio_Gallegos", - "America/Argentina/Salta", - "America/Argentina/San_Juan", - "America/Argentina/San_Luis", - "America/Argentina/Tucuman", - "America/Argentina/Ushuaia", - "America/Aruba", - "America/Asuncion", - "America/Atikokan", - "America/Atka", - "America/Bahia", - "America/Bahia_Banderas", - "America/Barbados", - "America/Belem", - "America/Belize", - "America/Blanc-Sablon", - "America/Boa_Vista", - "America/Bogota", - "America/Boise", - "America/Buenos_Aires", - "America/Cambridge_Bay", - "America/Campo_Grande", - "America/Cancun", - "America/Caracas", - "America/Catamarca", - "America/Cayenne", - "America/Cayman", - "America/Chicago", - "America/Chihuahua", - "America/Ciudad_Juarez", - "America/Coral_Harbour", - "America/Cordoba", - "America/Costa_Rica", - "America/Creston", - "America/Cuiaba", - "America/Curacao", - "America/Danmarkshavn", - "America/Dawson", - "America/Dawson_Creek", - "America/Denver", - "America/Detroit", - "America/Dominica", - "America/Edmonton", - "America/Eirunepe", - "America/El_Salvador", - "America/Ensenada", - "America/Fort_Nelson", - "America/Fort_Wayne", - "America/Fortaleza", - "America/Glace_Bay", - "America/Godthab", - "America/Goose_Bay", - "America/Grand_Turk", - "America/Grenada", - "America/Guadeloupe", - "America/Guatemala", - "America/Guayaquil", - "America/Guyana", - "America/Halifax", - "America/Havana", - "America/Hermosillo", - "America/Indiana/Indianapolis", - "America/Indiana/Knox", - "America/Indiana/Marengo", - "America/Indiana/Petersburg", - "America/Indiana/Tell_City", - "America/Indiana/Vevay", - "America/Indiana/Vincennes", - "America/Indiana/Winamac", - "America/Indianapolis", - "America/Inuvik", - "America/Iqaluit", - "America/Jamaica", - "America/Jujuy", - "America/Juneau", - "America/Kentucky/Louisville", - "America/Kentucky/Monticello", - "America/Knox_IN", - "America/Kralendijk", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Louisville", - "America/Lower_Princes", - "America/Maceio", - "America/Managua", - "America/Manaus", - "America/Marigot", - "America/Martinique", - "America/Matamoros", - "America/Mazatlan", - "America/Mendoza", - "America/Menominee", - "America/Merida", - "America/Metlakatla", - "America/Mexico_City", - "America/Miquelon", - "America/Moncton", - "America/Monterrey", - "America/Montevideo", - "America/Montreal", - "America/Montserrat", - "America/Nassau", - "America/New_York", - "America/Nipigon", - "America/Nome", - "America/Noronha", - "America/North_Dakota/Beulah", - "America/North_Dakota/Center", - "America/North_Dakota/New_Salem", - "America/Nuuk", - "America/Ojinaga", - "America/Panama", - "America/Pangnirtung", - "America/Paramaribo", - "America/Phoenix", - "America/Port-au-Prince", - "America/Port_of_Spain", - "America/Porto_Acre", - "America/Porto_Velho", - "America/Puerto_Rico", - "America/Punta_Arenas", - "America/Rainy_River", - "America/Rankin_Inlet", - "America/Recife", - "America/Regina", - "America/Resolute", - "America/Rio_Branco", - "America/Rosario", - "America/Santa_Isabel", - "America/Santarem", - "America/Santiago", - "America/Santo_Domingo", - "America/Sao_Paulo", - "America/Scoresbysund", - "America/Shiprock", - "America/Sitka", - "America/St_Barthelemy", - "America/St_Johns", - "America/St_Kitts", - "America/St_Lucia", - "America/St_Thomas", - "America/St_Vincent", - "America/Swift_Current", - "America/Tegucigalpa", - "America/Thule", - "America/Thunder_Bay", - "America/Tijuana", - "America/Toronto", - "America/Tortola", - "America/Vancouver", - "America/Virgin", - "America/Whitehorse", - "America/Winnipeg", - "America/Yakutat", - "America/Yellowknife", - "Antarctica/Casey", - "Antarctica/Davis", - "Antarctica/DumontDUrville", - "Antarctica/Macquarie", - "Antarctica/Mawson", - "Antarctica/McMurdo", - "Antarctica/Palmer", - "Antarctica/Rothera", - "Antarctica/South_Pole", - "Antarctica/Syowa", - "Antarctica/Troll", - "Antarctica/Vostok", - "Arctic/Longyearbyen", - "Asia/Aden", - "Asia/Almaty", - "Asia/Amman", - "Asia/Anadyr", - "Asia/Aqtau", - "Asia/Aqtobe", - "Asia/Ashgabat", - "Asia/Ashkhabad", - "Asia/Atyrau", - "Asia/Baghdad", - "Asia/Bahrain", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Barnaul", - "Asia/Beirut", - "Asia/Bishkek", - "Asia/Brunei", - "Asia/Calcutta", - "Asia/Chita", - "Asia/Choibalsan", - "Asia/Chongqing", - "Asia/Chungking", - "Asia/Colombo", - "Asia/Dacca", - "Asia/Damascus", - "Asia/Dhaka", - "Asia/Dili", - "Asia/Dubai", - "Asia/Dushanbe", - "Asia/Famagusta", - "Asia/Gaza", - "Asia/Harbin", - "Asia/Hebron", - "Asia/Ho_Chi_Minh", - "Asia/Hong_Kong", - "Asia/Hovd", - "Asia/Irkutsk", - "Asia/Istanbul", - "Asia/Jakarta", - "Asia/Jayapura", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kashgar", - "Asia/Kathmandu", - "Asia/Katmandu", - "Asia/Khandyga", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuching", - "Asia/Kuwait", - "Asia/Macao", - "Asia/Macau", - "Asia/Magadan", - "Asia/Makassar", - "Asia/Manila", - "Asia/Muscat", - "Asia/Nicosia", - "Asia/Novokuznetsk", - "Asia/Novosibirsk", - "Asia/Omsk", - "Asia/Oral", - "Asia/Phnom_Penh", - "Asia/Pontianak", - "Asia/Pyongyang", - "Asia/Qatar", - "Asia/Qostanay", - "Asia/Qyzylorda", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Saigon", - "Asia/Sakhalin", - "Asia/Samarkand", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tel_Aviv", - "Asia/Thimbu", - "Asia/Thimphu", - "Asia/Tokyo", - "Asia/Tomsk", - "Asia/Ujung_Pandang", - "Asia/Ulaanbaatar", - "Asia/Ulan_Bator", - "Asia/Urumqi", - "Asia/Ust-Nera", - "Asia/Vientiane", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yangon", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Atlantic/Azores", - "Atlantic/Bermuda", - "Atlantic/Canary", - "Atlantic/Cape_Verde", - "Atlantic/Faeroe", - "Atlantic/Faroe", - "Atlantic/Jan_Mayen", - "Atlantic/Madeira", - "Atlantic/Reykjavik", - "Atlantic/South_Georgia", - "Atlantic/St_Helena", - "Atlantic/Stanley", - "Australia/ACT", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Broken_Hill", - "Australia/Canberra", - "Australia/Currie", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lindeman", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/NSW", - "Australia/North", - "Australia/Perth", - "Australia/Queensland", - "Australia/South", - "Australia/Sydney", - "Australia/Tasmania", - "Australia/Victoria", - "Australia/West", - "Australia/Yancowinna", - "Brazil/Acre", - "Brazil/DeNoronha", - "Brazil/East", - "Brazil/West", - "CET", - "CST6CDT", - "Canada/Atlantic", - "Canada/Central", - "Canada/Eastern", - "Canada/Mountain", - "Canada/Newfoundland", - "Canada/Pacific", - "Canada/Saskatchewan", - "Canada/Yukon", - "Chile/Continental", - "Chile/EasterIsland", - "Cuba", - "EET", - "EST", - "EST5EDT", - "Egypt", - "Eire", - "Etc/GMT", - "Etc/GMT+0", - "Etc/GMT+1", - "Etc/GMT+10", - "Etc/GMT+11", - "Etc/GMT+12", - "Etc/GMT+2", - "Etc/GMT+3", - "Etc/GMT+4", - "Etc/GMT+5", - "Etc/GMT+6", - "Etc/GMT+7", - "Etc/GMT+8", - "Etc/GMT+9", - "Etc/GMT-0", - "Etc/GMT-1", - "Etc/GMT-10", - "Etc/GMT-11", - "Etc/GMT-12", - "Etc/GMT-13", - "Etc/GMT-14", - "Etc/GMT-2", - "Etc/GMT-3", - "Etc/GMT-4", - "Etc/GMT-5", - "Etc/GMT-6", - "Etc/GMT-7", - "Etc/GMT-8", - "Etc/GMT-9", - "Etc/GMT0", - "Etc/Greenwich", - "Etc/UCT", - "Etc/UTC", - "Etc/Universal", - "Etc/Zulu", - "Europe/Amsterdam", - "Europe/Andorra", - "Europe/Astrakhan", - "Europe/Athens", - "Europe/Belfast", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Busingen", - "Europe/Chisinau", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Gibraltar", - "Europe/Guernsey", - "Europe/Helsinki", - "Europe/Isle_of_Man", - "Europe/Istanbul", - "Europe/Jersey", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Kirov", - "Europe/Kyiv", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Luxembourg", - "Europe/Madrid", - "Europe/Malta", - "Europe/Mariehamn", - "Europe/Minsk", - "Europe/Monaco", - "Europe/Moscow", - "Europe/Nicosia", - "Europe/Oslo", - "Europe/Paris", - "Europe/Podgorica", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/San_Marino", - "Europe/Sarajevo", - "Europe/Saratov", - "Europe/Simferopol", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Tirane", - "Europe/Tiraspol", - "Europe/Ulyanovsk", - "Europe/Uzhgorod", - "Europe/Vaduz", - "Europe/Vatican", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zaporozhye", - "Europe/Zurich", - "GB", - "GB-Eire", - "GMT", - "GMT+0", - "GMT-0", - "GMT0", - "Greenwich", - "HST", - "Hongkong", - "Iceland", - "Indian/Antananarivo", - "Indian/Chagos", - "Indian/Christmas", - "Indian/Cocos", - "Indian/Comoro", - "Indian/Kerguelen", - "Indian/Mahe", - "Indian/Maldives", - "Indian/Mauritius", - "Indian/Mayotte", - "Indian/Reunion", - "Iran", - "Israel", - "Jamaica", - "Japan", - "Kwajalein", - "Libya", - "MET", - "MST", - "MST7MDT", - "Mexico/BajaNorte", - "Mexico/BajaSur", - "Mexico/General", - "NZ", - "NZ-CHAT", - "Navajo", - "PRC", - "PST8PDT", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Bougainville", - "Pacific/Chatham", - "Pacific/Chuuk", - "Pacific/Easter", - "Pacific/Efate", - "Pacific/Enderbury", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Funafuti", - "Pacific/Galapagos", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Johnston", - "Pacific/Kanton", - "Pacific/Kiritimati", - "Pacific/Kosrae", - "Pacific/Kwajalein", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Nauru", - "Pacific/Niue", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Palau", - "Pacific/Pitcairn", - "Pacific/Pohnpei", - "Pacific/Ponape", - "Pacific/Port_Moresby", - "Pacific/Rarotonga", - "Pacific/Saipan", - "Pacific/Samoa", - "Pacific/Tahiti", - "Pacific/Tarawa", - "Pacific/Tongatapu", - "Pacific/Truk", - "Pacific/Wake", - "Pacific/Wallis", - "Pacific/Yap", - "Poland", - "Portugal", - "ROC", - "ROK", - "Singapore", - "Turkey", - "UCT", - "US/Alaska", - "US/Aleutian", - "US/Arizona", - "US/Central", - "US/East-Indiana", - "US/Eastern", - "US/Hawaii", - "US/Indiana-Starke", - "US/Michigan", - "US/Mountain", - "US/Pacific", - "US/Samoa", - "UTC", - "Universal", - "W-SU", - "WET", - "Zulu" - ], - "type": "string" - }, - "type": { - "description": "The report schedule type", - "enum": [ - "Alert", - "Report" - ], - "type": "string" - }, - "validator_config_json": { - "$ref": "#/components/schemas/ValidatorConfigJSON" - }, - "validator_type": { - "description": "Determines when to trigger alert based off value from alert query. Alerts will be triggered with these validator types:\n- Not Null - When the return value is Not NULL, Empty, or 0\n- Operator - When `sql_return_value comparison_operator threshold` is True e.g. `50 <= 75`
Supports the comparison operators <, <=, >, >=, ==, and !=", - "enum": [ - "not null", - "operator" - ], - "type": "string" - }, - "working_timeout": { - "description": "If an alert is staled at a working state, how long until it's state is reset to error", - "example": 3600, - "minimum": 1, - "type": "integer" - } - }, - "required": [ - "crontab", - "name", - "type" - ], - "type": "object" - }, - "ReportScheduleRestApi.put": { - "properties": { - "active": { - "type": "boolean" - }, - "chart": { - "nullable": true, - "type": "integer" - }, - "context_markdown": { - "description": "Markdown description", - "nullable": true, - "type": "string" - }, - "creation_method": { - "description": "Creation method is used to inform the frontend whether the report/alert was created in the dashboard, chart, or alerts and reports UI.", - "enum": [ - "charts", - "dashboards", - "alerts_reports" - ], - "nullable": true - }, - "crontab": { - "description": "A CRON expression.[Crontab Guru](https://crontab.guru/) is a helpful resource that can help you craft a CRON expression.", - "maxLength": 1000, - "minLength": 1, - "type": "string" - }, - "custom_width": { - "description": "Custom width of the screenshot in pixels", - "example": 1000, - "nullable": true, - "type": "integer" - }, - "dashboard": { - "nullable": true, - "type": "integer" - }, - "database": { - "type": "integer" - }, - "description": { - "description": "Use a nice description to give context to this Alert/Report", - "example": "Daily sales dashboard to marketing", - "nullable": true, - "type": "string" - }, - "email_subject": { - "description": "The report schedule subject line", - "example": "[Report] Report name: Dashboard or chart name", - "nullable": true, - "type": "string" - }, - "extra": { - "type": "object" - }, - "force_screenshot": { - "type": "boolean" - }, - "grace_period": { - "description": "Once an alert is triggered, how long, in seconds, before Superset nags you again. (in seconds)", - "example": 14400, - "minimum": 1, - "type": "integer" - }, - "log_retention": { - "description": "How long to keep the logs around for this report (in days)", - "example": 90, - "minimum": 0, - "type": "integer" - }, - "name": { - "description": "The report schedule name.", - "maxLength": 150, - "minLength": 1, - "type": "string" - }, - "owners": { - "items": { - "description": "Owner are users ids allowed to delete or change this report. If left empty you will be one of the owners of the report.", - "type": "integer" - }, - "type": "array" - }, - "recipients": { - "items": { - "$ref": "#/components/schemas/ReportRecipient" - }, - "type": "array" - }, - "report_format": { - "enum": [ - "PDF", - "PNG", - "CSV", - "TEXT" - ], - "type": "string" - }, - "sql": { - "description": "A SQL statement that defines whether the alert should get triggered or not. The query is expected to return either NULL or a number value.", - "example": "SELECT value FROM time_series_table", - "nullable": true, - "type": "string" - }, - "timezone": { - "description": "A timezone string that represents the location of the timezone.", - "enum": [ - "Africa/Abidjan", - "Africa/Accra", - "Africa/Addis_Ababa", - "Africa/Algiers", - "Africa/Asmara", - "Africa/Asmera", - "Africa/Bamako", - "Africa/Bangui", - "Africa/Banjul", - "Africa/Bissau", - "Africa/Blantyre", - "Africa/Brazzaville", - "Africa/Bujumbura", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Ceuta", - "Africa/Conakry", - "Africa/Dakar", - "Africa/Dar_es_Salaam", - "Africa/Djibouti", - "Africa/Douala", - "Africa/El_Aaiun", - "Africa/Freetown", - "Africa/Gaborone", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Juba", - "Africa/Kampala", - "Africa/Khartoum", - "Africa/Kigali", - "Africa/Kinshasa", - "Africa/Lagos", - "Africa/Libreville", - "Africa/Lome", - "Africa/Luanda", - "Africa/Lubumbashi", - "Africa/Lusaka", - "Africa/Malabo", - "Africa/Maputo", - "Africa/Maseru", - "Africa/Mbabane", - "Africa/Mogadishu", - "Africa/Monrovia", - "Africa/Nairobi", - "Africa/Ndjamena", - "Africa/Niamey", - "Africa/Nouakchott", - "Africa/Ouagadougou", - "Africa/Porto-Novo", - "Africa/Sao_Tome", - "Africa/Timbuktu", - "Africa/Tripoli", - "Africa/Tunis", - "Africa/Windhoek", - "America/Adak", - "America/Anchorage", - "America/Anguilla", - "America/Antigua", - "America/Araguaina", - "America/Argentina/Buenos_Aires", - "America/Argentina/Catamarca", - "America/Argentina/ComodRivadavia", - "America/Argentina/Cordoba", - "America/Argentina/Jujuy", - "America/Argentina/La_Rioja", - "America/Argentina/Mendoza", - "America/Argentina/Rio_Gallegos", - "America/Argentina/Salta", - "America/Argentina/San_Juan", - "America/Argentina/San_Luis", - "America/Argentina/Tucuman", - "America/Argentina/Ushuaia", - "America/Aruba", - "America/Asuncion", - "America/Atikokan", - "America/Atka", - "America/Bahia", - "America/Bahia_Banderas", - "America/Barbados", - "America/Belem", - "America/Belize", - "America/Blanc-Sablon", - "America/Boa_Vista", - "America/Bogota", - "America/Boise", - "America/Buenos_Aires", - "America/Cambridge_Bay", - "America/Campo_Grande", - "America/Cancun", - "America/Caracas", - "America/Catamarca", - "America/Cayenne", - "America/Cayman", - "America/Chicago", - "America/Chihuahua", - "America/Ciudad_Juarez", - "America/Coral_Harbour", - "America/Cordoba", - "America/Costa_Rica", - "America/Creston", - "America/Cuiaba", - "America/Curacao", - "America/Danmarkshavn", - "America/Dawson", - "America/Dawson_Creek", - "America/Denver", - "America/Detroit", - "America/Dominica", - "America/Edmonton", - "America/Eirunepe", - "America/El_Salvador", - "America/Ensenada", - "America/Fort_Nelson", - "America/Fort_Wayne", - "America/Fortaleza", - "America/Glace_Bay", - "America/Godthab", - "America/Goose_Bay", - "America/Grand_Turk", - "America/Grenada", - "America/Guadeloupe", - "America/Guatemala", - "America/Guayaquil", - "America/Guyana", - "America/Halifax", - "America/Havana", - "America/Hermosillo", - "America/Indiana/Indianapolis", - "America/Indiana/Knox", - "America/Indiana/Marengo", - "America/Indiana/Petersburg", - "America/Indiana/Tell_City", - "America/Indiana/Vevay", - "America/Indiana/Vincennes", - "America/Indiana/Winamac", - "America/Indianapolis", - "America/Inuvik", - "America/Iqaluit", - "America/Jamaica", - "America/Jujuy", - "America/Juneau", - "America/Kentucky/Louisville", - "America/Kentucky/Monticello", - "America/Knox_IN", - "America/Kralendijk", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Louisville", - "America/Lower_Princes", - "America/Maceio", - "America/Managua", - "America/Manaus", - "America/Marigot", - "America/Martinique", - "America/Matamoros", - "America/Mazatlan", - "America/Mendoza", - "America/Menominee", - "America/Merida", - "America/Metlakatla", - "America/Mexico_City", - "America/Miquelon", - "America/Moncton", - "America/Monterrey", - "America/Montevideo", - "America/Montreal", - "America/Montserrat", - "America/Nassau", - "America/New_York", - "America/Nipigon", - "America/Nome", - "America/Noronha", - "America/North_Dakota/Beulah", - "America/North_Dakota/Center", - "America/North_Dakota/New_Salem", - "America/Nuuk", - "America/Ojinaga", - "America/Panama", - "America/Pangnirtung", - "America/Paramaribo", - "America/Phoenix", - "America/Port-au-Prince", - "America/Port_of_Spain", - "America/Porto_Acre", - "America/Porto_Velho", - "America/Puerto_Rico", - "America/Punta_Arenas", - "America/Rainy_River", - "America/Rankin_Inlet", - "America/Recife", - "America/Regina", - "America/Resolute", - "America/Rio_Branco", - "America/Rosario", - "America/Santa_Isabel", - "America/Santarem", - "America/Santiago", - "America/Santo_Domingo", - "America/Sao_Paulo", - "America/Scoresbysund", - "America/Shiprock", - "America/Sitka", - "America/St_Barthelemy", - "America/St_Johns", - "America/St_Kitts", - "America/St_Lucia", - "America/St_Thomas", - "America/St_Vincent", - "America/Swift_Current", - "America/Tegucigalpa", - "America/Thule", - "America/Thunder_Bay", - "America/Tijuana", - "America/Toronto", - "America/Tortola", - "America/Vancouver", - "America/Virgin", - "America/Whitehorse", - "America/Winnipeg", - "America/Yakutat", - "America/Yellowknife", - "Antarctica/Casey", - "Antarctica/Davis", - "Antarctica/DumontDUrville", - "Antarctica/Macquarie", - "Antarctica/Mawson", - "Antarctica/McMurdo", - "Antarctica/Palmer", - "Antarctica/Rothera", - "Antarctica/South_Pole", - "Antarctica/Syowa", - "Antarctica/Troll", - "Antarctica/Vostok", - "Arctic/Longyearbyen", - "Asia/Aden", - "Asia/Almaty", - "Asia/Amman", - "Asia/Anadyr", - "Asia/Aqtau", - "Asia/Aqtobe", - "Asia/Ashgabat", - "Asia/Ashkhabad", - "Asia/Atyrau", - "Asia/Baghdad", - "Asia/Bahrain", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Barnaul", - "Asia/Beirut", - "Asia/Bishkek", - "Asia/Brunei", - "Asia/Calcutta", - "Asia/Chita", - "Asia/Choibalsan", - "Asia/Chongqing", - "Asia/Chungking", - "Asia/Colombo", - "Asia/Dacca", - "Asia/Damascus", - "Asia/Dhaka", - "Asia/Dili", - "Asia/Dubai", - "Asia/Dushanbe", - "Asia/Famagusta", - "Asia/Gaza", - "Asia/Harbin", - "Asia/Hebron", - "Asia/Ho_Chi_Minh", - "Asia/Hong_Kong", - "Asia/Hovd", - "Asia/Irkutsk", - "Asia/Istanbul", - "Asia/Jakarta", - "Asia/Jayapura", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kashgar", - "Asia/Kathmandu", - "Asia/Katmandu", - "Asia/Khandyga", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuching", - "Asia/Kuwait", - "Asia/Macao", - "Asia/Macau", - "Asia/Magadan", - "Asia/Makassar", - "Asia/Manila", - "Asia/Muscat", - "Asia/Nicosia", - "Asia/Novokuznetsk", - "Asia/Novosibirsk", - "Asia/Omsk", - "Asia/Oral", - "Asia/Phnom_Penh", - "Asia/Pontianak", - "Asia/Pyongyang", - "Asia/Qatar", - "Asia/Qostanay", - "Asia/Qyzylorda", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Saigon", - "Asia/Sakhalin", - "Asia/Samarkand", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tel_Aviv", - "Asia/Thimbu", - "Asia/Thimphu", - "Asia/Tokyo", - "Asia/Tomsk", - "Asia/Ujung_Pandang", - "Asia/Ulaanbaatar", - "Asia/Ulan_Bator", - "Asia/Urumqi", - "Asia/Ust-Nera", - "Asia/Vientiane", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yangon", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Atlantic/Azores", - "Atlantic/Bermuda", - "Atlantic/Canary", - "Atlantic/Cape_Verde", - "Atlantic/Faeroe", - "Atlantic/Faroe", - "Atlantic/Jan_Mayen", - "Atlantic/Madeira", - "Atlantic/Reykjavik", - "Atlantic/South_Georgia", - "Atlantic/St_Helena", - "Atlantic/Stanley", - "Australia/ACT", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Broken_Hill", - "Australia/Canberra", - "Australia/Currie", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lindeman", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/NSW", - "Australia/North", - "Australia/Perth", - "Australia/Queensland", - "Australia/South", - "Australia/Sydney", - "Australia/Tasmania", - "Australia/Victoria", - "Australia/West", - "Australia/Yancowinna", - "Brazil/Acre", - "Brazil/DeNoronha", - "Brazil/East", - "Brazil/West", - "CET", - "CST6CDT", - "Canada/Atlantic", - "Canada/Central", - "Canada/Eastern", - "Canada/Mountain", - "Canada/Newfoundland", - "Canada/Pacific", - "Canada/Saskatchewan", - "Canada/Yukon", - "Chile/Continental", - "Chile/EasterIsland", - "Cuba", - "EET", - "EST", - "EST5EDT", - "Egypt", - "Eire", - "Etc/GMT", - "Etc/GMT+0", - "Etc/GMT+1", - "Etc/GMT+10", - "Etc/GMT+11", - "Etc/GMT+12", - "Etc/GMT+2", - "Etc/GMT+3", - "Etc/GMT+4", - "Etc/GMT+5", - "Etc/GMT+6", - "Etc/GMT+7", - "Etc/GMT+8", - "Etc/GMT+9", - "Etc/GMT-0", - "Etc/GMT-1", - "Etc/GMT-10", - "Etc/GMT-11", - "Etc/GMT-12", - "Etc/GMT-13", - "Etc/GMT-14", - "Etc/GMT-2", - "Etc/GMT-3", - "Etc/GMT-4", - "Etc/GMT-5", - "Etc/GMT-6", - "Etc/GMT-7", - "Etc/GMT-8", - "Etc/GMT-9", - "Etc/GMT0", - "Etc/Greenwich", - "Etc/UCT", - "Etc/UTC", - "Etc/Universal", - "Etc/Zulu", - "Europe/Amsterdam", - "Europe/Andorra", - "Europe/Astrakhan", - "Europe/Athens", - "Europe/Belfast", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Busingen", - "Europe/Chisinau", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Gibraltar", - "Europe/Guernsey", - "Europe/Helsinki", - "Europe/Isle_of_Man", - "Europe/Istanbul", - "Europe/Jersey", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Kirov", - "Europe/Kyiv", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Luxembourg", - "Europe/Madrid", - "Europe/Malta", - "Europe/Mariehamn", - "Europe/Minsk", - "Europe/Monaco", - "Europe/Moscow", - "Europe/Nicosia", - "Europe/Oslo", - "Europe/Paris", - "Europe/Podgorica", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/San_Marino", - "Europe/Sarajevo", - "Europe/Saratov", - "Europe/Simferopol", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Tirane", - "Europe/Tiraspol", - "Europe/Ulyanovsk", - "Europe/Uzhgorod", - "Europe/Vaduz", - "Europe/Vatican", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zaporozhye", - "Europe/Zurich", - "GB", - "GB-Eire", - "GMT", - "GMT+0", - "GMT-0", - "GMT0", - "Greenwich", - "HST", - "Hongkong", - "Iceland", - "Indian/Antananarivo", - "Indian/Chagos", - "Indian/Christmas", - "Indian/Cocos", - "Indian/Comoro", - "Indian/Kerguelen", - "Indian/Mahe", - "Indian/Maldives", - "Indian/Mauritius", - "Indian/Mayotte", - "Indian/Reunion", - "Iran", - "Israel", - "Jamaica", - "Japan", - "Kwajalein", - "Libya", - "MET", - "MST", - "MST7MDT", - "Mexico/BajaNorte", - "Mexico/BajaSur", - "Mexico/General", - "NZ", - "NZ-CHAT", - "Navajo", - "PRC", - "PST8PDT", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Bougainville", - "Pacific/Chatham", - "Pacific/Chuuk", - "Pacific/Easter", - "Pacific/Efate", - "Pacific/Enderbury", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Funafuti", - "Pacific/Galapagos", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Johnston", - "Pacific/Kanton", - "Pacific/Kiritimati", - "Pacific/Kosrae", - "Pacific/Kwajalein", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Nauru", - "Pacific/Niue", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Palau", - "Pacific/Pitcairn", - "Pacific/Pohnpei", - "Pacific/Ponape", - "Pacific/Port_Moresby", - "Pacific/Rarotonga", - "Pacific/Saipan", - "Pacific/Samoa", - "Pacific/Tahiti", - "Pacific/Tarawa", - "Pacific/Tongatapu", - "Pacific/Truk", - "Pacific/Wake", - "Pacific/Wallis", - "Pacific/Yap", - "Poland", - "Portugal", - "ROC", - "ROK", - "Singapore", - "Turkey", - "UCT", - "US/Alaska", - "US/Aleutian", - "US/Arizona", - "US/Central", - "US/East-Indiana", - "US/Eastern", - "US/Hawaii", - "US/Indiana-Starke", - "US/Michigan", - "US/Mountain", - "US/Pacific", - "US/Samoa", - "UTC", - "Universal", - "W-SU", - "WET", - "Zulu" - ], - "type": "string" - }, - "type": { - "description": "The report schedule type", - "enum": [ - "Alert", - "Report" - ], - "type": "string" - }, - "validator_config_json": { - "$ref": "#/components/schemas/ValidatorConfigJSON" - }, - "validator_type": { - "description": "Determines when to trigger alert based off value from alert query. Alerts will be triggered with these validator types:\n- Not Null - When the return value is Not NULL, Empty, or 0\n- Operator - When `sql_return_value comparison_operator threshold` is True e.g. `50 <= 75`
Supports the comparison operators <, <=, >, >=, ==, and !=", - "enum": [ - "not null", - "operator" - ], - "nullable": true, - "type": "string" - }, - "working_timeout": { - "description": "If an alert is staled at a working state, how long until it's state is reset to error", - "example": 3600, - "minimum": 1, - "nullable": true, - "type": "integer" - } - }, - "type": "object" - }, - "Resource": { - "properties": { - "id": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard" - ] - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "RlsRule": { - "properties": { - "clause": { - "type": "string" - }, - "dataset": { - "type": "integer" - } - }, - "required": [ - "clause" - ], - "type": "object" - }, - "RolePermissionListSchema": { - "properties": { - "id": { - "type": "integer" - }, - "permission_name": { - "type": "string" - }, - "view_menu_name": { - "type": "string" - } - }, - "type": "object" - }, - "RolePermissionPostSchema": { - "properties": { - "permission_view_menu_ids": { - "description": "List of permission view menu id", - "items": { - "type": "integer" - }, - "type": "array" - } - }, - "required": [ - "permission_view_menu_ids" - ], - "type": "object" - }, - "RoleResponseSchema": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "permission_ids": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "user_ids": { - "items": { - "type": "integer" - }, - "type": "array" - } - }, - "type": "object" - }, - "RoleUserPutSchema": { - "properties": { - "user_ids": { - "description": "List of user ids", - "items": { - "type": "integer" - }, - "type": "array" - } - }, - "required": [ - "user_ids" - ], - "type": "object" - }, - "Roles": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "Roles1": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "RolesResponseSchema": { - "properties": { - "count": { - "type": "integer" - }, - "ids": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "result": { - "items": { - "$ref": "#/components/schemas/RoleResponseSchema" - }, - "type": "array" - } - }, - "type": "object" - }, - "SQLLabBootstrapSchema": { - "properties": { - "active_tab": { - "$ref": "#/components/schemas/TabState" - }, - "databases": { - "additionalProperties": { - "$ref": "#/components/schemas/ImportV1Database" - }, - "type": "object" - }, - "queries": { - "additionalProperties": { - "$ref": "#/components/schemas/QueryResult" - }, - "type": "object" - }, - "tab_state_ids": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "SavedQueryRestApi.get": { - "properties": { - "catalog": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/SavedQueryRestApi.get.User" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/SavedQueryRestApi.get.User1" - }, - "database": { - "$ref": "#/components/schemas/SavedQueryRestApi.get.Database" - }, - "description": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "label": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "schema": { - "maxLength": 128, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "sql_tables": { - "readOnly": true - }, - "template_parameters": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "SavedQueryRestApi.get.Database": { - "properties": { - "database_name": { - "maxLength": 250, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "SavedQueryRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "SavedQueryRestApi.get.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "SavedQueryRestApi.get_list": { - "properties": { - "catalog": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "changed_by": { - "$ref": "#/components/schemas/SavedQueryRestApi.get_list.User" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/SavedQueryRestApi.get_list.User1" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "database": { - "$ref": "#/components/schemas/SavedQueryRestApi.get_list.Database" - }, - "db_id": { - "nullable": true, - "type": "integer" - }, - "description": { - "nullable": true, - "type": "string" - }, - "extra": { - "readOnly": true - }, - "id": { - "type": "integer" - }, - "label": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "last_run_delta_humanized": { - "readOnly": true - }, - "rows": { - "nullable": true, - "type": "integer" - }, - "schema": { - "maxLength": 128, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "sql_tables": { - "readOnly": true - }, - "tags": { - "$ref": "#/components/schemas/SavedQueryRestApi.get_list.Tag" - } - }, - "type": "object" - }, - "SavedQueryRestApi.get_list.Database": { - "properties": { - "database_name": { - "maxLength": 250, - "type": "string" - }, - "id": { - "type": "integer" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "SavedQueryRestApi.get_list.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "SavedQueryRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "SavedQueryRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "SavedQueryRestApi.post": { - "properties": { - "catalog": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "db_id": { - "nullable": true, - "type": "integer" - }, - "description": { - "nullable": true, - "type": "string" - }, - "extra_json": { - "nullable": true, - "type": "string" - }, - "label": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "schema": { - "maxLength": 128, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "template_parameters": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "SavedQueryRestApi.put": { - "properties": { - "catalog": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "db_id": { - "nullable": true, - "type": "integer" - }, - "description": { - "nullable": true, - "type": "string" - }, - "extra_json": { - "nullable": true, - "type": "string" - }, - "label": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "schema": { - "maxLength": 128, - "nullable": true, - "type": "string" - }, - "sql": { - "nullable": true, - "type": "string" - }, - "template_parameters": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "SchemasResponseSchema": { - "properties": { - "result": { - "items": { - "description": "A database schema name", - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "SelectStarResponseSchema": { - "properties": { - "result": { - "description": "SQL select star", - "type": "string" - } - }, - "type": "object" - }, - "Slice": { - "properties": { - "cache_timeout": { - "description": "Duration (in seconds) of the caching timeout for this chart.", - "type": "integer" - }, - "certification_details": { - "description": "Details of the certification.", - "type": "string" - }, - "certified_by": { - "description": "Person or group that has certified this dashboard.", - "type": "string" - }, - "changed_on": { - "description": "Timestamp of the last modification.", - "format": "date-time", - "type": "string" - }, - "changed_on_humanized": { - "description": "Timestamp of the last modification in human readable form.", - "type": "string" - }, - "datasource": { - "description": "Datasource identifier.", - "type": "string" - }, - "description": { - "description": "Slice description.", - "type": "string" - }, - "description_markeddown": { - "description": "Sanitized HTML version of the chart description.", - "type": "string" - }, - "edit_url": { - "description": "The URL for editing the slice.", - "type": "string" - }, - "form_data": { - "description": "Form data associated with the slice.", - "type": "object" - }, - "is_managed_externally": { - "description": "If the chart is managed outside externally.", - "type": "boolean" - }, - "modified": { - "description": "Last modification in human readable form.", - "type": "string" - }, - "owners": { - "description": "Owners identifiers.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "query_context": { - "description": "The context associated with the query.", - "type": "object" - }, - "slice_id": { - "description": "The slice ID.", - "type": "integer" - }, - "slice_name": { - "description": "The slice name.", - "type": "string" - }, - "slice_url": { - "description": "The slice URL.", - "type": "string" - } - }, - "type": "object" - }, - "SqlLabPermalinkSchema": { - "properties": { - "autorun": { - "type": "boolean" - }, - "catalog": { - "description": "The catalog name of the query", - "nullable": true, - "type": "string" - }, - "dbId": { - "description": "The id of the database", - "type": "integer" - }, - "name": { - "description": "The label of the editor tab", - "type": "string" - }, - "schema": { - "description": "The schema name of the query", - "nullable": true, - "type": "string" - }, - "sql": { - "description": "SQL query text", - "type": "string" - }, - "templateParams": { - "description": "stringfied JSON string for template parameters", - "nullable": true, - "type": "string" - } - }, - "required": [ - "dbId", - "name", - "sql" - ], - "type": "object" - }, - "StopQuerySchema": { - "properties": { - "client_id": { - "type": "string" - } - }, - "type": "object" - }, - "SupersetRoleApi.get": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SupersetRoleApi.get_list": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SupersetRoleApi.post": { - "properties": { - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SupersetRoleApi.put": { - "properties": { - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SupersetUserApi.get": { - "properties": { - "active": { - "nullable": true, - "type": "boolean" - }, - "changed_by": { - "$ref": "#/components/schemas/SupersetUserApi.get.User1" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "created_by": { - "$ref": "#/components/schemas/SupersetUserApi.get.User" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "email": { - "maxLength": 320, - "type": "string" - }, - "fail_login_count": { - "nullable": true, - "type": "integer" - }, - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_login": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - }, - "login_count": { - "nullable": true, - "type": "integer" - }, - "roles": { - "$ref": "#/components/schemas/SupersetUserApi.get.Role" - }, - "username": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "email", - "first_name", - "last_name", - "username" - ], - "type": "object" - }, - "SupersetUserApi.get.Role": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SupersetUserApi.get.User": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "SupersetUserApi.get.User1": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "SupersetUserApi.get_list": { - "properties": { - "active": { - "nullable": true, - "type": "boolean" - }, - "changed_by": { - "$ref": "#/components/schemas/SupersetUserApi.get_list.User1" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "created_by": { - "$ref": "#/components/schemas/SupersetUserApi.get_list.User" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "email": { - "maxLength": 320, - "type": "string" - }, - "fail_login_count": { - "nullable": true, - "type": "integer" - }, - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_login": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - }, - "login_count": { - "nullable": true, - "type": "integer" - }, - "roles": { - "$ref": "#/components/schemas/SupersetUserApi.get_list.Role" - }, - "username": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "email", - "first_name", - "last_name", - "username" - ], - "type": "object" - }, - "SupersetUserApi.get_list.Role": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SupersetUserApi.get_list.User": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "SupersetUserApi.get_list.User1": { - "properties": { - "id": { - "type": "integer" - } - }, - "type": "object" - }, - "SupersetUserApi.post": { - "properties": { - "active": { - "description": "Is user active?It's not a good policy to remove a user, just make it inactive", - "type": "boolean" - }, - "email": { - "description": "The user's email", - "type": "string" - }, - "first_name": { - "description": "The user's first name", - "type": "string" - }, - "last_name": { - "description": "The user's last name", - "type": "string" - }, - "password": { - "description": "The user's password for authentication", - "type": "string" - }, - "roles": { - "description": "The user's roles", - "items": { - "type": "integer" - }, - "minItems": 1, - "type": "array" - }, - "username": { - "description": "The user's username", - "maxLength": 250, - "minLength": 1, - "type": "string" - } - }, - "required": [ - "email", - "first_name", - "last_name", - "password", - "roles", - "username" - ], - "type": "object" - }, - "SupersetUserApi.put": { - "properties": { - "active": { - "description": "Is user active?It's not a good policy to remove a user, just make it inactive", - "type": "boolean" - }, - "email": { - "description": "The user's email", - "type": "string" - }, - "first_name": { - "description": "The user's first name", - "type": "string" - }, - "last_name": { - "description": "The user's last name", - "type": "string" - }, - "password": { - "description": "The user's password for authentication", - "type": "string" - }, - "roles": { - "description": "The user's roles", - "items": { - "type": "integer" - }, - "minItems": 1, - "type": "array" - }, - "username": { - "description": "The user's username", - "maxLength": 250, - "minLength": 1, - "type": "string" - } - }, - "type": "object" - }, - "Tab": { - "properties": { - "children": { - "items": { - "$ref": "#/components/schemas/Tab" - }, - "type": "array" - }, - "parents": { - "items": { - "type": "string" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "type": "object" - }, - "TabState": { - "properties": { - "active": { - "type": "boolean" - }, - "autorun": { - "type": "boolean" - }, - "database_id": { - "type": "integer" - }, - "extra_json": { - "type": "object" - }, - "hide_left_bar": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "label": { - "type": "string" - }, - "latest_query": { - "$ref": "#/components/schemas/QueryResult" - }, - "query_limit": { - "type": "integer" - }, - "saved_query": { - "nullable": true, - "type": "object" - }, - "schema": { - "type": "string" - }, - "sql": { - "type": "string" - }, - "table_schemas": { - "items": { - "$ref": "#/components/schemas/Table" - }, - "type": "array" - }, - "user_id": { - "type": "integer" - } - }, - "type": "object" - }, - "Table": { - "properties": { - "database_id": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "expanded": { - "type": "boolean" - }, - "id": { - "type": "integer" - }, - "schema": { - "type": "string" - }, - "tab_state_id": { - "type": "integer" - }, - "table": { - "type": "string" - } - }, - "type": "object" - }, - "TableExtraMetadataResponseSchema": { - "properties": { - "clustering": { - "type": "object" - }, - "metadata": { - "type": "object" - }, - "partitions": { - "type": "object" - } - }, - "type": "object" - }, - "TableMetadataColumnsResponse": { - "properties": { - "duplicates_constraint": { - "type": "string" - }, - "keys": { - "description": "", - "items": { - "type": "string" - }, - "type": "array" - }, - "longType": { - "description": "The actual backend long type for the column", - "type": "string" - }, - "name": { - "description": "The column name", - "type": "string" - }, - "type": { - "description": "The column type", - "type": "string" - } - }, - "type": "object" - }, - "TableMetadataForeignKeysIndexesResponse": { - "properties": { - "column_names": { - "items": { - "description": "A list of column names that compose the foreign key or index", - "type": "string" - }, - "type": "array" - }, - "name": { - "description": "The name of the foreign key or index", - "type": "string" - }, - "options": { - "$ref": "#/components/schemas/TableMetadataOptionsResponse" - }, - "referred_columns": { - "items": { - "type": "string" - }, - "type": "array" - }, - "referred_schema": { - "type": "string" - }, - "referred_table": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "type": "object" - }, - "TableMetadataOptionsResponse": { - "properties": { - "deferrable": { - "type": "boolean" - }, - "initially": { - "type": "boolean" - }, - "match": { - "type": "boolean" - }, - "ondelete": { - "type": "boolean" - }, - "onupdate": { - "type": "boolean" - } - }, - "type": "object" - }, - "TableMetadataPrimaryKeyResponse": { - "properties": { - "column_names": { - "items": { - "description": "A list of column names that compose the primary key", - "type": "string" - }, - "type": "array" - }, - "name": { - "description": "The primary key index name", - "type": "string" - }, - "type": { - "type": "string" - } - }, - "type": "object" - }, - "TableMetadataResponseSchema": { - "properties": { - "columns": { - "description": "A list of columns and their metadata", - "items": { - "$ref": "#/components/schemas/TableMetadataColumnsResponse" - }, - "type": "array" - }, - "foreignKeys": { - "description": "A list of foreign keys and their metadata", - "items": { - "$ref": "#/components/schemas/TableMetadataForeignKeysIndexesResponse" - }, - "type": "array" - }, - "indexes": { - "description": "A list of indexes and their metadata", - "items": { - "$ref": "#/components/schemas/TableMetadataForeignKeysIndexesResponse" - }, - "type": "array" - }, - "name": { - "description": "The name of the table", - "type": "string" - }, - "primaryKey": { - "allOf": [ - { - "$ref": "#/components/schemas/TableMetadataPrimaryKeyResponse" - } - ], - "description": "Primary keys metadata" - }, - "selectStar": { - "description": "SQL select star", - "type": "string" - } - }, - "type": "object" - }, - "Tables": { - "properties": { - "id": { - "type": "integer" - }, - "schema": { - "type": "string" - }, - "table_name": { - "type": "string" - } - }, - "type": "object" - }, - "TabsPayloadSchema": { - "properties": { - "all_tabs": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "tab_tree": { - "items": { - "$ref": "#/components/schemas/Tab" - }, - "type": "array" - } - }, - "type": "object" - }, - "Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "TagGetResponseSchema": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "type": "object" - }, - "TagObject": { - "properties": { - "description": { - "nullable": true, - "type": "string" - }, - "name": { - "minLength": 1, - "type": "string" - }, - "objects_to_tag": { - "description": "Objects to tag", - "items": {}, - "type": "array" - } - }, - "type": "object" - }, - "TagPostBulkResponseObject": { - "properties": { - "objects_skipped": { - "description": "Objects to tag", - "items": {}, - "type": "array" - }, - "objects_tagged": { - "description": "Objects to tag", - "items": {}, - "type": "array" - } - }, - "type": "object" - }, - "TagPostBulkResponseSchema": { - "properties": { - "result": { - "$ref": "#/components/schemas/TagPostBulkResponseObject" - } - }, - "type": "object" - }, - "TagPostBulkSchema": { - "properties": { - "tags": { - "items": { - "$ref": "#/components/schemas/TagObject" - }, - "type": "array" - } - }, - "type": "object" - }, - "TagRestApi.get": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/TagRestApi.get.User" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/TagRestApi.get.User1" - }, - "created_on_delta_humanized": { - "readOnly": true - }, - "description": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "TagRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "TagRestApi.get.User1": { - "properties": { - "active": { - "nullable": true, - "type": "boolean" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "email": { - "maxLength": 320, - "type": "string" - }, - "fail_login_count": { - "nullable": true, - "type": "integer" - }, - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_login": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - }, - "login_count": { - "nullable": true, - "type": "integer" - }, - "password": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "username": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "email", - "first_name", - "last_name", - "username" - ], - "type": "object" - }, - "TagRestApi.get_list": { - "properties": { - "changed_by": { - "$ref": "#/components/schemas/TagRestApi.get_list.User" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "created_by": { - "$ref": "#/components/schemas/TagRestApi.get_list.User1" - }, - "created_on_delta_humanized": { - "readOnly": true - }, - "description": { - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "TagRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "TagRestApi.get_list.User1": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, - "TagRestApi.post": { - "properties": { - "description": { - "nullable": true, - "type": "string" - }, - "name": { - "minLength": 1, - "type": "string" - }, - "objects_to_tag": { - "description": "Objects to tag", - "items": {}, - "type": "array" - } - }, - "type": "object" - }, - "TagRestApi.put": { - "properties": { - "description": { - "nullable": true, - "type": "string" - }, - "name": { - "minLength": 1, - "type": "string" - }, - "objects_to_tag": { - "description": "Objects to tag", - "items": {}, - "type": "array" - } - }, - "type": "object" - }, - "TaggedObjectEntityResponseSchema": { - "properties": { - "changed_on": { - "format": "date-time", - "type": "string" - }, - "created_by": { - "$ref": "#/components/schemas/User" - }, - "creator": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "owners": { - "items": { - "$ref": "#/components/schemas/User1" - }, - "type": "array" - }, - "tags": { - "items": { - "$ref": "#/components/schemas/TagGetResponseSchema" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "type": "object" - }, - "TemporaryCachePostSchema": { - "properties": { - "value": { - "description": "Any type of JSON supported text.", - "type": "string" - } - }, - "required": [ - "value" - ], - "type": "object" - }, - "TemporaryCachePutSchema": { - "properties": { - "value": { - "description": "Any type of JSON supported text.", - "type": "string" - } - }, - "required": [ - "value" - ], - "type": "object" - }, - "UploadFileMetadata": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/UploadFileMetadataItem" - }, - "type": "array" - } - }, - "type": "object" - }, - "UploadFileMetadataItem": { - "properties": { - "column_names": { - "description": "A list of columns names in the sheet", - "items": { - "type": "string" - }, - "type": "array" - }, - "sheet_name": { - "description": "The name of the sheet", - "type": "string" - } - }, - "type": "object" - }, - "UploadFileMetadataPostSchema": { - "properties": { - "delimiter": { - "description": "The character used to separate values in the CSV file (e.g., a comma, semicolon, or tab).", - "type": "string" - }, - "file": { - "description": "The file to upload", - "format": "binary", - "type": "string" - }, - "header_row": { - "description": "Row containing the headers to use as column names(0 is first line of data). Leave empty if there is no header row.", - "type": "integer" - }, - "type": { - "description": "File type to upload", - "enum": [ - "csv", - "excel", - "columnar" - ] - } - }, - "required": [ - "file", - "type" - ], - "type": "object" - }, - "UploadPostSchema": { - "properties": { - "already_exists": { - "default": "fail", - "description": "What to do if the table already exists accepts: fail, replace, append", - "enum": [ - "fail", - "replace", - "append" - ], - "type": "string" - }, - "column_data_types": { - "description": "[CSV only] A dictionary with column names and their data types if you need to change the defaults. Example: {'user_id':'int'}. Check Python Pandas library for supported data types", - "type": "string" - }, - "column_dates": { - "description": "[CSV and Excel only] A list of column names that should be parsed as dates. Example: date,timestamp", - "items": { - "type": "string" - }, - "type": "array" - }, - "columns_read": { - "description": "A List of the column names that should be read", - "items": { - "type": "string" - }, - "type": "array" - }, - "dataframe_index": { - "description": "Write dataframe index as a column.", - "type": "boolean" - }, - "day_first": { - "description": "[CSV only] DD/MM format dates, international and European format", - "type": "boolean" - }, - "decimal_character": { - "description": "[CSV and Excel only] Character to recognize as decimal point. Default is '.'", - "type": "string" - }, - "delimiter": { - "description": "[CSV only] The character used to separate values in the CSV file (e.g., a comma, semicolon, or tab).", - "type": "string" - }, - "file": { - "description": "The file to upload", - "format": "text/csv", - "type": "string" - }, - "header_row": { - "description": "[CSV and Excel only] Row containing the headers to use as column names (0 is first line of data). Leave empty if there is no header row.", - "type": "integer" - }, - "index_column": { - "description": "[CSV and Excel only] Column to use as the row labels of the dataframe. Leave empty if no index column", - "type": "string" - }, - "index_label": { - "description": "Index label for index column.", - "type": "string" - }, - "null_values": { - "description": "[CSV and Excel only] A list of strings that should be treated as null. Examples: '' for empty strings, 'None', 'N/A', Warning: Hive database supports only a single value", - "items": { - "type": "string" - }, - "type": "array" - }, - "rows_to_read": { - "description": "[CSV and Excel only] Number of rows to read from the file. If None, reads all rows.", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "schema": { - "description": "The schema to upload the data file to.", - "type": "string" - }, - "sheet_name": { - "description": "[Excel only]] Strings used for sheet names (default is the first sheet).", - "type": "string" - }, - "skip_blank_lines": { - "description": "[CSV only] Skip blank lines in the CSV file.", - "type": "boolean" - }, - "skip_initial_space": { - "description": "[CSV only] Skip spaces after delimiter.", - "type": "boolean" - }, - "skip_rows": { - "description": "[CSV and Excel only] Number of rows to skip at start of file.", - "type": "integer" - }, - "table_name": { - "description": "The name of the table to be created/appended", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "type": { - "description": "File type to upload", - "enum": [ - "csv", - "excel", - "columnar" - ] - } - }, - "required": [ - "file", - "table_name", - "type" - ], - "type": "object" - }, - "User": { - "properties": { - "first_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "type": "string" - } - }, - "type": "object" - }, - "User1": { - "properties": { - "first_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "type": "object" - }, - "User2": { - "properties": { - "first_name": { - "type": "string" - }, - "last_name": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "type": "object" - }, - "UserResponseSchema": { - "properties": { - "email": { - "type": "string" - }, - "first_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" - }, - "is_anonymous": { - "type": "boolean" - }, - "last_name": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "type": "object" - }, - "ValidateSQLRequest": { - "properties": { - "catalog": { - "nullable": true, - "type": "string" - }, - "schema": { - "nullable": true, - "type": "string" - }, - "sql": { - "description": "SQL statement to validate", - "type": "string" - }, - "template_params": { - "nullable": true, - "type": "object" - } - }, - "required": [ - "sql" - ], - "type": "object" - }, - "ValidateSQLResponse": { - "properties": { - "end_column": { - "type": "integer" - }, - "line_number": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "start_column": { - "type": "integer" - } - }, - "type": "object" - }, - "ValidatorConfigJSON": { - "properties": { - "op": { - "description": "The operation to compare with a threshold to apply to the SQL output\n", - "enum": [ - "<", - "<=", - ">", - ">=", - "==", - "!=" - ], - "type": "string" - }, - "threshold": { - "type": "number" - } - }, - "type": "object" - }, - "ViewMenuApi.get": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ViewMenuApi.get_list": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ViewMenuApi.post": { - "properties": { - "name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ViewMenuApi.put": { - "properties": { - "name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "advanced_data_type_convert_schema": { - "properties": { - "type": { - "default": "port", - "type": "string" - }, - "values": { - "items": { - "default": "http" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "type", - "values" - ], - "type": "object" - }, - "database_catalogs_query_schema": { - "properties": { - "force": { - "type": "boolean" - } - }, - "type": "object" - }, - "database_schemas_query_schema": { - "properties": { - "catalog": { - "type": "string" - }, - "force": { - "type": "boolean" - }, - "upload_allowed": { - "type": "boolean" - } - }, - "type": "object" - }, - "database_tables_query_schema": { - "properties": { - "catalog_name": { - "type": "string" - }, - "force": { - "type": "boolean" - }, - "schema_name": { - "type": "string" - } - }, - "required": [ - "schema_name" - ], - "type": "object" - }, - "delete_tags_schema": { - "items": { - "type": "string" - }, - "type": "array" - }, - "get_delete_ids_schema": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "get_export_ids_schema": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "get_fav_star_ids_schema": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "get_info_schema": { - "properties": { - "add_columns": { - "additionalProperties": { - "properties": { - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - } - }, - "type": "object" - }, - "type": "object" - }, - "edit_columns": { - "additionalProperties": { - "properties": { - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - } - }, - "type": "object" - }, - "type": "object" - }, - "keys": { - "items": { - "enum": [ - "add_columns", - "edit_columns", - "filters", - "permissions", - "add_title", - "edit_title", - "none" - ], - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "get_item_schema": { - "properties": { - "columns": { - "items": { - "type": "string" - }, - "type": "array" - }, - "keys": { - "items": { - "enum": [ - "show_columns", - "description_columns", - "label_columns", - "show_title", - "none" - ], - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "get_list_schema": { - "properties": { - "columns": { - "items": { - "type": "string" - }, - "type": "array" - }, - "filters": { - "items": { - "properties": { - "col": { - "type": "string" - }, - "opr": { - "type": "string" - }, - "value": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "boolean" - }, - { - "type": "array" - } - ] - } - }, - "required": [ - "col", - "opr", - "value" - ], - "type": "object" - }, - "type": "array" - }, - "keys": { - "items": { - "enum": [ - "list_columns", - "order_columns", - "label_columns", - "description_columns", - "list_title", - "none" - ], - "type": "string" - }, - "type": "array" - }, - "order_column": { - "type": "string" - }, - "order_direction": { - "enum": [ - "asc", - "desc" - ], - "type": "string" - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "select_columns": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "get_recent_activity_schema": { - "properties": { - "actions": { - "items": { - "type": "string" - }, - "type": "array" - }, - "distinct": { - "type": "boolean" - }, - "page": { - "type": "number" - }, - "page_size": { - "type": "number" - } - }, - "type": "object" - }, - "get_related_schema": { - "properties": { - "filter": { - "type": "string" - }, - "include_ids": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - } - }, - "type": "object" - }, - "queries_get_updated_since_schema": { - "properties": { - "last_updated_ms": { - "type": "number" - } - }, - "required": [ - "last_updated_ms" - ], - "type": "object" - }, - "screenshot_query_schema": { - "properties": { - "force": { - "type": "boolean" - }, - "thumb_size": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "window_size": { - "items": { - "type": "integer" - }, - "type": "array" - } - }, - "type": "object" - }, - "sql_lab_get_results_schema": { - "properties": { - "key": { - "type": "string" - } - }, - "required": [ - "key" - ], - "type": "object" - }, - "thumbnail_query_schema": { - "properties": { - "force": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "securitySchemes": { - "jwt": { - "bearerFormat": "JWT", - "scheme": "bearer", - "type": "http" - }, - "jwt_refresh": { - "bearerFormat": "JWT", - "scheme": "bearer", - "type": "http" - } - } - }, - "info": { - "description": "Superset", - "title": "Superset", - "version": "v1" - }, - "openapi": "3.0.2", - "paths": { - "/api/v1/advanced_data_type/convert": { - "get": { - "description": "Returns an AdvancedDataTypeResponse object populated with the passed in args.", - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/advanced_data_type_convert_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdvancedDataTypeSchema" - } - } - }, - "description": "AdvancedDataTypeResponse object has been returned." - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Return an AdvancedDataTypeResponse", - "tags": [ - "Advanced Data Type" - ] - } - }, - "/api/v1/advanced_data_type/types": { - "get": { - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "a successful return of the available advanced data types has taken place." - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Return a list of available advanced data types", - "tags": [ - "Advanced Data Type" - ] - } - }, - "/api/v1/annotation_layer/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "CSS templates bulk delete" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete multiple annotation layers in a bulk operation", - "tags": [ - "Annotation Layers" - ] - }, - "get": { - "description": "Gets a list of annotation layers, 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/AnnotationLayerRestApi.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 annotation layers", - "tags": [ - "Annotation Layers" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.post" - } - } - }, - "description": "Annotation Layer schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Annotation 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 an annotation layer", - "tags": [ - "Annotation Layers" - ] - } - }, - "/api/v1/annotation_layer/_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": [ - "Annotation Layers" - ] - } - }, - "/api/v1/annotation_layer/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": [ - "Annotation Layers" - ] - } - }, - "/api/v1/annotation_layer/{pk}": { - "delete": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete annotation layer", - "tags": [ - "Annotation Layers" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 an annotation layer", - "tags": [ - "Annotation Layers" - ] - }, - "put": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.put" - } - } - }, - "description": "Annotation schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Annotation changed" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Update an annotation layer", - "tags": [ - "Annotation Layers" - ] - } - }, - "/api/v1/annotation_layer/{pk}/annotation/": { - "delete": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Annotations bulk delete" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Bulk delete annotation layers", - "tags": [ - "Annotation Layers" - ] - }, - "get": { - "description": "Gets a list of annotation layers, use Rison or JSON query parameters for filtering, sorting, pagination and for selecting specific columns and metadata.", - "parameters": [ - { - "description": "The annotation layer id for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "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" - }, - "ids": { - "description": "A list of annotation ids", - "items": { - "type": "string" - }, - "type": "array" - }, - "result": { - "description": "The result from the get list query", - "items": { - "$ref": "#/components/schemas/AnnotationRestApi.get_list" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Items from Annotations" - }, - "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 annotation layers", - "tags": [ - "Annotation Layers" - ] - }, - "post": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationRestApi.post" - } - } - }, - "description": "Annotation schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/AnnotationRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Annotation 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 an annotation layer", - "tags": [ - "Annotation Layers" - ] - } - }, - "/api/v1/annotation_layer/{pk}/annotation/{annotation_id}": { - "delete": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The annotation pk for this annotation", - "in": "path", - "name": "annotation_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete annotation layer", - "tags": [ - "Annotation Layers" - ] - }, - "get": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The annotation pk", - "in": "path", - "name": "annotation_id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "description": "The item id", - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/AnnotationRestApi.get" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 an annotation layer", - "tags": [ - "Annotation Layers" - ] - }, - "put": { - "parameters": [ - { - "description": "The annotation layer pk for this annotation", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The annotation pk for this annotation", - "in": "path", - "name": "annotation_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationRestApi.put" - } - } - }, - "description": "Annotation schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/AnnotationRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Annotation changed" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Update an annotation layer", - "tags": [ - "Annotation Layers" - ] - } - }, - "/api/v1/assets/export/": { - "get": { - "description": "Gets a ZIP file with all the Superset assets (databases, datasets, charts, dashboards, saved queries) as YAML files.", - "responses": { - "200": { - "content": { - "application/zip": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "ZIP file" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Export all assets", - "tags": [ - "Import/export" - ] - } - }, - "/api/v1/assets/import/": { - "post": { - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "bundle": { - "description": "upload file (ZIP or JSON)", - "format": "binary", - "type": "string" - }, - "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" - }, - "sparse": { - "description": "allow sparse update of resources", - "type": "boolean" - }, - "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": "Assets 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 multiple assets", - "tags": [ - "Import/export" - ] - } - }, - "/api/v1/async_event/": { - "get": { - "description": "Reads off of the Redis events stream, using the user's JWT token and optional query params for last event received.", - "parameters": [ - { - "description": "Last ID received by the client", - "in": "query", - "name": "last_id", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "properties": { - "channel_id": { - "type": "string" - }, - "errors": { - "items": { - "type": "object" - }, - "type": "array" - }, - "id": { - "type": "string" - }, - "job_id": { - "type": "string" - }, - "result_url": { - "type": "string" - }, - "status": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Async event results" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Read off of the Redis events stream", - "tags": [ - "AsyncEventsRestApi" - ] - } - }, - "/api/v1/available_domains/": { - "get": { - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/AvailableDomainsSchema" - } - }, - "type": "object" - } - } - }, - "description": "a list of available domains" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get all available domains", - "tags": [ - "Available Domains" - ] - } - }, - "/api/v1/cachekey/invalidate": { - "post": { - "description": "Takes a list of datasources, finds and invalidates the associated cache records and removes the database records.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CacheInvalidationRequestSchema" - } - } - }, - "description": "A list of datasources uuid or the tuples of database and datasource names", - "required": true - }, - "responses": { - "201": { - "description": "cache was successfully invalidated" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Invalidate cache records and remove the database records", - "tags": [ - "CacheRestApi" - ] - } - }, - "/api/v1/chart/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Charts bulk delete" - }, - "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": "Bulk delete charts", - "tags": [ - "Charts" - ] - }, - "get": { - "description": "Gets a list of charts, 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/ChartRestApi.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 charts", - "tags": [ - "Charts" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartRestApi.post" - } - } - }, - "description": "Chart schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/ChartRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Chart added" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a new chart", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/_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": [ - "Charts" - ] - } - }, - "/api/v1/chart/data": { - "post": { - "description": "Takes a query context constructed in the client and returns payload data response for the given query.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartDataQueryContextSchema" - } - } - }, - "description": "A query context consists of a datasource from which to fetch data and one or many query objects.", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartDataResponseSchema" - } - } - }, - "description": "Query result" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartDataAsyncResponseSchema" - } - } - }, - "description": "Async job details" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Return payload data response for the given query", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/data/{cache_key}": { - "get": { - "description": "Takes a query context cache key and returns payload data response for the given query.", - "parameters": [ - { - "in": "path", - "name": "cache_key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartDataResponseSchema" - } - } - }, - "description": "Query result" - }, - "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": "Return payload data response for the given query", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/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 chart(s), dataset(s) and database(s) as YAML" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Download multiple charts as YAML files", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/favorite_status/": { - "get": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_fav_star_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetFavStarIdsSchema" - } - } - }, - "description": "None" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Check favorited charts for current user", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/import/": { - "post": { - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "formData": { - "description": "upload file (ZIP)", - "format": "binary", - "type": "string" - }, - "overwrite": { - "description": "overwrite existing charts?", - "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": "Chart 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 chart(s) with associated datasets and databases", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/related/{column_name}": { - "get": { - "description": "Get a list of all possible owners for a chart. Use `owners` has the `column_name` parameter", - "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": [ - "Charts" - ] - } - }, - "/api/v1/chart/warm_up_cache": { - "put": { - "description": "Warms up the cache for the chart. Note for slices a force refresh occurs. In terms of the `extra_filters` these can be obtained from records in the JSON encoded `logs.json` column associated with the `explore_json` action.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartCacheWarmUpRequestSchema" - } - } - }, - "description": "Identifies the chart to warm up cache for, and any additional dashboard or filter context to use.", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartCacheWarmUpResponseSchema" - } - } - }, - "description": "Each chart's warmup status" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Warm up the cache for the chart", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/{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": "Chart delete" - }, - "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 chart", - "tags": [ - "Charts" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/ChartRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 chart detail information", - "tags": [ - "Charts" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartRestApi.put" - } - } - }, - "description": "Chart schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/ChartRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Chart 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": "Update a chart", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/{pk}/cache_screenshot/": { - "get": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screenshot_query_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartCacheScreenshotResponseSchema" - } - } - }, - "description": "Chart async result" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartCacheScreenshotResponseSchema" - } - } - }, - "description": "Chart screenshot task created" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Compute and cache a screenshot", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/{pk}/data/": { - "get": { - "description": "Takes a chart ID and uses the query context stored when the chart was saved to return payload data response.", - "parameters": [ - { - "description": "The chart ID", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The format in which the data should be returned", - "in": "query", - "name": "format", - "schema": { - "type": "string" - } - }, - { - "description": "The type in which the data should be returned", - "in": "query", - "name": "type", - "schema": { - "type": "string" - } - }, - { - "description": "Should the queries be forced to load from the source", - "in": "query", - "name": "force", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartDataResponseSchema" - } - } - }, - "description": "Query result" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChartDataAsyncResponseSchema" - } - } - }, - "description": "Async job details" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Return payload data response for a chart", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/{pk}/favorites/": { - "delete": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Chart removed from favorites" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Remove the chart from the user favorite list", - "tags": [ - "Charts" - ] - }, - "post": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Chart added to favorites" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Mark the chart as favorite for the current user", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/{pk}/screenshot/{digest}/": { - "get": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "path", - "name": "digest", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Chart screenshot image" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a computed screenshot from cache", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/chart/{pk}/thumbnail/{digest}/": { - "get": { - "description": "Compute or get already computed chart thumbnail from cache.", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "A hex digest that makes this chart unique", - "in": "path", - "name": "digest", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Chart thumbnail image" - }, - "302": { - "description": "Redirects to the current digest" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get chart thumbnail", - "tags": [ - "Charts" - ] - } - }, - "/api/v1/css_template/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "CSS templates bulk delete" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Bulk delete CSS templates", - "tags": [ - "CSS Templates" - ] - }, - "get": { - "description": "Gets a list of CSS templates, 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/CssTemplateRestApi.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 CSS templates", - "tags": [ - "CSS Templates" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CssTemplateRestApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/CssTemplateRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item inserted" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a CSS template", - "tags": [ - "CSS Templates" - ] - } - }, - "/api/v1/css_template/_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": [ - "CSS Templates" - ] - } - }, - "/api/v1/css_template/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": [ - "CSS Templates" - ] - } - }, - "/api/v1/css_template/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete a CSS template", - "tags": [ - "CSS Templates" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/CssTemplateRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 CSS template", - "tags": [ - "CSS Templates" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CssTemplateRestApi.put" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/CssTemplateRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": "Update a CSS template", - "tags": [ - "CSS Templates" - ] - } - }, - "/api/v1/dashboard/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard bulk delete" - }, - "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": "Bulk delete dashboards", - "tags": [ - "Dashboards" - ] - }, - "get": { - "description": "Gets a list of dashboards, 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/DashboardRestApi.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 dashboards", - "tags": [ - "Dashboards" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardRestApi.post" - } - } - }, - "description": "Dashboard schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/DashboardRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard 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 dashboard", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/_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": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/export/": { - "get": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_export_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "Dashboard export" - }, - "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": "Download multiple dashboards as YAML files", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/favorite_status/": { - "get": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_fav_star_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetFavStarIdsSchema" - } - } - }, - "description": "None" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Check favorited dashboards for current user", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/import/": { - "post": { - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "formData": { - "description": "upload file (ZIP or JSON)", - "format": "binary", - "type": "string" - }, - "overwrite": { - "description": "overwrite existing dashboards?", - "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": "Dashboard 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 dashboard(s) with associated charts/datasets/databases", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/permalink/{key}": { - "get": { - "parameters": [ - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "state": { - "description": "The stored state", - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Returns the stored state." - }, - "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 dashboard's permanent link state", - "tags": [ - "Dashboard Permanent Link" - ] - } - }, - "/api/v1/dashboard/related/{column_name}": { - "get": { - "description": "Get a list of all possible owners for a dashboard.", - "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": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{id_or_slug}": { - "get": { - "parameters": [ - { - "description": "Either the id of the dashboard, or its slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/DashboardGetResponseSchema" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a dashboard detail information", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{id_or_slug}/charts": { - "get": { - "parameters": [ - { - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "$ref": "#/components/schemas/ChartEntityResponseSchema" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard chart definitions" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a dashboard's chart definitions.", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{id_or_slug}/copy/": { - "post": { - "parameters": [ - { - "description": "The dashboard id or slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardCopySchema" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "last_modified_time": { - "type": "number" - } - }, - "type": "object" - } - } - }, - "description": "Id of new dashboard and last modified time" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a copy of an existing dashboard", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{id_or_slug}/datasets": { - "get": { - "description": "Returns a list of a dashboard's datasets. Each dataset includes only the information necessary to render the dashboard's charts.", - "parameters": [ - { - "description": "Either the id of the dashboard, or its slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "$ref": "#/components/schemas/DashboardDatasetSchema" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard dataset definitions" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get dashboard's datasets", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{id_or_slug}/embedded": { - "delete": { - "parameters": [ - { - "description": "The dashboard id or slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Successfully removed the configuration" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete a dashboard's embedded configuration", - "tags": [ - "Dashboards" - ] - }, - "get": { - "parameters": [ - { - "description": "The dashboard id or slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" - } - }, - "type": "object" - } - } - }, - "description": "Result contains the embedded dashboard config" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get the dashboard's embedded configuration", - "tags": [ - "Dashboards" - ] - }, - "post": { - "parameters": [ - { - "description": "The dashboard id or slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmbeddedDashboardConfig" - } - } - }, - "description": "The embedded configuration to set", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" - } - }, - "type": "object" - } - } - }, - "description": "Successfully set the configuration" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Set a dashboard's embedded configuration", - "tags": [ - "Dashboards" - ] - }, - "put": { - "description": "Sets a dashboard's embedded configuration.", - "parameters": [ - { - "description": "The dashboard id or slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmbeddedDashboardConfig" - } - } - }, - "description": "The embedded configuration to set", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" - } - }, - "type": "object" - } - } - }, - "description": "Successfully set the configuration" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{id_or_slug}/tabs": { - "get": { - "description": "Returns a list of a dashboard's tabs and dashboard's nested tree structure for associated tabs.", - "parameters": [ - { - "description": "Either the id of the dashboard, or its slug", - "in": "path", - "name": "id_or_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "$ref": "#/components/schemas/TabsPayloadSchema" - }, - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard tabs" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get dashboard's tabs", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{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": "Dashboard 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 dashboard", - "tags": [ - "Dashboards" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardRestApi.put" - } - } - }, - "description": "Dashboard schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "last_modified_time": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/DashboardRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard 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": "Update a dashboard", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{pk}/cache_dashboard_screenshot/": { - "post": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardScreenshotPostSchema" - } - } - } - }, - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardCacheScreenshotResponseSchema" - } - } - }, - "description": "Dashboard async result" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Compute and cache a screenshot", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{pk}/colors": { - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "query", - "name": "mark_updated", - "schema": { - "description": "Whether to update the dashboard changed_on field", - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardColorsConfigUpdateSchema" - } - } - }, - "description": "Colors configuration", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard colors updated" - }, - "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": "Update colors configuration for a dashboard.", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{pk}/favorites/": { - "delete": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard removed from favorites" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Remove the dashboard from the user favorite list", - "tags": [ - "Dashboards" - ] - }, - "post": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard added to favorites" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Mark the dashboard as favorite for the current user", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{pk}/filter_state": { - "post": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "query", - "name": "tab_id", - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "examples": { - "numerical_range_filter": { - "description": "**This body should be stringified and put into the value field.**", - "summary": "Numerical Range Filter", - "value": { - "extraFormData": { - "filters": [ - { - "col": "tz_offset", - "op": ">=", - "val": [ - 1000 - ] - }, - { - "col": "tz_offset", - "op": "<=", - "val": [ - 2000 - ] - } - ] - }, - "filterState": { - "label": "1000 <= x <= 2000", - "value": [ - 1000, - 2000 - ] - }, - "id": "NATIVE_FILTER_ID" - } - }, - "time_grain_filter": { - "description": "**This body should be stringified and put into the value field.**", - "summary": "Time Grain Filter", - "value": { - "extraFormData": { - "time_grain_sqla": "P1W/1970-01-03T00:00:00Z" - }, - "filterState": { - "label": "Week ending Saturday", - "value": [ - "P1W/1970-01-03T00:00:00Z" - ] - }, - "id": "NATIVE_FILTER_ID" - } - }, - "time_range_filter": { - "description": "**This body should be stringified and put into the value field.**", - "summary": "Time Range Filter", - "value": { - "extraFormData": { - "time_range": "DATEADD(DATETIME('2025-01-16T00:00:00'), -7, day) : 2025-01-16T00:00:00" - }, - "filterState": { - "value": "DATEADD(DATETIME('2025-01-16T00:00:00'), -7, day) : 2025-01-16T00:00:00" - }, - "id": "NATIVE_FILTER_ID" - } - }, - "timecolumn_filter": { - "description": "**This body should be stringified and put into the value field.**", - "summary": "Time Column Filter", - "value": { - "extraFormData": { - "granularity_sqla": "order_date" - }, - "filterState": { - "value": [ - "order_date" - ] - }, - "id": "NATIVE_FILTER_ID" - } - }, - "value_filter": { - "description": "**This body should be stringified and put into the value field.**", - "summary": "Value Filter", - "value": { - "extraFormData": { - "filters": [ - { - "col": "real_name", - "op": "IN", - "val": [ - "John Doe" - ] - } - ] - }, - "filterState": { - "value": [ - "John Doe" - ] - }, - "id": "NATIVE_FILTER_ID" - } - } - }, - "schema": { - "$ref": "#/components/schemas/TemporaryCachePostSchema" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the value.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The value was stored successfully." - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a dashboard's filter state", - "tags": [ - "Dashboard Filter State" - ] - } - }, - "/api/v1/dashboard/{pk}/filter_state/{key}": { - "delete": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The value key.", - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "description": "The result of the operation", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Deleted the stored value." - }, - "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": "Delete a dashboard's filter state value", - "tags": [ - "Dashboard Filter State" - ] - }, - "get": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "value": { - "description": "The stored value", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Returns the stored value." - }, - "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 dashboard's filter state value", - "tags": [ - "Dashboard Filter State" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "tab_id", - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TemporaryCachePutSchema" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the value.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The value was stored successfully." - }, - "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": "Update a dashboard's filter state value", - "tags": [ - "Dashboard Filter State" - ] - } - }, - "/api/v1/dashboard/{pk}/filters": { - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardNativeFiltersConfigUpdateSchema" - } - } - }, - "description": "Native filters configuration", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Dashboard native filters updated" - }, - "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": "Update native filters configuration for a dashboard.", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{pk}/permalink": { - "post": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "examples": { - "numerical_range_filter": { - "summary": "Numerical Range Filter", - "value": { - "dataMask": { - "extraFormData": { - "filters": [ - { - "col": "tz_offset", - "op": ">=", - "val": [ - 1000 - ] - }, - { - "col": "tz_offset", - "op": "<=", - "val": [ - 2000 - ] - } - ] - }, - "filterState": { - "label": "1000 <= x <= 200", - "value": [ - 1000, - 2000 - ] - }, - "id": "NATIVE_FILTER_ID" - } - } - }, - "time_grain_filter": { - "summary": "Time Grain Filter", - "value": { - "dataMask": { - "extraFormData": { - "time_grain_sqla": "P1W/1970-01-03T00:00:00Z" - }, - "filterState": { - "label": "Week ending Saturday", - "value": [ - "P1W/1970-01-03T00:00:00Z" - ] - }, - "id": "NATIVE_FILTER_ID" - } - } - }, - "time_range_filter": { - "summary": "Time Range Filter", - "value": { - "dataMask": { - "extraFormData": { - "time_range": "DATEADD(DATETIME(\"2025-01-16T00:00:00\"), -7, day) : 2025-01-16T00:00:00" - }, - "filterState": { - "value": "DATEADD(DATETIME(\"2025-01-16T00:00:00\"), -7, day) : 2025-01-16T00:00:00" - }, - "id": "NATIVE_FILTER_ID" - } - } - }, - "timecolumn_filter": { - "summary": "Time Column Filter", - "value": { - "dataMask": { - "extraFormData": { - "granularity_sqla": "order_date" - }, - "filterState": { - "value": [ - "order_date" - ] - }, - "id": "NATIVE_FILTER_ID" - } - } - }, - "value_filter": { - "summary": "Value Filter", - "value": { - "dataMask": { - "extraFormData": { - "filters": [ - { - "col": "real_name", - "op": "IN", - "val": [ - "John Doe" - ] - } - ] - }, - "filterState": { - "value": [ - "John Doe" - ] - }, - "id": "NATIVE_FILTER_ID" - } - } - } - }, - "schema": { - "$ref": "#/components/schemas/DashboardPermalinkStateSchema" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the permanent link data.", - "type": "string" - }, - "url": { - "description": "permanent link.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The permanent link was stored successfully." - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a new dashboard's permanent link", - "tags": [ - "Dashboard Permanent Link" - ] - } - }, - "/api/v1/dashboard/{pk}/screenshot/{digest}/": { - "get": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "path", - "name": "digest", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "download_format", - "schema": { - "enum": [ - "png", - "pdf" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Dashboard thumbnail image" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a computed screenshot from cache", - "tags": [ - "Dashboards" - ] - } - }, - "/api/v1/dashboard/{pk}/thumbnail/{digest}/": { - "get": { - "description": "Computes async or get already computed dashboard thumbnail from cache.", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "A hex digest that makes this dashboard unique", - "in": "path", - "name": "digest", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Dashboard thumbnail image" - }, - "202": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Thumbnail does not exist on cache, fired async to compute" - }, - "302": { - "description": "Redirects to the current digest" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get dashboard's thumbnail", - "tags": [ - "Dashboards" - ] - } - }, - "/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" - ] - } - }, - "/api/v1/dataset/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Dataset bulk delete" - }, - "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": "Bulk delete datasets", - "tags": [ - "Datasets" - ] - }, - "get": { - "description": "Gets a list of datasets, 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/DatasetRestApi.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 datasets", - "tags": [ - "Datasets" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetRestApi.post" - } - } - }, - "description": "Dataset schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/DatasetRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Dataset added" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a new dataset", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/_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": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/distinct/{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/DistincResponseSchema" - } - } - }, - "description": "Distinct field 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 distinct values from field data", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/duplicate": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetDuplicateSchema" - } - } - }, - "description": "Dataset schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/DatasetDuplicateSchema" - } - }, - "type": "object" - } - } - }, - "description": "Dataset duplicated" - }, - "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": "Duplicate a dataset", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/export/": { - "get": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_export_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "Dataset export" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Download multiple datasets as YAML files", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/get_or_create/": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetOrCreateDatasetSchema" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "properties": { - "table_id": { - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "The ID of the table" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Retrieve a table by name, or create it if it does not exist", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/import/": { - "post": { - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "formData": { - "description": "upload file (ZIP or YAML)", - "format": "binary", - "type": "string" - }, - "overwrite": { - "description": "overwrite existing datasets?", - "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" - }, - "sync_columns": { - "description": "sync columns?", - "type": "boolean" - }, - "sync_metrics": { - "description": "sync metrics?", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Dataset 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 dataset(s) with associated databases", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/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": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/warm_up_cache": { - "put": { - "description": "Warms up the cache for the table. Note for slices a force refresh occurs. In terms of the `extra_filters` these can be obtained from records in the JSON encoded `logs.json` column associated with the `explore_json` action.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetCacheWarmUpRequestSchema" - } - } - }, - "description": "Identifies the database and table to warm up cache for, and any additional dashboard or filter context to use.", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetCacheWarmUpResponseSchema" - } - } - }, - "description": "Each chart's warmup status" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Warm up the cache for each chart powered by the given table", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/{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": "Dataset delete" - }, - "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 dataset", - "tags": [ - "Datasets" - ] - }, - "get": { - "description": "Get a dataset by ID", - "parameters": [ - { - "description": "The dataset ID", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - }, - { - "description": "Should Jinja macros from sql, metrics and columns be rendered and included in the response", - "in": "query", - "name": "include_rendered_sql", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "description": "The item id", - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/DatasetRestApi.get" - } - }, - "type": "object" - } - } - }, - "description": "Dataset object has been returned." - }, - "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 dataset", - "tags": [ - "Datasets" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "query", - "name": "override_columns", - "schema": { - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetRestApi.put" - } - } - }, - "description": "Dataset schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/DatasetRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Dataset 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": "Update a dataset", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/{pk}/column/{column_id}": { - "delete": { - "parameters": [ - { - "description": "The dataset pk for this column", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The column id for this dataset", - "in": "path", - "name": "column_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Column 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 dataset column", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/{pk}/metric/{metric_id}": { - "delete": { - "parameters": [ - { - "description": "The dataset pk for this column", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The metric id for this dataset", - "in": "path", - "name": "metric_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Metric 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 dataset metric", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/{pk}/refresh": { - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Dataset delete" - }, - "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": "Refresh and update columns of a dataset", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/dataset/{pk}/related_objects": { - "get": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetRelatedObjectsResponse" - } - } - }, - "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 dataset", - "tags": [ - "Datasets" - ] - } - }, - "/api/v1/datasource/{datasource_type}/{datasource_id}/column/{column_name}/values/": { - "get": { - "parameters": [ - { - "description": "The type of datasource", - "in": "path", - "name": "datasource_type", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The id of the datasource", - "in": "path", - "name": "datasource_id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The name of the column to get values for", - "in": "path", - "name": "column_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - } - ] - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "A List of distinct values for the column" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get possible values for a datasource column", - "tags": [ - "Datasources" - ] - } - }, - "/api/v1/embedded_dashboard/{uuid}": { - "get": { - "parameters": [ - { - "description": "The embedded configuration uuid", - "in": "path", - "name": "uuid", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The ui config of embedded dashboard (optional).", - "in": "query", - "name": "uiConfig", - "schema": { - "type": "number" - } - }, - { - "description": "Show filters (optional).", - "in": "query", - "name": "show_filters", - "schema": { - "type": "boolean" - } - }, - { - "description": "Expand filters (optional).", - "in": "query", - "name": "expand_filters", - "schema": { - "type": "boolean" - } - }, - { - "description": "Native filters key to apply filters. (optional).", - "in": "query", - "name": "native_filters_key", - "schema": { - "type": "string" - } - }, - { - "description": "Permalink key to apply filters. (optional).", - "in": "query", - "name": "permalink_key", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" - } - }, - "type": "object" - } - }, - "text/html": { - "schema": { - "type": "string" - } - } - }, - "description": "Result contains the embedded dashboard configuration" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a report schedule log", - "tags": [ - "Embedded Dashboard" - ] - } - }, - "/api/v1/explore/": { - "get": { - "description": "Assembles Explore related information (form_data, slice, dataset) in a single endpoint.

The information can be assembled from:
- The cache using a form_data_key
- The metadata database using a permalink_key
- Build from scratch using dataset or slice identifiers.", - "parameters": [ - { - "in": "query", - "name": "form_data_key", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "permalink_key", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "slice_id", - "schema": { - "type": "integer" - } - }, - { - "in": "query", - "name": "datasource_id", - "schema": { - "type": "integer" - } - }, - { - "in": "query", - "name": "datasource_type", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExploreContextSchema" - } - } - }, - "description": "Returns the initial context." - }, - "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": "Assemble Explore related information in a single endpoint", - "tags": [ - "Explore" - ] - } - }, - "/api/v1/explore/form_data": { - "post": { - "parameters": [ - { - "in": "query", - "name": "tab_id", - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FormDataPostSchema" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the form_data.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The form_data was stored successfully." - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a new form_data", - "tags": [ - "Explore Form Data" - ] - } - }, - "/api/v1/explore/form_data/{key}": { - "delete": { - "parameters": [ - { - "description": "The form_data key.", - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "description": "The result of the operation", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Deleted the stored form_data." - }, - "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": "Delete a form_data", - "tags": [ - "Explore Form Data" - ] - }, - "get": { - "parameters": [ - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "form_data": { - "description": "The stored form_data", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Returns the stored form_data." - }, - "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 form_data", - "tags": [ - "Explore Form Data" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "tab_id", - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FormDataPutSchema" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the form_data.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The form_data was stored successfully." - }, - "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": "Update an existing form_data", - "tags": [ - "Explore Form Data" - ] - } - }, - "/api/v1/explore/permalink": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExplorePermalinkStateSchema" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the permanent link data.", - "type": "string" - }, - "url": { - "description": "permanent link.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The permanent link was stored successfully." - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a new permanent link", - "tags": [ - "Explore Permanent Link" - ] - } - }, - "/api/v1/explore/permalink/{key}": { - "get": { - "parameters": [ - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "state": { - "description": "The stored state", - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Returns the stored form_data." - }, - "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 chart's permanent link state", - "tags": [ - "Explore Permanent Link" - ] - } - }, - "/api/v1/log/": { - "get": { - "description": "Gets a list of logs, 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/LogRestApi.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 logs", - "tags": [ - "LogRestApi" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LogRestApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/LogRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item inserted" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "LogRestApi" - ] - } - }, - "/api/v1/log/recent_activity/": { - "get": { - "parameters": [ - { - "description": "The id of the user", - "in": "path", - "name": "user_id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_recent_activity_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecentActivityResponseSchema" - } - } - }, - "description": "A List of recent activity objects" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get recent activity data for a user", - "tags": [ - "LogRestApi" - ] - } - }, - "/api/v1/log/{pk}": { - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/LogRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 log detail information", - "tags": [ - "LogRestApi" - ] - } - }, - "/api/v1/me/": { - "get": { - "description": "Gets the user object corresponding to the agent making the request, or returns a 401 error if the user is unauthenticated.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/UserResponseSchema" - } - }, - "type": "object" - } - } - }, - "description": "The current user" - }, - "401": { - "$ref": "#/components/responses/401" - } - }, - "summary": "Get the user object", - "tags": [ - "Current User" - ] - } - }, - "/api/v1/me/roles/": { - "get": { - "description": "Gets the user roles corresponding to the agent making the request, or returns a 401 error if the user is unauthenticated.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/UserResponseSchema" - } - }, - "type": "object" - } - } - }, - "description": "The current user" - }, - "401": { - "$ref": "#/components/responses/401" - } - }, - "summary": "Get the user roles", - "tags": [ - "Current User" - ] - } - }, - "/api/v1/menu/": { - "get": { - "description": "Get the menu data structure. Returns a forest like structure with the menu the user has access to", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "description": "Menu items in a forest like data structure", - "items": { - "properties": { - "childs": { - "items": { - "type": "object" - }, - "type": "array" - }, - "icon": { - "description": "Icon name to show for this menu item", - "type": "string" - }, - "label": { - "description": "Pretty name for the menu item", - "type": "string" - }, - "name": { - "description": "The internal menu item name, maps to permission_name", - "type": "string" - }, - "url": { - "description": "The URL for the menu item", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Get menu data" - }, - "401": { - "$ref": "#/components/responses/401" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Menu" - ] - } - }, - "/api/v1/query/": { - "get": { - "description": "Gets a list of queries, 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/QueryRestApi.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 queries", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/query/distinct/{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/DistincResponseSchema" - } - } - }, - "description": "Distinct field 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 distinct values from field data", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/query/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": [ - "Queries" - ] - } - }, - "/api/v1/query/stop": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StopQuerySchema" - } - } - }, - "description": "Stop query schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Query stopped" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Manually stop a query with client_id", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/query/updated_since": { - "get": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/queries_get_updated_since_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "description": "A List of queries that changed after last_updated_ms", - "items": { - "$ref": "#/components/schemas/QueryRestApi.get" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Queries list" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a list of queries that changed after last_updated_ms", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/query/{pk}": { - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/QueryRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 query detail information", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/report/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Report Schedule bulk delete" - }, - "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": "Bulk delete report schedules", - "tags": [ - "Report Schedules" - ] - }, - "get": { - "description": "Gets a list of report schedules, 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/ReportScheduleRestApi.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 report schedules", - "tags": [ - "Report Schedules" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportScheduleRestApi.post" - } - } - }, - "description": "Report Schedule schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/ReportScheduleRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Report schedule added" - }, - "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": "Create a report schedule", - "tags": [ - "Report Schedules" - ] - } - }, - "/api/v1/report/_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": [ - "Report Schedules" - ] - } - }, - "/api/v1/report/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": [ - "Report Schedules" - ] - } - }, - "/api/v1/report/slack_channels/": { - "get": { - "description": "Get slack channels", - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_slack_channels_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Slack channels" - }, - "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": "Get slack channels", - "tags": [ - "Report Schedules" - ] - } - }, - "/api/v1/report/{pk}": { - "delete": { - "parameters": [ - { - "description": "The report schedule pk", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item deleted" - }, - "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 report schedule", - "tags": [ - "Report Schedules" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/ReportScheduleRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 report schedule", - "tags": [ - "Report Schedules" - ] - }, - "put": { - "parameters": [ - { - "description": "The Report Schedule pk", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportScheduleRestApi.put" - } - } - }, - "description": "Report Schedule schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/ReportScheduleRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Report Schedule 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": "Update a report schedule", - "tags": [ - "Report Schedules" - ] - } - }, - "/api/v1/report/{pk}/log/": { - "get": { - "description": "Gets a list of report schedule logs, use Rison or JSON query parameters for filtering, sorting, pagination and for selecting specific columns and metadata.", - "parameters": [ - { - "description": "The report schedule id for these logs", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "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" - }, - "ids": { - "description": "A list of log ids", - "items": { - "type": "string" - }, - "type": "array" - }, - "result": { - "description": "The result from the get list query", - "items": { - "$ref": "#/components/schemas/ReportExecutionLogRestApi.get_list" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Items from logs" - }, - "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 report schedule logs", - "tags": [ - "Report Schedules" - ] - } - }, - "/api/v1/report/{pk}/log/{log_id}": { - "get": { - "parameters": [ - { - "description": "The report schedule pk for log", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "description": "The log pk", - "in": "path", - "name": "log_id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "description": "The log id", - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/ReportExecutionLogRestApi.get" - } - }, - "type": "object" - } - } - }, - "description": "Item log" - }, - "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 report schedule log", - "tags": [ - "Report Schedules" - ] - } - }, - "/api/v1/rowlevelsecurity/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "RLS Rule bulk delete" - }, - "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": "Bulk delete RLS rules", - "tags": [ - "Row Level Security" - ] - }, - "get": { - "description": "Gets a list of RLS, 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/RLSRestApi.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 RLS", - "tags": [ - "Row Level Security" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RLSRestApi.post" - } - } - }, - "description": "RLS schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/RLSRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "RLS Rule added" - }, - "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": "Create a new RLS rule", - "tags": [ - "Row Level Security" - ] - } - }, - "/api/v1/rowlevelsecurity/_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": [ - "Row Level Security" - ] - } - }, - "/api/v1/rowlevelsecurity/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": [ - "Row Level Security" - ] - } - }, - "/api/v1/rowlevelsecurity/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete an RLS", - "tags": [ - "Row Level Security" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/RLSRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 an RLS", - "tags": [ - "Row Level Security" - ] - }, - "put": { - "parameters": [ - { - "description": "The Rule pk", - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RLSRestApi.put" - } - } - }, - "description": "RLS schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/RLSRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Rule 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": "Update an RLS rule", - "tags": [ - "Row Level Security" - ] - } - }, - "/api/v1/saved_query/": { - "delete": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_delete_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Saved queries bulk delete" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Bulk delete saved queries", - "tags": [ - "Queries" - ] - }, - "get": { - "description": "Gets a list of saved queries, 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/SavedQueryRestApi.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 saved queries", - "tags": [ - "Queries" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedQueryRestApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/SavedQueryRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item inserted" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a saved query", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/saved_query/_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": [ - "Queries" - ] - } - }, - "/api/v1/saved_query/distinct/{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/DistincResponseSchema" - } - } - }, - "description": "Distinct field 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 distinct values from field data", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/saved_query/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 saved query(ies) and database(s) as YAML" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Download multiple saved queries as YAML files", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/saved_query/import/": { - "post": { - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "formData": { - "description": "upload file (ZIP)", - "format": "binary", - "type": "string" - }, - "overwrite": { - "description": "overwrite existing saved queries?", - "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": "Saved Query 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 saved queries with associated databases", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/saved_query/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": [ - "Queries" - ] - } - }, - "/api/v1/saved_query/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete a saved query", - "tags": [ - "Queries" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/SavedQueryRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 saved query", - "tags": [ - "Queries" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedQueryRestApi.put" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/SavedQueryRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": "Update a saved query", - "tags": [ - "Queries" - ] - } - }, - "/api/v1/security/csrf_token/": { - "get": { - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Result contains the CSRF token" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get the CSRF token", - "tags": [ - "Security" - ] - } - }, - "/api/v1/security/guest_token/": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GuestTokenCreate" - } - } - }, - "description": "Parameters for the guest token", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "token": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Result contains the guest token" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a guest token", - "tags": [ - "Security" - ] - } - }, - "/api/v1/security/login": { - "post": { - "description": "Authenticate and get a JWT access and refresh token", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "password": { - "description": "The password for authentication", - "example": "complex-password", - "type": "string" - }, - "provider": { - "description": "Choose an authentication provider", - "enum": [ - "db", - "ldap" - ], - "example": "db", - "type": "string" - }, - "refresh": { - "description": "If true a refresh token is provided also", - "example": true, - "type": "boolean" - }, - "username": { - "description": "The username for authentication", - "example": "admin", - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "access_token": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Authentication Successful" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "tags": [ - "Security" - ] - } - }, - "/api/v1/security/permissions-resources/": { - "get": { - "description": "Get a list of models", - "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/PermissionViewMenuApi.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": [] - } - ], - "tags": [ - "Security Permissions on Resources (View Menus)" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionViewMenuApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/PermissionViewMenuApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item inserted" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Permissions on Resources (View Menus)" - ] - } - }, - "/api/v1/security/permissions-resources/_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": [] - } - ], - "tags": [ - "Security Permissions on Resources (View Menus)" - ] - } - }, - "/api/v1/security/permissions-resources/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Permissions on Resources (View Menus)" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/PermissionViewMenuApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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": [] - } - ], - "tags": [ - "Security Permissions on Resources (View Menus)" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionViewMenuApi.put" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/PermissionViewMenuApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": [] - } - ], - "tags": [ - "Security Permissions on Resources (View Menus)" - ] - } - }, - "/api/v1/security/permissions/": { - "get": { - "description": "Get a list of models", - "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/PermissionApi.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": [] - } - ], - "tags": [ - "Security Permissions" - ] - } - }, - "/api/v1/security/permissions/_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": [] - } - ], - "tags": [ - "Security Permissions" - ] - } - }, - "/api/v1/security/permissions/{pk}": { - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/PermissionApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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": [] - } - ], - "tags": [ - "Security Permissions" - ] - } - }, - "/api/v1/security/refresh": { - "post": { - "description": "Use the refresh token to get a new JWT access token", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "access_token": { - "description": "A new refreshed access token", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Refresh Successful" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt_refresh": [] - } - ], - "tags": [ - "Security" - ] - } - }, - "/api/v1/security/resources/": { - "get": { - "description": "Get a list of models", - "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/ViewMenuApi.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": [] - } - ], - "tags": [ - "Security Resources (View Menus)" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ViewMenuApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/ViewMenuApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item inserted" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Resources (View Menus)" - ] - } - }, - "/api/v1/security/resources/_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": [] - } - ], - "tags": [ - "Security Resources (View Menus)" - ] - } - }, - "/api/v1/security/resources/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Resources (View Menus)" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/ViewMenuApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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": [] - } - ], - "tags": [ - "Security Resources (View Menus)" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ViewMenuApi.put" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/ViewMenuApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": [] - } - ], - "tags": [ - "Security Resources (View Menus)" - ] - } - }, - "/api/v1/security/roles/": { - "get": { - "description": "Get a list of models", - "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/SupersetRoleApi.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": [] - } - ], - "tags": [ - "Security Roles" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SupersetRoleApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string" - }, - "result": { - "$ref": "#/components/schemas/SupersetRoleApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item inserted" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/roles/_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": [] - } - ], - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/roles/search/": { - "get": { - "description": "Fetch a paginated list of roles with user and permission IDs.", - "parameters": [ - { - "in": "query", - "name": "q", - "schema": { - "properties": { - "filters": { - "items": { - "properties": { - "col": { - "enum": [ - "user_ids", - "permission_ids", - "name" - ], - "type": "string" - }, - "value": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "order_column": { - "default": "id", - "enum": [ - "id", - "name" - ], - "type": "string" - }, - "order_direction": { - "default": "asc", - "enum": [ - "asc", - "desc" - ], - "type": "string" - }, - "page": { - "default": 0, - "type": "integer" - }, - "page_size": { - "default": 10, - "type": "integer" - } - }, - "type": "object" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RolesResponseSchema" - } - } - }, - "description": "Successfully retrieved roles" - }, - "400": { - "content": { - "application/json": { - "schema": { - "properties": { - "error": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Bad request (invalid input)" - }, - "403": { - "content": { - "application/json": { - "schema": { - "properties": { - "error": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Forbidden" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "List roles", - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/roles/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Roles" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/SupersetRoleApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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": [] - } - ], - "tags": [ - "Security Roles" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SupersetRoleApi.put" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/SupersetRoleApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": [] - } - ], - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/roles/{role_id}/permissions": { - "post": { - "parameters": [ - { - "in": "path", - "name": "role_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RolePermissionPostSchema" - } - } - }, - "description": "Add role permissions schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/RolePermissionPostSchema" - } - }, - "type": "object" - } - } - }, - "description": "Permissions added" - }, - "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": [] - } - ], - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/roles/{role_id}/permissions/": { - "get": { - "parameters": [ - { - "in": "path", - "name": "role_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/RolePermissionListSchema" - } - }, - "type": "object" - } - } - }, - "description": "List of permissions" - }, - "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": [] - } - ], - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/roles/{role_id}/users": { - "put": { - "parameters": [ - { - "in": "path", - "name": "role_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RoleUserPutSchema" - } - } - }, - "description": "Update role users schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/RoleUserPutSchema" - } - }, - "type": "object" - } - } - }, - "description": "Role users updated" - }, - "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": [] - } - ], - "tags": [ - "Security Roles" - ] - } - }, - "/api/v1/security/users/": { - "get": { - "description": "Get a list of models", - "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/SupersetUserApi.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": [] - } - ], - "tags": [ - "Security Users" - ] - }, - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SupersetUserApi.post" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/SupersetUserApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": [] - } - ], - "tags": [ - "Security Users" - ] - } - }, - "/api/v1/security/users/_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": [] - } - ], - "tags": [ - "Security Users" - ] - } - }, - "/api/v1/security/users/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Security Users" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/SupersetUserApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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": [] - } - ], - "tags": [ - "Security Users" - ] - }, - "put": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SupersetUserApi.put" - } - } - }, - "description": "Model schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "$ref": "#/components/schemas/SupersetUserApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Item changed" - }, - "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": [] - } - ], - "tags": [ - "Security Users" - ] - } - }, - "/api/v1/sqllab/": { - "get": { - "description": "Assembles SQLLab bootstrap data (active_tab, databases, queries, tab_state_ids) in a single endpoint. The data can be assembled from the current user's id.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SQLLabBootstrapSchema" - } - } - }, - "description": "Returns the initial bootstrap data for SqlLab" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get the bootstrap data for SqlLab page", - "tags": [ - "SQL Lab" - ] - } - }, - "/api/v1/sqllab/estimate/": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EstimateQueryCostSchema" - } - } - }, - "description": "SQL query and params", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Query estimation result" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Estimate the SQL query execution cost", - "tags": [ - "SQL Lab" - ] - } - }, - "/api/v1/sqllab/execute/": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExecutePayloadSchema" - } - } - }, - "description": "SQL query and params", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryExecutionResponseSchema" - } - } - }, - "description": "Query execution result" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryExecutionResponseSchema" - } - } - }, - "description": "Query execution result, query still running" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Execute a SQL query", - "tags": [ - "SQL Lab" - ] - } - }, - "/api/v1/sqllab/export/{client_id}/": { - "get": { - "parameters": [ - { - "description": "The SQL query result identifier", - "in": "path", - "name": "client_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "text/csv": { - "schema": { - "type": "string" - } - } - }, - "description": "SQL query results" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Export the SQL query results to a CSV", - "tags": [ - "SQL Lab" - ] - } - }, - "/api/v1/sqllab/format_sql/": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FormatQueryPayloadSchema" - } - } - }, - "description": "SQL query", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Format SQL result" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Format SQL code", - "tags": [ - "SQL Lab" - ] - } - }, - "/api/v1/sqllab/permalink": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExplorePermalinkStateSchema" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The key to retrieve the permanent link data.", - "type": "string" - }, - "url": { - "description": "permanent link.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "The permanent link was stored successfully." - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a new permanent link", - "tags": [ - "SQL Lab Permanent Link" - ] - } - }, - "/api/v1/sqllab/permalink/{key}": { - "get": { - "parameters": [ - { - "in": "path", - "name": "key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "state": { - "description": "The stored state", - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Returns the stored form_data." - }, - "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 permanent link state for SQLLab editor.", - "tags": [ - "SQL Lab Permanent Link" - ] - } - }, - "/api/v1/sqllab/results/": { - "get": { - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/sql_lab_get_results_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryExecutionResponseSchema" - } - } - }, - "description": "SQL query execution result" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "410": { - "$ref": "#/components/responses/410" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get the result of a SQL query execution", - "tags": [ - "SQL Lab" - ] - } - }, - "/api/v1/tag/": { - "delete": { - "description": "Bulk deletes tags. This will remove all tagged objects with this tag.", - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/delete_tags_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Deletes multiple Tags" - }, - "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": "Bulk delete tags", - "tags": [ - "Tags" - ] - }, - "get": { - "description": "Get a list of tags, 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/TagRestApi.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 tags", - "tags": [ - "Tags" - ] - }, - "post": { - "description": "Create a new Tag", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagRestApi.post" - } - } - }, - "description": "Tag schema", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/TagRestApi.post" - } - }, - "type": "object" - } - } - }, - "description": "Tag added" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Create a tag", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/_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 tag API endpoints", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/bulk_create": { - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagPostBulkSchema" - } - } - }, - "description": "Tag schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagPostBulkResponseSchema" - } - } - }, - "description": "Bulk created tags and tagged objects" - }, - "302": { - "description": "Redirects to the current digest" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Bulk create tags and tagged objects", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/favorite_status/": { - "get": { - "description": "Get favorited tags for current user", - "parameters": [ - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_fav_star_ids_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetFavStarIdsSchema" - } - } - }, - "description": "None" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/get_objects/": { - "get": { - "parameters": [ - { - "in": "path", - "name": "tag_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "items": { - "$ref": "#/components/schemas/TaggedObjectEntityResponseSchema" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "List of tagged objects associated with a Tag" - }, - "302": { - "description": "Redirects to the current digest" - }, - "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 objects associated with a tag", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/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": [ - "Tags" - ] - } - }, - "/api/v1/tag/{object_type}/{object_id}/": { - "post": { - "description": "Adds tags to an object. Creates new tags if they do not already exist.", - "parameters": [ - { - "in": "path", - "name": "object_type", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "path", - "name": "object_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "tags": { - "description": "list of tag names to add to object", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Tag schema", - "required": true - }, - "responses": { - "201": { - "description": "Tag added" - }, - "302": { - "description": "Redirects to the current digest" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Add tags to an object", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/{object_type}/{object_id}/{tag}/": { - "delete": { - "parameters": [ - { - "in": "path", - "name": "tag", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "object_type", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "in": "path", - "name": "object_id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Chart delete" - }, - "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 tagged object", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/{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": "Item deleted" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete a tag", - "tags": [ - "Tags" - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "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" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "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" - }, - "result": { - "$ref": "#/components/schemas/TagRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Item from Model" - }, - "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 tag detail information", - "tags": [ - "Tags" - ] - }, - "put": { - "description": "Changes a Tag.", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagRestApi.put" - } - } - }, - "description": "Chart schema", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "number" - }, - "result": { - "$ref": "#/components/schemas/TagRestApi.put" - } - }, - "type": "object" - } - } - }, - "description": "Tag 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": "Update a tag", - "tags": [ - "Tags" - ] - } - }, - "/api/v1/tag/{pk}/favorites/": { - "delete": { - "description": "Remove the tag from the user favorite list", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Tag removed from favorites" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Tags" - ] - }, - "post": { - "description": "Marks the tag as favorite for the current user", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "result": { - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Tag added to favorites" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "Tags" - ] - } - }, - "/api/v1/user/{user_id}/avatar.png": { - "get": { - "description": "Gets the avatar URL for the user with the given ID, or returns a 401 error if the user is unauthenticated.", - "parameters": [ - { - "description": "The ID of the user", - "in": "path", - "name": "user_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "301": { - "description": "A redirect to the user's avatar URL" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - } - }, - "summary": "Get the user avatar", - "tags": [ - "User" - ] - } - }, - "/api/{version}/_openapi": { - "get": { - "description": "Get the OpenAPI spec for a specific API version", - "parameters": [ - { - "in": "path", - "name": "version", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "The OpenAPI spec" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "tags": [ - "OpenApi" - ] - } - } - }, - "servers": [ - { - "url": "http://localhost:8088" - } - ] -} diff --git a/tech_spec/Пример GET.md b/tech_spec/Пример GET.md deleted file mode 100644 index 789d7df..0000000 --- a/tech_spec/Пример GET.md +++ /dev/null @@ -1,3096 +0,0 @@ -curl -X 'GET' \ - 'https://devta.bi.dwh.rusal.com/api/v1/dataset/100?q=%7B%0A%20%20%22columns%22%3A%20%5B%0A%20%20%20%20%22string%22%0A%20%20%5D%2C%0A%20%20%22keys%22%3A%20%5B%0A%20%20%20%20%22label_columns%22%0A%20%20%5D%0A%7D' \ - -H 'accept: application/json' - - - -{ - "id": 100, - "label_columns": { - "cache_timeout": "Тайм-аут Кэша", - "changed_by.first_name": "Changed By First Name", - "changed_by.last_name": "Changed By Last Name", - "changed_on": "Changed On", - "changed_on_humanized": "Changed On Humanized", - "column_formats": "Column Formats", - "columns.advanced_data_type": "Columns Advanced Data Type", - "columns.changed_on": "Columns Changed On", - "columns.column_name": "Columns Column Name", - "columns.created_on": "Columns Created On", - "columns.description": "Columns Description", - "columns.expression": "Columns Expression", - "columns.extra": "Columns Extra", - "columns.filterable": "Columns Filterable", - "columns.groupby": "Columns Groupby", - "columns.id": "Columns Id", - "columns.is_active": "Columns Is Active", - "columns.is_dttm": "Columns Is Dttm", - "columns.python_date_format": "Columns Python Date Format", - "columns.type": "Columns Type", - "columns.type_generic": "Columns Type Generic", - "columns.uuid": "Columns Uuid", - "columns.verbose_name": "Columns Verbose Name", - "created_by.first_name": "Created By First Name", - "created_by.last_name": "Created By Last Name", - "created_on": "Created On", - "created_on_humanized": "Created On Humanized", - "currency_formats": "Currency Formats", - "database.backend": "Database Backend", - "database.database_name": "Database Database Name", - "database.id": "Database Id", - "datasource_name": "Datasource Name", - "datasource_type": "Datasource Type", - "default_endpoint": "URL для редиректа", - "description": "Описание", - "extra": "Дополнительные параметры", - "fetch_values_predicate": "Получить значения предиката", - "filter_select_enabled": "Filter Select Enabled", - "granularity_sqla": "Granularity Sqla", - "id": "id", - "is_managed_externally": "Is Managed Externally", - "is_sqllab_view": "Is Sqllab View", - "kind": "Kind", - "main_dttm_col": "Main Dttm Col", - "metrics.changed_on": "Metrics Changed On", - "metrics.created_on": "Metrics Created On", - "metrics.currency": "Metrics Currency", - "metrics.d3format": "Metrics D3Format", - "metrics.description": "Metrics Description", - "metrics.expression": "Metrics Expression", - "metrics.extra": "Metrics Extra", - "metrics.id": "Metrics Id", - "metrics.metric_name": "Metrics Metric Name", - "metrics.metric_type": "Metrics Metric Type", - "metrics.verbose_name": "Metrics Verbose Name", - "metrics.warning_text": "Metrics Warning Text", - "name": "Название", - "normalize_columns": "Normalize Columns", - "offset": "Смещение", - "order_by_choices": "Order By Choices", - "owners.first_name": "Owners First Name", - "owners.id": "Owners Id", - "owners.last_name": "Owners Last Name", - "schema": "Схема", - "select_star": "Select Star", - "sql": "Sql", - "table_name": "Имя Таблицы", - "template_params": "Template Params", - "time_grain_sqla": "Time Grain Sqla", - "uid": "Uid", - "url": "Url", - "verbose_map": "Verbose Map" - }, - "result": { - "cache_timeout": null, - "changed_by": { - "first_name": "Андрей", - "last_name": "Ткаченко" - }, - "changed_on": "2025-04-25T08:44:53.313824", - "changed_on_humanized": "5 месяцев назад", - "column_formats": {}, - "columns": [ - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.378224", - "column_name": "debt_balance_subposition_document_currency_amount", - "created_on": "2025-01-21T07:39:19.378221", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6061, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "4adde4e8-12b4-4e52-8c88-6fbe5f5bfe03", - "verbose_name": "Остаток КЗ по данной позиции, в валюте документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.384161", - "column_name": "position_line_item", - "created_on": "2025-01-21T07:39:19.384158", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6062, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "eee9d143-c73e-49e6-aafb-4605a9e8968d", - "verbose_name": "Номер строки проводки в рамках бухгалтерского документа " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.390263", - "column_name": "debt_subposition_second_local_currency_amount", - "created_on": "2025-01-21T07:39:19.390260", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6063, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "2cb2d87d-fc6e-4e42-a332-2485585b1a8a", - "verbose_name": "Сумма задолженности подпозиции во второй местной валюте" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.396079", - "column_name": "general_ledger_account_full_name", - "created_on": "2025-01-21T07:39:19.396076", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6064, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "0b8ddb1d-ff01-4a4e-8a24-0a8a35fff12a", - "verbose_name": "Подробный текст к основному счету на русском" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.402006", - "column_name": "dt_overdue", - "created_on": "2025-01-21T07:39:19.402003", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6065, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "9e67e1e2-5066-4f9a-a90c-2adbd232a8fd", - "verbose_name": "Дата, когда задолженность станет просроченной " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.408751", - "column_name": "debt_balance_document_currency_amount", - "created_on": "2025-01-21T07:39:19.408748", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6066, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "2758bef5-d965-4151-b147-bc6541b9ad85", - "verbose_name": "Остаток задолженности в валюте документа " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.414482", - "column_name": "debt_subposition_local_currency_amount", - "created_on": "2025-01-21T07:39:19.414479", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6067, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "becdba7d-389e-4a60-bbe4-6b21ea8aa0ce", - "verbose_name": "Сумма задолженности подпозиции в местной валюте" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.420394", - "column_name": "debt_subposition_document_currency_amount", - "created_on": "2025-01-21T07:39:19.420391", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6068, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "6b174693-49a1-4c06-931d-cb60aa53bf5c", - "verbose_name": "Сумма задолженности подпозиции в валюте документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.426104", - "column_name": "dt_baseline_due_date_calculation", - "created_on": "2025-01-21T07:39:19.426101", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6069, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "6f56625b-be8d-4ba6-bc39-67dea909b603", - "verbose_name": "Базовая дата для расчета срока оплаты" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.431831", - "column_name": "debt_balance_exchange_diff_second_local_currency_amount", - "created_on": "2025-01-21T07:39:19.431828", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6070, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "9adcd904-738f-45cc-a643-f5c20a3a5dd0", - "verbose_name": "ВВ2 Курсовая разница остатка позиции" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.437513", - "column_name": "debt_balance_subposition_usd_amount", - "created_on": "2025-01-21T07:39:19.437510", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6071, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "2a861c2b-848b-470f-bad5-f4c560bb86cc", - "verbose_name": "Сумма задолженности подпозиции в USD" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.443146", - "column_name": "debt_balance_exchange_diff_local_currency_amount", - "created_on": "2025-01-21T07:39:19.443143", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6072, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "ac0fec26-4cd2-43b6-b296-a475c3033829", - "verbose_name": "ВВ Курсовая разница остатка позиции" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.448797", - "column_name": "debt_balance_second_local_currency_amount", - "created_on": "2025-01-21T07:39:19.448794", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6073, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "e0bfa2e1-2a76-455d-b591-513b86d5fca2", - "verbose_name": "Остаток задолженности во второй валюте" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.454340", - "column_name": "debt_balance_local_currency_amount", - "created_on": "2025-01-21T07:39:19.454337", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6074, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "e4b41d22-9acf-4aaa-b342-2f6783877dca", - "verbose_name": "Остаток задолженности в валюте организации" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.459825", - "column_name": "general_ledger_account_code", - "created_on": "2025-01-21T07:39:19.459822", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6075, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "10e29652-0d81-4aca-bdf4-b764eef848fe", - "verbose_name": "Основной счет главной книги " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.465491", - "column_name": "contract_supervisor_employee_number", - "created_on": "2025-01-21T07:39:19.465487", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6076, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "c1f44e1f-0a60-4860-8ae0-72eabbe9b854", - "verbose_name": "Куратор договора, таб №" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.471010", - "column_name": "funds_center_name", - "created_on": "2025-01-21T07:39:19.471007", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6077, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "433b7257-7665-475e-8299-653f0acd8b70", - "verbose_name": "Подразделение финансового менеджмента, название" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.476645", - "column_name": "funds_center_code", - "created_on": "2025-01-21T07:39:19.476642", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6078, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "a3eff887-2334-4228-8677-db048b1b637f", - "verbose_name": "Подразделение финансового менеджмента, код" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.482092", - "column_name": "contract_trader_code", - "created_on": "2025-01-21T07:39:19.482089", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6079, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "97df5359-4b25-4a74-8307-af3bf6086d33", - "verbose_name": "Табельный номер трейдера договора" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.487832", - "column_name": "document_currency_amount", - "created_on": "2025-01-21T07:39:19.487829", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6080, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "2f64a898-31a1-405b-a8d4-e82735e58a23", - "verbose_name": "Сумма в валюте документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.493436", - "column_name": "dt_debt", - "created_on": "2025-01-21T07:39:19.493432", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6081, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "fc615735-f55e-4ce6-a465-d9d1d772d892", - "verbose_name": "Дата возникновения задолженности " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.499104", - "column_name": "second_local_currency_code", - "created_on": "2025-01-21T07:39:19.499101", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6082, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "cac50028-8117-49bf-b0f8-7e94c561fbfa", - "verbose_name": "Код второй внутренней валюты" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.504787", - "column_name": "reference_document_number", - "created_on": "2025-01-21T07:39:19.504784", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6083, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "8a5b92f8-5eac-4f08-a969-e09a7e808a87", - "verbose_name": "Ссылочный номер документа " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.510503", - "column_name": "reverse_document_code", - "created_on": "2025-01-21T07:39:19.510500", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6084, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "636f6cc4-f4c8-466c-aacc-33bf96cf7cb9", - "verbose_name": "№ документа сторно " - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.516145", - "column_name": "tax_code", - "created_on": "2025-01-21T07:39:19.516142", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6085, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "6123c3d7-9efb-4d38-bfa2-5b3c652b65f2", - "verbose_name": "Код налога с оборота" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.521942", - "column_name": "purchase_or_sales_group_name", - "created_on": "2025-01-21T07:39:19.521939", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6086, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "cbf45180-fc9f-4973-a9a1-7663e1fa820d", - "verbose_name": "Группа закупок/сбыта, Наименование" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.527592", - "column_name": "purchase_or_sales_group_code", - "created_on": "2025-01-21T07:39:19.527588", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6087, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "cd2d88ad-b9c1-499e-a015-e1dd57a13377", - "verbose_name": "Группа закупок/сбыта, Код" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.533186", - "column_name": "contract_supervisor_name", - "created_on": "2025-01-21T07:39:19.533183", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6088, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "d7e7634d-83e8-4196-981e-725bfc6c2a33", - "verbose_name": "Куратор договора, ФИО" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.539252", - "column_name": "responsibility_center_name", - "created_on": "2025-01-21T07:39:19.539249", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6089, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "a6e73a3c-0dac-4fde-a508-4fc0042fddc5", - "verbose_name": "Центр ответственности, наименование" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.544941", - "column_name": "responsibility_center_code", - "created_on": "2025-01-21T07:39:19.544938", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6090, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "51c606a3-7888-49dc-891b-e00896e4f6fd", - "verbose_name": "Центр ответственности, код" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.550750", - "column_name": "debt_subposition_number", - "created_on": "2025-01-21T07:39:19.550747", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6091, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "ca64f372-43a7-472a-b8b5-7521eec3b4f0", - "verbose_name": "Номер подпозиции задолженности" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.556389", - "column_name": "terms_of_payment_name", - "created_on": "2025-01-21T07:39:19.556385", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6092, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "b5306d47-8330-4131-947e-700ac13c0a89", - "verbose_name": "Наименование условия платежа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.561893", - "column_name": "terms_of_payment_code", - "created_on": "2025-01-21T07:39:19.561890", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6093, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "4b24e85c-69f1-4bf5-82be-f9dc61871a22", - "verbose_name": "Код условий платежа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.567655", - "column_name": "position_line_item_text", - "created_on": "2025-01-21T07:39:19.567652", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6094, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "2a8a052a-44d8-448d-b45a-c1b9796b8b40", - "verbose_name": "Текст к позиции" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.573197", - "column_name": "contract_trader_name", - "created_on": "2025-01-21T07:39:19.573194", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6095, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "eb8456e0-6195-445e-9532-71c318b0f8b2", - "verbose_name": "ФИО трейдера договора" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.579140", - "column_name": "external_contract_number", - "created_on": "2025-01-21T07:39:19.579137", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6096, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "1b8d9238-690f-4dd4-af50-b943190f0459", - "verbose_name": "Внешний номер договора" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.584862", - "column_name": "accounting_document_code", - "created_on": "2025-01-21T07:39:19.584859", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6097, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "ed54f536-43ef-4dc1-b40c-1a1898c8a67f", - "verbose_name": "Номер бухгалтерского документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.590511", - "column_name": "local_currency_code", - "created_on": "2025-01-21T07:39:19.590508", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6098, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "b5e5b547-89df-425e-8426-94f91a89b734", - "verbose_name": "Код внутренней валюты" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.596142", - "column_name": "clearing_document_code", - "created_on": "2025-01-21T07:39:19.596139", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6099, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "9f6f449c-c089-4c7e-ac69-edc90da69e41", - "verbose_name": "Номер документа выравнивания" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.601812", - "column_name": "document_currency_code", - "created_on": "2025-01-21T07:39:19.601809", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6100, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "de95ce01-0741-4f71-b1e0-c53388de7331", - "verbose_name": "Код валюты документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.607340", - "column_name": "country_code", - "created_on": "2025-01-21T07:39:19.607337", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6101, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "ef29b651-737c-48b4-aa5c-47c600a9a7b1", - "verbose_name": "Страна регистрации контрагента" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.618464", - "column_name": "dt_accounting_document", - "created_on": "2025-01-21T07:39:19.618461", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6103, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "090a514f-d266-4eef-8464-1db990ac23ae", - "verbose_name": "Дата документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.624135", - "column_name": "dt_clearing", - "created_on": "2025-01-21T07:39:19.624132", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6104, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "8d66942a-3989-4f2c-9b5e-849836ae782e", - "verbose_name": "Дата выравнивания" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.629772", - "column_name": "unit_balance_name", - "created_on": "2025-01-21T07:39:19.629769", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6105, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "d4f93379-6280-4a97-a3e9-942566b0ddb2", - "verbose_name": "Название БЕ" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.635548", - "column_name": "counterparty_full_name", - "created_on": "2025-01-21T07:39:19.635544", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6106, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "3cfda8c5-7a1c-4da4-b36b-d13d0e7a1c66", - "verbose_name": "Наименование контрагента" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.641084", - "column_name": "accounting_document_type", - "created_on": "2025-01-21T07:39:19.641081", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6107, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "91166cf0-ed43-4f99-8b2a-3044f3e3d47e", - "verbose_name": "Вид документа" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.646660", - "column_name": "budget_subtype_code", - "created_on": "2025-01-21T07:39:19.646657", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6108, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "0b143e81-71c8-4074-aabb-62627f0f5e5c", - "verbose_name": "Подвид бюджета" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.652166", - "column_name": "debt_period_group", - "created_on": "2025-01-21T07:39:19.652163", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6109, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "13292f04-eeac-4e8e-88fb-55a5c60b92ae", - "verbose_name": "Период ПДЗ" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.657791", - "column_name": "plant_name", - "created_on": "2025-01-21T07:39:19.657788", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6110, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "f906f7cf-033c-4263-88c9-cbace27835b6", - "verbose_name": "Название филиала" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.663369", - "column_name": "contract_number", - "created_on": "2025-01-21T07:39:19.663366", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6111, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "1e73fe7d-c1bb-4f93-9f3e-74406cf03a13", - "verbose_name": "Номер договора" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.668898", - "column_name": "assignment_number", - "created_on": "2025-01-21T07:39:19.668895", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6112, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "ef22d340-c9d2-4621-b334-bf49aa0db58f", - "verbose_name": "Номер присвоения" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.674382", - "column_name": "account_type", - "created_on": "2025-01-21T07:39:19.674379", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6113, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "5a78a1a0-d66c-41e4-81e6-04d73531b3eb", - "verbose_name": "Вид счета" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.679916", - "column_name": "unit_balance_code", - "created_on": "2025-01-21T07:39:19.679913", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6114, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "String", - "type_generic": 1, - "uuid": "d359e0c4-9fbc-41dc-8289-4eca80794aa2", - "verbose_name": "Балансовая единица" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.685491", - "column_name": "debit_or_credit", - "created_on": "2025-01-21T07:39:19.685488", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6115, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "5f811916-4d71-439b-86bd-4d143788d0c4", - "verbose_name": "Д/К" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.365982", - "column_name": "debt_balance_subposition_second_local_currency_amount", - "created_on": "2025-01-21T07:39:19.365979", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6059, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "2337bf4b-87b4-47ce-9f40-24234f846620", - "verbose_name": "Остаток КЗ по данной позиции, во второй валюте" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.372190", - "column_name": "debt_balance_subposition_local_currency_amount", - "created_on": "2025-01-21T07:39:19.372187", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6060, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "98b38bc5-2afa-4d4c-95c9-0e602998fbc1", - "verbose_name": "Остаток КЗ по данной позиции, в валюте БЕ" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.612886", - "column_name": "fiscal_year", - "created_on": "2025-01-21T07:39:19.612883", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6102, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "30e413ec-ab53-474d-95f6-de2780a513d2", - "verbose_name": "Фин. год." - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.691167", - "column_name": "local_currency_amount", - "created_on": "2025-01-21T07:39:19.691164", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6116, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "fe0b6b84-f520-4c89-b8dd-99eb2a2df5cd", - "verbose_name": "" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.696778", - "column_name": "dt", - "created_on": "2025-01-21T07:39:19.696775", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6117, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "a13ac02e-a131-4428-a4cb-4df256956129", - "verbose_name": "Дата" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.702431", - "column_name": "accounting_document_status_code", - "created_on": "2025-01-21T07:39:19.702428", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6118, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "1bb3d168-23d9-468f-9392-bcdec99e9c0c", - "verbose_name": "" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.708083", - "column_name": "plant_code", - "created_on": "2025-01-21T07:39:19.708080", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6119, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "66afeccb-d97c-4823-902d-278f6906db3b", - "verbose_name": "Завод" - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.713844", - "column_name": "plant_code-plant_name", - "created_on": "2025-01-21T07:39:19.713841", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6120, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "d038c224-d00d-41d0-96f9-0a6741bdd10c", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.719516", - "column_name": "responsibility_center_level1_name", - "created_on": "2025-01-21T07:39:19.719513", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6121, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "b42643bd-efc3-4978-b2de-2b4027a0066f", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.725106", - "column_name": "responsibility_center_level1_code", - "created_on": "2025-01-21T07:39:19.725103", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6122, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "76a8972a-3513-46da-88a0-cd59da4ed6cb", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.730795", - "column_name": "debt_balance_subpos_exch_diff_second_local_curr_amount", - "created_on": "2025-01-21T07:39:19.730792", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6123, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "5a5b0dbf-1604-4792-9dbe-2df61d02c519", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.736576", - "column_name": "debt_balance_subpos_second_local_currency_amount_reval", - "created_on": "2025-01-21T07:39:19.736573", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6124, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "0bb4b94a-ce55-4a63-b589-54235d57917f", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.742139", - "column_name": "debt_balance_with_revaluation_diff_second_currency_amount", - "created_on": "2025-01-21T07:39:19.742136", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6125, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "6df1995a-6c14-4ee7-8ff3-f2c6ac55fc0a", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.748019", - "column_name": "debt_balance_subpos_exch_diff_local_currency_amount", - "created_on": "2025-01-21T07:39:19.748015", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6126, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "b6d7b80f-3de7-488e-af1c-a493c8fd2284", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.753719", - "column_name": "exchange_diff_second_local_currency_amount", - "created_on": "2025-01-21T07:39:19.753715", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6127, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "63fc210e-698f-4e98-8cbb-422670352723", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.759229", - "column_name": "exchange_diff_local_currency_amount", - "created_on": "2025-01-21T07:39:19.759226", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6128, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "7cb066e8-03db-4d61-96d7-4410f4bdbd8b", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.764849", - "column_name": "fiscal_year_of_relevant_invoice", - "created_on": "2025-01-21T07:39:19.764846", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6129, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "60331127-d94b-42c5-99e8-6d43df3b2d89", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.770381", - "column_name": "position_number_of_relevant_invoice", - "created_on": "2025-01-21T07:39:19.770377", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6130, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "5b5e4c62-bef3-4fe6-858a-4126a76f2911", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.775983", - "column_name": "second_local_currency_amount", - "created_on": "2025-01-21T07:39:19.775980", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6131, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "eafe6175-ed93-4956-8364-d5d53f24df99", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.781895", - "column_name": "reverse_document_fiscal_year", - "created_on": "2025-01-21T07:39:19.781892", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6132, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "7d25dac3-4c00-4d1f-92e8-c561d3ef8dcd", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.787579", - "column_name": "final_position_line_item", - "created_on": "2025-01-21T07:39:19.787576", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6133, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "72f35f38-0d35-4a5a-a891-44723e45623b", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.793153", - "column_name": "final_fiscal_year", - "created_on": "2025-01-21T07:39:19.793150", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6134, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(Float64)", - "type_generic": null, - "uuid": "ee7bce0d-21fd-46f4-9fc1-c0d55a2570a6", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.798856", - "column_name": "is_second_friday", - "created_on": "2025-01-21T07:39:19.798853", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6135, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(UInt8)", - "type_generic": 0, - "uuid": "27332942-0b3e-45b9-b7bb-7673ebfe9834", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.804709", - "column_name": "deleted_flag", - "created_on": "2025-01-21T07:39:19.804706", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6136, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(UInt8)", - "type_generic": 0, - "uuid": "482d2726-0ac0-4d96-bdb4-c85fee7686ad", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.810182", - "column_name": "dttm_updated", - "created_on": "2025-01-21T07:39:19.810179", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6137, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(DateTime)", - "type_generic": 2, - "uuid": "965ab287-be1d-4ccf-9499-aa756e8369a4", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.815930", - "column_name": "filter_date", - "created_on": "2025-01-21T07:39:19.815927", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6138, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(DateTime)", - "type_generic": 2, - "uuid": "f96faa56-24ef-4a32-ab7d-a8264d84dc7e", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.821669", - "column_name": "dttm_inserted", - "created_on": "2025-01-21T07:39:19.821666", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6139, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(DateTime)", - "type_generic": 2, - "uuid": "4e46e715-ff45-4d6d-a9fb-e6dc28fdac08", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.827220", - "column_name": "dt_external_contract", - "created_on": "2025-01-21T07:39:19.827217", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6140, - "is_active": true, - "is_dttm": true, - "python_date_format": null, - "type": "Nullable(Date)", - "type_generic": 2, - "uuid": "6f0d0df8-d030-4816-913f-24d4f507106b", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.832814", - "column_name": "is_fns_restriction_list_exist", - "created_on": "2025-01-21T07:39:19.832810", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6141, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "cee2b0e4-aa7d-472e-a9a3-4c098defd74d", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.838345", - "column_name": "is_debt_daily_calculated", - "created_on": "2025-01-21T07:39:19.838342", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6142, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "10655321-340f-468a-8f98-8d9c3cc5366d", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.843929", - "column_name": "unit_balance_code_name", - "created_on": "2025-01-21T07:39:19.843926", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6143, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "c7bcedbd-023d-411d-9647-c60f10c99325", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.849508", - "column_name": "special_general_ledger_indicator", - "created_on": "2025-01-21T07:39:19.849505", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6144, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "a0446f99-c57c-4567-8bf0-a287739fa38f", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.855021", - "column_name": "is_group_company_affiliated", - "created_on": "2025-01-21T07:39:19.855017", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6145, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "55e45259-1b95-4351-b79f-a8cf3480a46a", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.860821", - "column_name": "is_related_party_rsbo", - "created_on": "2025-01-21T07:39:19.860818", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6146, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "233e7779-b7d1-4621-81ff-b30365b0123c", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.867178", - "column_name": "final_accounting_document_code", - "created_on": "2025-01-21T07:39:19.867175", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6147, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "13ced870-020d-4f8f-abc9-b3e6cf2de5f8", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.873085", - "column_name": "is_related_party_tco", - "created_on": "2025-01-21T07:39:19.873082", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6148, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "603dc460-9136-49ac-899c-bf5a39cb2c15", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.878895", - "column_name": "counterparty_search_name", - "created_on": "2025-01-21T07:39:19.878892", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6149, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "52229979-269c-4125-93b3-9edd45f23282", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.884623", - "column_name": "counterparty_truncated_code", - "created_on": "2025-01-21T07:39:19.884620", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6150, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "fc3e15b7-07a8-460a-9776-e114ffc40c70", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.890220", - "column_name": "reason_for_reversal", - "created_on": "2025-01-21T07:39:19.890217", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6151, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "cc96a82d-a5b8-414b-9de7-5c94300af04a", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.895874", - "column_name": "counterparty_mdm_code", - "created_on": "2025-01-21T07:39:19.895871", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6152, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "6a7c4678-d93f-45f2-b4cf-cc030e35eda1", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.901564", - "column_name": "counterparty_hfm_code", - "created_on": "2025-01-21T07:39:19.901561", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6153, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "0fc8b3f9-8951-4d39-8dc7-4c553bd50b66", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.907254", - "column_name": "counterparty_tin_code", - "created_on": "2025-01-21T07:39:19.907251", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6154, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "a6054696-1a78-4c0b-813d-5d7b97d4be00", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.912884", - "column_name": "is_lawsuit_exist", - "created_on": "2025-01-21T07:39:19.912881", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6155, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "ba499f9a-5db4-48dc-9ec3-29b36233845f", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.918722", - "column_name": "invoice_document_code", - "created_on": "2025-01-21T07:39:19.918719", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6156, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "c36da610-62b7-4df6-96e3-3a591b72cf56", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.924283", - "column_name": "is_bankrupt", - "created_on": "2025-01-21T07:39:19.924280", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6157, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "7ef7ad98-88ed-47c0-ab53-411fb51d260a", - "verbose_name": null - }, - { - "advanced_data_type": null, - "changed_on": "2025-01-21T07:39:19.929991", - "column_name": "counterparty_code", - "created_on": "2025-01-21T07:39:19.929988", - "description": null, - "expression": null, - "extra": "{\"warning_markdown\":null}", - "filterable": true, - "groupby": true, - "id": 6158, - "is_active": true, - "is_dttm": false, - "python_date_format": null, - "type": "Nullable(String)", - "type_generic": 1, - "uuid": "ffeff11a-5bf3-4eab-a381-08799c59f1bf", - "verbose_name": null - } - ], - "created_by": { - "first_name": "Андрей", - "last_name": "Волобуев" - }, - "created_on": "2025-01-21T07:39:19.316583", - "created_on_humanized": "8 месяцев назад", - "currency_formats": {}, - "database": { - "backend": "clickhousedb", - "database_name": "Dev Clickhouse", - "id": 19 - }, - "datasource_name": "FI-0022 Штрафы ПДЗ (click)", - "datasource_type": "table", - "default_endpoint": null, - "description": null, - "extra": null, - "fetch_values_predicate": null, - "filter_select_enabled": true, - "granularity_sqla": [ - [ - "dt_overdue", - "dt_overdue" - ], - [ - "dt_baseline_due_date_calculation", - "dt_baseline_due_date_calculation" - ], - [ - "dt_debt", - "dt_debt" - ], - [ - "dt_accounting_document", - "dt_accounting_document" - ], - [ - "dt_clearing", - "dt_clearing" - ], - [ - "dt", - "dt" - ], - [ - "dttm_updated", - "dttm_updated" - ], - [ - "filter_date", - "filter_date" - ], - [ - "dttm_inserted", - "dttm_inserted" - ], - [ - "dt_external_contract", - "dt_external_contract" - ] - ], - "id": 100, - "is_managed_externally": false, - "is_sqllab_view": false, - "kind": "virtual", - "main_dttm_col": null, - "metrics": [ - { - "changed_on": "2025-01-21T07:39:19.356732", - "created_on": "2025-01-21T07:39:19.356729", - "currency": null, - "d3format": null, - "description": null, - "expression": "SUM(\ndebt_subposition_document_currency_amount\n)", - "extra": "{\"warning_markdown\":\"\"}", - "id": 269, - "metric_name": "penalty_vd", - "metric_type": null, - "verbose_name": "Штрафы (ВД)", - "warning_text": null - }, - { - "changed_on": "2025-01-21T07:39:19.350535", - "created_on": "2025-01-21T07:39:19.350532", - "currency": null, - "d3format": null, - "description": null, - "expression": "SUM(\ndebt_subposition_local_currency_amount\n)", - "extra": "{\"warning_markdown\":\"\"}", - "id": 268, - "metric_name": "penalty_vv", - "metric_type": null, - "verbose_name": "Штрафы (ВВ)", - "warning_text": null - }, - { - "changed_on": "2025-01-21T07:39:19.344771", - "created_on": "2025-01-21T07:39:19.344768", - "currency": null, - "d3format": null, - "description": null, - "expression": "SUM(\ndebt_balance_subposition_usd_amount\n)", - "extra": "{\"warning_markdown\":\"\"}", - "id": 267, - "metric_name": "penalty_usd", - "metric_type": null, - "verbose_name": "Штрафы (USD)", - "warning_text": null - }, - { - "changed_on": "2025-01-21T07:39:19.337884", - "created_on": "2025-01-21T07:39:19.337881", - "currency": null, - "d3format": null, - "description": null, - "expression": "SUM(\ndebt_subposition_second_local_currency_amount\n)", - "extra": "{\"warning_markdown\":\"\"}", - "id": 266, - "metric_name": "penalty_vv2", - "metric_type": null, - "verbose_name": "Штрафы (ВВ2)", - "warning_text": null - } - ], - "name": "dm.FI-0022 Штрафы ПДЗ (click)", - "normalize_columns": false, - "offset": 0, - "order_by_choices": [ - [ - "[\"account_type\", true]", - "account_type По возрастанию" - ], - [ - "[\"account_type\", false]", - "account_type По убыванию" - ], - [ - "[\"accounting_document_code\", true]", - "accounting_document_code По возрастанию" - ], - [ - "[\"accounting_document_code\", false]", - "accounting_document_code По убыванию" - ], - [ - "[\"accounting_document_status_code\", true]", - "accounting_document_status_code По возрастанию" - ], - [ - "[\"accounting_document_status_code\", false]", - "accounting_document_status_code По убыванию" - ], - [ - "[\"accounting_document_type\", true]", - "accounting_document_type По возрастанию" - ], - [ - "[\"accounting_document_type\", false]", - "accounting_document_type По убыванию" - ], - [ - "[\"assignment_number\", true]", - "assignment_number По возрастанию" - ], - [ - "[\"assignment_number\", false]", - "assignment_number По убыванию" - ], - [ - "[\"budget_subtype_code\", true]", - "budget_subtype_code По возрастанию" - ], - [ - "[\"budget_subtype_code\", false]", - "budget_subtype_code По убыванию" - ], - [ - "[\"clearing_document_code\", true]", - "clearing_document_code По возрастанию" - ], - [ - "[\"clearing_document_code\", false]", - "clearing_document_code По убыванию" - ], - [ - "[\"contract_number\", true]", - "contract_number По возрастанию" - ], - [ - "[\"contract_number\", false]", - "contract_number По убыванию" - ], - [ - "[\"contract_supervisor_employee_number\", true]", - "contract_supervisor_employee_number По возрастанию" - ], - [ - "[\"contract_supervisor_employee_number\", false]", - "contract_supervisor_employee_number По убыванию" - ], - [ - "[\"contract_supervisor_name\", true]", - "contract_supervisor_name По возрастанию" - ], - [ - "[\"contract_supervisor_name\", false]", - "contract_supervisor_name По убыванию" - ], - [ - "[\"contract_trader_code\", true]", - "contract_trader_code По возрастанию" - ], - [ - "[\"contract_trader_code\", false]", - "contract_trader_code По убыванию" - ], - [ - "[\"contract_trader_name\", true]", - "contract_trader_name По возрастанию" - ], - [ - "[\"contract_trader_name\", false]", - "contract_trader_name По убыванию" - ], - [ - "[\"counterparty_code\", true]", - "counterparty_code По возрастанию" - ], - [ - "[\"counterparty_code\", false]", - "counterparty_code По убыванию" - ], - [ - "[\"counterparty_full_name\", true]", - "counterparty_full_name По возрастанию" - ], - [ - "[\"counterparty_full_name\", false]", - "counterparty_full_name По убыванию" - ], - [ - "[\"counterparty_hfm_code\", true]", - "counterparty_hfm_code По возрастанию" - ], - [ - "[\"counterparty_hfm_code\", false]", - "counterparty_hfm_code По убыванию" - ], - [ - "[\"counterparty_mdm_code\", true]", - "counterparty_mdm_code По возрастанию" - ], - [ - "[\"counterparty_mdm_code\", false]", - "counterparty_mdm_code По убыванию" - ], - [ - "[\"counterparty_search_name\", true]", - "counterparty_search_name По возрастанию" - ], - [ - "[\"counterparty_search_name\", false]", - "counterparty_search_name По убыванию" - ], - [ - "[\"counterparty_tin_code\", true]", - "counterparty_tin_code По возрастанию" - ], - [ - "[\"counterparty_tin_code\", false]", - "counterparty_tin_code По убыванию" - ], - [ - "[\"counterparty_truncated_code\", true]", - "counterparty_truncated_code По возрастанию" - ], - [ - "[\"counterparty_truncated_code\", false]", - "counterparty_truncated_code По убыванию" - ], - [ - "[\"country_code\", true]", - "country_code По возрастанию" - ], - [ - "[\"country_code\", false]", - "country_code По убыванию" - ], - [ - "[\"debit_or_credit\", true]", - "debit_or_credit По возрастанию" - ], - [ - "[\"debit_or_credit\", false]", - "debit_or_credit По убыванию" - ], - [ - "[\"debt_balance_document_currency_amount\", true]", - "debt_balance_document_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_document_currency_amount\", false]", - "debt_balance_document_currency_amount По убыванию" - ], - [ - "[\"debt_balance_exchange_diff_local_currency_amount\", true]", - "debt_balance_exchange_diff_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_exchange_diff_local_currency_amount\", false]", - "debt_balance_exchange_diff_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_exchange_diff_second_local_currency_amount\", true]", - "debt_balance_exchange_diff_second_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_exchange_diff_second_local_currency_amount\", false]", - "debt_balance_exchange_diff_second_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_local_currency_amount\", true]", - "debt_balance_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_local_currency_amount\", false]", - "debt_balance_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_second_local_currency_amount\", true]", - "debt_balance_second_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_second_local_currency_amount\", false]", - "debt_balance_second_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_subpos_exch_diff_local_currency_amount\", true]", - "debt_balance_subpos_exch_diff_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_subpos_exch_diff_local_currency_amount\", false]", - "debt_balance_subpos_exch_diff_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_subpos_exch_diff_second_local_curr_amount\", true]", - "debt_balance_subpos_exch_diff_second_local_curr_amount По возрастанию" - ], - [ - "[\"debt_balance_subpos_exch_diff_second_local_curr_amount\", false]", - "debt_balance_subpos_exch_diff_second_local_curr_amount По убыванию" - ], - [ - "[\"debt_balance_subpos_second_local_currency_amount_reval\", true]", - "debt_balance_subpos_second_local_currency_amount_reval По возрастанию" - ], - [ - "[\"debt_balance_subpos_second_local_currency_amount_reval\", false]", - "debt_balance_subpos_second_local_currency_amount_reval По убыванию" - ], - [ - "[\"debt_balance_subposition_document_currency_amount\", true]", - "debt_balance_subposition_document_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_subposition_document_currency_amount\", false]", - "debt_balance_subposition_document_currency_amount По убыванию" - ], - [ - "[\"debt_balance_subposition_local_currency_amount\", true]", - "debt_balance_subposition_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_subposition_local_currency_amount\", false]", - "debt_balance_subposition_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_subposition_second_local_currency_amount\", true]", - "debt_balance_subposition_second_local_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_subposition_second_local_currency_amount\", false]", - "debt_balance_subposition_second_local_currency_amount По убыванию" - ], - [ - "[\"debt_balance_subposition_usd_amount\", true]", - "debt_balance_subposition_usd_amount По возрастанию" - ], - [ - "[\"debt_balance_subposition_usd_amount\", false]", - "debt_balance_subposition_usd_amount По убыванию" - ], - [ - "[\"debt_balance_with_revaluation_diff_second_currency_amount\", true]", - "debt_balance_with_revaluation_diff_second_currency_amount По возрастанию" - ], - [ - "[\"debt_balance_with_revaluation_diff_second_currency_amount\", false]", - "debt_balance_with_revaluation_diff_second_currency_amount По убыванию" - ], - [ - "[\"debt_period_group\", true]", - "debt_period_group По возрастанию" - ], - [ - "[\"debt_period_group\", false]", - "debt_period_group По убыванию" - ], - [ - "[\"debt_subposition_document_currency_amount\", true]", - "debt_subposition_document_currency_amount По возрастанию" - ], - [ - "[\"debt_subposition_document_currency_amount\", false]", - "debt_subposition_document_currency_amount По убыванию" - ], - [ - "[\"debt_subposition_local_currency_amount\", true]", - "debt_subposition_local_currency_amount По возрастанию" - ], - [ - "[\"debt_subposition_local_currency_amount\", false]", - "debt_subposition_local_currency_amount По убыванию" - ], - [ - "[\"debt_subposition_number\", true]", - "debt_subposition_number По возрастанию" - ], - [ - "[\"debt_subposition_number\", false]", - "debt_subposition_number По убыванию" - ], - [ - "[\"debt_subposition_second_local_currency_amount\", true]", - "debt_subposition_second_local_currency_amount По возрастанию" - ], - [ - "[\"debt_subposition_second_local_currency_amount\", false]", - "debt_subposition_second_local_currency_amount По убыванию" - ], - [ - "[\"deleted_flag\", true]", - "deleted_flag По возрастанию" - ], - [ - "[\"deleted_flag\", false]", - "deleted_flag По убыванию" - ], - [ - "[\"document_currency_amount\", true]", - "document_currency_amount По возрастанию" - ], - [ - "[\"document_currency_amount\", false]", - "document_currency_amount По убыванию" - ], - [ - "[\"document_currency_code\", true]", - "document_currency_code По возрастанию" - ], - [ - "[\"document_currency_code\", false]", - "document_currency_code По убыванию" - ], - [ - "[\"dt\", true]", - "dt По возрастанию" - ], - [ - "[\"dt\", false]", - "dt По убыванию" - ], - [ - "[\"dt_accounting_document\", true]", - "dt_accounting_document По возрастанию" - ], - [ - "[\"dt_accounting_document\", false]", - "dt_accounting_document По убыванию" - ], - [ - "[\"dt_baseline_due_date_calculation\", true]", - "dt_baseline_due_date_calculation По возрастанию" - ], - [ - "[\"dt_baseline_due_date_calculation\", false]", - "dt_baseline_due_date_calculation По убыванию" - ], - [ - "[\"dt_clearing\", true]", - "dt_clearing По возрастанию" - ], - [ - "[\"dt_clearing\", false]", - "dt_clearing По убыванию" - ], - [ - "[\"dt_debt\", true]", - "dt_debt По возрастанию" - ], - [ - "[\"dt_debt\", false]", - "dt_debt По убыванию" - ], - [ - "[\"dt_external_contract\", true]", - "dt_external_contract По возрастанию" - ], - [ - "[\"dt_external_contract\", false]", - "dt_external_contract По убыванию" - ], - [ - "[\"dt_overdue\", true]", - "dt_overdue По возрастанию" - ], - [ - "[\"dt_overdue\", false]", - "dt_overdue По убыванию" - ], - [ - "[\"dttm_inserted\", true]", - "dttm_inserted По возрастанию" - ], - [ - "[\"dttm_inserted\", false]", - "dttm_inserted По убыванию" - ], - [ - "[\"dttm_updated\", true]", - "dttm_updated По возрастанию" - ], - [ - "[\"dttm_updated\", false]", - "dttm_updated По убыванию" - ], - [ - "[\"exchange_diff_local_currency_amount\", true]", - "exchange_diff_local_currency_amount По возрастанию" - ], - [ - "[\"exchange_diff_local_currency_amount\", false]", - "exchange_diff_local_currency_amount По убыванию" - ], - [ - "[\"exchange_diff_second_local_currency_amount\", true]", - "exchange_diff_second_local_currency_amount По возрастанию" - ], - [ - "[\"exchange_diff_second_local_currency_amount\", false]", - "exchange_diff_second_local_currency_amount По убыванию" - ], - [ - "[\"external_contract_number\", true]", - "external_contract_number По возрастанию" - ], - [ - "[\"external_contract_number\", false]", - "external_contract_number По убыванию" - ], - [ - "[\"filter_date\", true]", - "filter_date По возрастанию" - ], - [ - "[\"filter_date\", false]", - "filter_date По убыванию" - ], - [ - "[\"final_accounting_document_code\", true]", - "final_accounting_document_code По возрастанию" - ], - [ - "[\"final_accounting_document_code\", false]", - "final_accounting_document_code По убыванию" - ], - [ - "[\"final_fiscal_year\", true]", - "final_fiscal_year По возрастанию" - ], - [ - "[\"final_fiscal_year\", false]", - "final_fiscal_year По убыванию" - ], - [ - "[\"final_position_line_item\", true]", - "final_position_line_item По возрастанию" - ], - [ - "[\"final_position_line_item\", false]", - "final_position_line_item По убыванию" - ], - [ - "[\"fiscal_year\", true]", - "fiscal_year По возрастанию" - ], - [ - "[\"fiscal_year\", false]", - "fiscal_year По убыванию" - ], - [ - "[\"fiscal_year_of_relevant_invoice\", true]", - "fiscal_year_of_relevant_invoice По возрастанию" - ], - [ - "[\"fiscal_year_of_relevant_invoice\", false]", - "fiscal_year_of_relevant_invoice По убыванию" - ], - [ - "[\"funds_center_code\", true]", - "funds_center_code По возрастанию" - ], - [ - "[\"funds_center_code\", false]", - "funds_center_code По убыванию" - ], - [ - "[\"funds_center_name\", true]", - "funds_center_name По возрастанию" - ], - [ - "[\"funds_center_name\", false]", - "funds_center_name По убыванию" - ], - [ - "[\"general_ledger_account_code\", true]", - "general_ledger_account_code По возрастанию" - ], - [ - "[\"general_ledger_account_code\", false]", - "general_ledger_account_code По убыванию" - ], - [ - "[\"general_ledger_account_full_name\", true]", - "general_ledger_account_full_name По возрастанию" - ], - [ - "[\"general_ledger_account_full_name\", false]", - "general_ledger_account_full_name По убыванию" - ], - [ - "[\"invoice_document_code\", true]", - "invoice_document_code По возрастанию" - ], - [ - "[\"invoice_document_code\", false]", - "invoice_document_code По убыванию" - ], - [ - "[\"is_bankrupt\", true]", - "is_bankrupt По возрастанию" - ], - [ - "[\"is_bankrupt\", false]", - "is_bankrupt По убыванию" - ], - [ - "[\"is_debt_daily_calculated\", true]", - "is_debt_daily_calculated По возрастанию" - ], - [ - "[\"is_debt_daily_calculated\", false]", - "is_debt_daily_calculated По убыванию" - ], - [ - "[\"is_fns_restriction_list_exist\", true]", - "is_fns_restriction_list_exist По возрастанию" - ], - [ - "[\"is_fns_restriction_list_exist\", false]", - "is_fns_restriction_list_exist По убыванию" - ], - [ - "[\"is_group_company_affiliated\", true]", - "is_group_company_affiliated По возрастанию" - ], - [ - "[\"is_group_company_affiliated\", false]", - "is_group_company_affiliated По убыванию" - ], - [ - "[\"is_lawsuit_exist\", true]", - "is_lawsuit_exist По возрастанию" - ], - [ - "[\"is_lawsuit_exist\", false]", - "is_lawsuit_exist По убыванию" - ], - [ - "[\"is_related_party_rsbo\", true]", - "is_related_party_rsbo По возрастанию" - ], - [ - "[\"is_related_party_rsbo\", false]", - "is_related_party_rsbo По убыванию" - ], - [ - "[\"is_related_party_tco\", true]", - "is_related_party_tco По возрастанию" - ], - [ - "[\"is_related_party_tco\", false]", - "is_related_party_tco По убыванию" - ], - [ - "[\"is_second_friday\", true]", - "is_second_friday По возрастанию" - ], - [ - "[\"is_second_friday\", false]", - "is_second_friday По убыванию" - ], - [ - "[\"local_currency_amount\", true]", - "local_currency_amount По возрастанию" - ], - [ - "[\"local_currency_amount\", false]", - "local_currency_amount По убыванию" - ], - [ - "[\"local_currency_code\", true]", - "local_currency_code По возрастанию" - ], - [ - "[\"local_currency_code\", false]", - "local_currency_code По убыванию" - ], - [ - "[\"plant_code\", true]", - "plant_code По возрастанию" - ], - [ - "[\"plant_code\", false]", - "plant_code По убыванию" - ], - [ - "[\"plant_code-plant_name\", true]", - "plant_code-plant_name По возрастанию" - ], - [ - "[\"plant_code-plant_name\", false]", - "plant_code-plant_name По убыванию" - ], - [ - "[\"plant_name\", true]", - "plant_name По возрастанию" - ], - [ - "[\"plant_name\", false]", - "plant_name По убыванию" - ], - [ - "[\"position_line_item\", true]", - "position_line_item По возрастанию" - ], - [ - "[\"position_line_item\", false]", - "position_line_item По убыванию" - ], - [ - "[\"position_line_item_text\", true]", - "position_line_item_text По возрастанию" - ], - [ - "[\"position_line_item_text\", false]", - "position_line_item_text По убыванию" - ], - [ - "[\"position_number_of_relevant_invoice\", true]", - "position_number_of_relevant_invoice По возрастанию" - ], - [ - "[\"position_number_of_relevant_invoice\", false]", - "position_number_of_relevant_invoice По убыванию" - ], - [ - "[\"purchase_or_sales_group_code\", true]", - "purchase_or_sales_group_code По возрастанию" - ], - [ - "[\"purchase_or_sales_group_code\", false]", - "purchase_or_sales_group_code По убыванию" - ], - [ - "[\"purchase_or_sales_group_name\", true]", - "purchase_or_sales_group_name По возрастанию" - ], - [ - "[\"purchase_or_sales_group_name\", false]", - "purchase_or_sales_group_name По убыванию" - ], - [ - "[\"reason_for_reversal\", true]", - "reason_for_reversal По возрастанию" - ], - [ - "[\"reason_for_reversal\", false]", - "reason_for_reversal По убыванию" - ], - [ - "[\"reference_document_number\", true]", - "reference_document_number По возрастанию" - ], - [ - "[\"reference_document_number\", false]", - "reference_document_number По убыванию" - ], - [ - "[\"responsibility_center_code\", true]", - "responsibility_center_code По возрастанию" - ], - [ - "[\"responsibility_center_code\", false]", - "responsibility_center_code По убыванию" - ], - [ - "[\"responsibility_center_level1_code\", true]", - "responsibility_center_level1_code По возрастанию" - ], - [ - "[\"responsibility_center_level1_code\", false]", - "responsibility_center_level1_code По убыванию" - ], - [ - "[\"responsibility_center_level1_name\", true]", - "responsibility_center_level1_name По возрастанию" - ], - [ - "[\"responsibility_center_level1_name\", false]", - "responsibility_center_level1_name По убыванию" - ], - [ - "[\"responsibility_center_name\", true]", - "responsibility_center_name По возрастанию" - ], - [ - "[\"responsibility_center_name\", false]", - "responsibility_center_name По убыванию" - ], - [ - "[\"reverse_document_code\", true]", - "reverse_document_code По возрастанию" - ], - [ - "[\"reverse_document_code\", false]", - "reverse_document_code По убыванию" - ], - [ - "[\"reverse_document_fiscal_year\", true]", - "reverse_document_fiscal_year По возрастанию" - ], - [ - "[\"reverse_document_fiscal_year\", false]", - "reverse_document_fiscal_year По убыванию" - ], - [ - "[\"second_local_currency_amount\", true]", - "second_local_currency_amount По возрастанию" - ], - [ - "[\"second_local_currency_amount\", false]", - "second_local_currency_amount По убыванию" - ], - [ - "[\"second_local_currency_code\", true]", - "second_local_currency_code По возрастанию" - ], - [ - "[\"second_local_currency_code\", false]", - "second_local_currency_code По убыванию" - ], - [ - "[\"special_general_ledger_indicator\", true]", - "special_general_ledger_indicator По возрастанию" - ], - [ - "[\"special_general_ledger_indicator\", false]", - "special_general_ledger_indicator По убыванию" - ], - [ - "[\"tax_code\", true]", - "tax_code По возрастанию" - ], - [ - "[\"tax_code\", false]", - "tax_code По убыванию" - ], - [ - "[\"terms_of_payment_code\", true]", - "terms_of_payment_code По возрастанию" - ], - [ - "[\"terms_of_payment_code\", false]", - "terms_of_payment_code По убыванию" - ], - [ - "[\"terms_of_payment_name\", true]", - "terms_of_payment_name По возрастанию" - ], - [ - "[\"terms_of_payment_name\", false]", - "terms_of_payment_name По убыванию" - ], - [ - "[\"unit_balance_code\", true]", - "unit_balance_code По возрастанию" - ], - [ - "[\"unit_balance_code\", false]", - "unit_balance_code По убыванию" - ], - [ - "[\"unit_balance_code_name\", true]", - "unit_balance_code_name По возрастанию" - ], - [ - "[\"unit_balance_code_name\", false]", - "unit_balance_code_name По убыванию" - ], - [ - "[\"unit_balance_name\", true]", - "unit_balance_name По возрастанию" - ], - [ - "[\"unit_balance_name\", false]", - "unit_balance_name По убыванию" - ] - ], - "owners": [ - { - "first_name": "Андрей", - "id": 10, - "last_name": "Волобуев" - }, - { - "first_name": "admin", - "id": 9, - "last_name": "admin" - } - ], - "schema": "dm", - "select_star": "SELECT *\nFROM `dm`.`FI-0022 Штрафы ПДЗ (click)`\nLIMIT 100", - "sql": "select t1.*,\ncase \n when \"dt\" <= \"dt_overdue\" then '0. Дебиторская задолженность'\n when \"dt_overdue\" is null then '0. Дебиторская задолженность'\n when \"dt\" - \"dt_overdue\" between 0 and 5 then '1. ПДЗ до 5 дней'\n when \"dt\" - \"dt_overdue\" between 6 and 15 then '2. ПДЗ до 15 дней'\n when \"dt\" - \"dt_overdue\" between 16 and 30 then '3. ПДЗ до 30 дней'\n when \"dt\" - \"dt_overdue\" between 31 and 60 then '4. ПДЗ до 60 дней'\n when \"dt\" - \"dt_overdue\" between 61 and 90 then '5. ПДЗ до 90 дней'\n when \"dt\" - \"dt_overdue\" > 90 then '6. ПДЗ больше 90 дней'\n\nend as debt_period_group,\nif(is_debt_daily_calculated IS NULL, t1.dt, (now() - INTERVAL 1 DAY)) AS filter_date,\n plant_code || ' ' || plant_name AS \"plant_code-plant_name\",\n unit_balance_code || ' ' || unit_balance_name AS unit_balance_code_name\nfrom\ndm.account_debt_penalty t1\n LEFT JOIN dm.counterparty_td ctd\n ON t1.counterparty_code = ctd.counterparty_code\nwhere ctd.is_deleted IS NULL", - "table_name": "FI-0022 Штрафы ПДЗ (click)", - "template_params": null, - "time_grain_sqla": [ - [ - "PT1M", - "Минута" - ], - [ - "PT5M", - "5 минут" - ], - [ - "PT10M", - "10 минут" - ], - [ - "PT15M", - "15 минут" - ], - [ - "PT30M", - "30 минут" - ], - [ - "PT1H", - "Час" - ], - [ - "P1D", - "День" - ], - [ - "P1W", - "Неделя" - ], - [ - "P1M", - "Месяц" - ], - [ - "P3M", - "Квартал" - ], - [ - "P1Y", - "Год" - ] - ], - "uid": "100__table", - "url": "/tablemodelview/edit/100", - "verbose_map": { - "__timestamp": "Time", - "account_type": "Вид счета", - "accounting_document_code": "Номер бухгалтерского документа", - "accounting_document_status_code": "accounting_document_status_code", - "accounting_document_type": "Вид документа", - "assignment_number": "Номер присвоения", - "budget_subtype_code": "Подвид бюджета", - "clearing_document_code": "Номер документа выравнивания", - "contract_number": "Номер договора", - "contract_supervisor_employee_number": "Куратор договора, таб №", - "contract_supervisor_name": "Куратор договора, ФИО", - "contract_trader_code": "Табельный номер трейдера договора", - "contract_trader_name": "ФИО трейдера договора", - "counterparty_code": "counterparty_code", - "counterparty_full_name": "Наименование контрагента", - "counterparty_hfm_code": "counterparty_hfm_code", - "counterparty_mdm_code": "counterparty_mdm_code", - "counterparty_search_name": "counterparty_search_name", - "counterparty_tin_code": "counterparty_tin_code", - "counterparty_truncated_code": "counterparty_truncated_code", - "country_code": "Страна регистрации контрагента", - "debit_or_credit": "Д/К", - "debt_balance_document_currency_amount": "Остаток задолженности в валюте документа ", - "debt_balance_exchange_diff_local_currency_amount": "ВВ Курсовая разница остатка позиции", - "debt_balance_exchange_diff_second_local_currency_amount": "ВВ2 Курсовая разница остатка позиции", - "debt_balance_local_currency_amount": "Остаток задолженности в валюте организации", - "debt_balance_second_local_currency_amount": "Остаток задолженности во второй валюте", - "debt_balance_subpos_exch_diff_local_currency_amount": "debt_balance_subpos_exch_diff_local_currency_amount", - "debt_balance_subpos_exch_diff_second_local_curr_amount": "debt_balance_subpos_exch_diff_second_local_curr_amount", - "debt_balance_subpos_second_local_currency_amount_reval": "debt_balance_subpos_second_local_currency_amount_reval", - "debt_balance_subposition_document_currency_amount": "Остаток КЗ по данной позиции, в валюте документа", - "debt_balance_subposition_local_currency_amount": "Остаток КЗ по данной позиции, в валюте БЕ", - "debt_balance_subposition_second_local_currency_amount": "Остаток КЗ по данной позиции, во второй валюте", - "debt_balance_subposition_usd_amount": "Сумма задолженности подпозиции в USD", - "debt_balance_with_revaluation_diff_second_currency_amount": "debt_balance_with_revaluation_diff_second_currency_amount", - "debt_period_group": "Период ПДЗ", - "debt_subposition_document_currency_amount": "Сумма задолженности подпозиции в валюте документа", - "debt_subposition_local_currency_amount": "Сумма задолженности подпозиции в местной валюте", - "debt_subposition_number": "Номер подпозиции задолженности", - "debt_subposition_second_local_currency_amount": "Сумма задолженности подпозиции во второй местной валюте", - "deleted_flag": "deleted_flag", - "document_currency_amount": "Сумма в валюте документа", - "document_currency_code": "Код валюты документа", - "dt": "Дата", - "dt_accounting_document": "Дата документа", - "dt_baseline_due_date_calculation": "Базовая дата для расчета срока оплаты", - "dt_clearing": "Дата выравнивания", - "dt_debt": "Дата возникновения задолженности ", - "dt_external_contract": "dt_external_contract", - "dt_overdue": "Дата, когда задолженность станет просроченной ", - "dttm_inserted": "dttm_inserted", - "dttm_updated": "dttm_updated", - "exchange_diff_local_currency_amount": "exchange_diff_local_currency_amount", - "exchange_diff_second_local_currency_amount": "exchange_diff_second_local_currency_amount", - "external_contract_number": "Внешний номер договора", - "filter_date": "filter_date", - "final_accounting_document_code": "final_accounting_document_code", - "final_fiscal_year": "final_fiscal_year", - "final_position_line_item": "final_position_line_item", - "fiscal_year": "Фин. год.", - "fiscal_year_of_relevant_invoice": "fiscal_year_of_relevant_invoice", - "funds_center_code": "Подразделение финансового менеджмента, код", - "funds_center_name": "Подразделение финансового менеджмента, название", - "general_ledger_account_code": "Основной счет главной книги ", - "general_ledger_account_full_name": "Подробный текст к основному счету на русском", - "invoice_document_code": "invoice_document_code", - "is_bankrupt": "is_bankrupt", - "is_debt_daily_calculated": "is_debt_daily_calculated", - "is_fns_restriction_list_exist": "is_fns_restriction_list_exist", - "is_group_company_affiliated": "is_group_company_affiliated", - "is_lawsuit_exist": "is_lawsuit_exist", - "is_related_party_rsbo": "is_related_party_rsbo", - "is_related_party_tco": "is_related_party_tco", - "is_second_friday": "is_second_friday", - "local_currency_amount": "local_currency_amount", - "local_currency_code": "Код внутренней валюты", - "penalty_usd": "Штрафы (USD)", - "penalty_vd": "Штрафы (ВД)", - "penalty_vv": "Штрафы (ВВ)", - "penalty_vv2": "Штрафы (ВВ2)", - "plant_code": "Завод", - "plant_code-plant_name": "plant_code-plant_name", - "plant_name": "Название филиала", - "position_line_item": "Номер строки проводки в рамках бухгалтерского документа ", - "position_line_item_text": "Текст к позиции", - "position_number_of_relevant_invoice": "position_number_of_relevant_invoice", - "purchase_or_sales_group_code": "Группа закупок/сбыта, Код", - "purchase_or_sales_group_name": "Группа закупок/сбыта, Наименование", - "reason_for_reversal": "reason_for_reversal", - "reference_document_number": "Ссылочный номер документа ", - "responsibility_center_code": "Центр ответственности, код", - "responsibility_center_level1_code": "responsibility_center_level1_code", - "responsibility_center_level1_name": "responsibility_center_level1_name", - "responsibility_center_name": "Центр ответственности, наименование", - "reverse_document_code": "№ документа сторно ", - "reverse_document_fiscal_year": "reverse_document_fiscal_year", - "second_local_currency_amount": "second_local_currency_amount", - "second_local_currency_code": "Код второй внутренней валюты", - "special_general_ledger_indicator": "special_general_ledger_indicator", - "tax_code": "Код налога с оборота", - "terms_of_payment_code": "Код условий платежа", - "terms_of_payment_name": "Наименование условия платежа", - "unit_balance_code": "Балансовая единица", - "unit_balance_code_name": "unit_balance_code_name", - "unit_balance_name": "Название БЕ" - } - } -} \ No newline at end of file diff --git a/tech_spec/Пример PUT.md b/tech_spec/Пример PUT.md deleted file mode 100644 index 73d32a9..0000000 --- a/tech_spec/Пример PUT.md +++ /dev/null @@ -1,57 +0,0 @@ -put /api/v1/dataset/{pk} - -{ - "cache_timeout": 0, - "columns": [ - { - "advanced_data_type": "string", - "column_name": "string", - "description": "string", - "expression": "string", - "extra": "string", - "filterable": true, - "groupby": true, - "id": 0, - "is_active": true, - "is_dttm": true, - "python_date_format": "string", - "type": "string", - "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "verbose_name": "string" - } - ], - "database_id": 0, - "default_endpoint": "string", - "description": "string", - "external_url": "string", - "extra": "string", - "fetch_values_predicate": "string", - "filter_select_enabled": true, - "is_managed_externally": true, - "is_sqllab_view": true, - "main_dttm_col": "string", - "metrics": [ - { - "currency": "string", - "d3format": "string", - "description": "string", - "expression": "string", - "extra": "string", - "id": 0, - "metric_name": "string", - "metric_type": "string", - "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "verbose_name": "string", - "warning_text": "string" - } - ], - "normalize_columns": true, - "offset": 0, - "owners": [ - 0 - ], - "schema": "string", - "sql": "string", - "table_name": "string", - "template_params": "string" -} \ No newline at end of file diff --git a/test_update_yamls.py b/test_update_yamls.py new file mode 100644 index 0000000..c3f5b7b --- /dev/null +++ b/test_update_yamls.py @@ -0,0 +1,63 @@ +# [DEF:test_update_yamls:Module] +# +# @SEMANTICS: test, yaml, update, script +# @PURPOSE: Test script to verify update_yamls behavior. +# @LAYER: Test +# @RELATION: DEPENDS_ON -> superset_tool.utils.fileio +# @PUBLIC_API: main + +# [SECTION: IMPORTS] +import tempfile +import os +from pathlib import Path +import yaml +from superset_tool.utils.fileio import update_yamls +# [/SECTION] + +# [DEF:main:Function] +# @PURPOSE: Main test function. +# @RELATION: CALLS -> update_yamls +def main(): + # Create a temporary directory structure + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = Path(tmpdir) + + # Create a mock dashboard directory structure + dash_dir = tmp_path / "dashboard" + dash_dir.mkdir() + + # Create a mock metadata.yaml file + metadata_file = dash_dir / "metadata.yaml" + metadata_content = { + "dashboard_uuid": "12345", + "database_name": "Prod Clickhouse", + "slug": "test-dashboard" + } + with open(metadata_file, 'w') as f: + yaml.dump(metadata_content, f) + + print("Original metadata.yaml:") + with open(metadata_file, 'r') as f: + print(f.read()) + + # Test update_yamls + db_configs = [ + { + "old": {"database_name": "Prod Clickhouse"}, + "new": {"database_name": "DEV Clickhouse"} + } + ] + + update_yamls(db_configs=db_configs, path=str(dash_dir)) + + print("\nAfter update_yamls:") + with open(metadata_file, 'r') as f: + print(f.read()) + + print("Test completed.") +# [/DEF:main] + +if __name__ == "__main__": + main() + +# [/DEF:test_update_yamls]