Backup
This commit is contained in:
32
test api.py
32
test api.py
@@ -65,10 +65,10 @@ def setup_clients():
|
||||
clients['dev'] = SupersetClient(dev_config)
|
||||
except Exception as e:
|
||||
logger.error(f"Ошибка инициализации клиента: {str(e)}")
|
||||
try:
|
||||
clients['sbx'] = SupersetClient(sandbox_config)
|
||||
except Exception as e:
|
||||
logger.error(f"Ошибка инициализации клиента: {str(e)}")
|
||||
# try:
|
||||
# clients['sbx'] = SupersetClient(sandbox_config)
|
||||
# except Exception as e:
|
||||
# logger.error(f"Ошибка инициализации клиента: {str(e)}")
|
||||
try:
|
||||
clients['prod'] = SupersetClient(prod_config)
|
||||
except Exception as e:
|
||||
@@ -84,19 +84,7 @@ def backup_dashboards(client, env_name, backup_root):
|
||||
#logger.info(f"Начало бэкапа для окружения {env_name}")
|
||||
|
||||
#print(client.get_dashboards())
|
||||
# dashboard_count,dashboard_meta = client.get_dashboards()
|
||||
# total = 0
|
||||
# success = 0
|
||||
# i=1
|
||||
# for db in dashboard_meta:
|
||||
# #total += 1
|
||||
# #print(total)
|
||||
# if db['slug']:
|
||||
# success+=1
|
||||
# print(f"{db['dashboard_title']} {i}. {db['id']}")
|
||||
# i+=1
|
||||
# for db in dashboard_meta:
|
||||
# print(f"DB Id = {db["id"]} DB title = {db["dashboard_title"]} DB SLUG - {db["slug"]}")
|
||||
print(client.get_dashboard("IM0010"))
|
||||
|
||||
|
||||
|
||||
@@ -112,11 +100,11 @@ dev_success = backup_dashboards(
|
||||
|
||||
|
||||
# Бэкап для Sandbox
|
||||
sbx_success = backup_dashboards(
|
||||
clients['sbx'],
|
||||
"SBX",
|
||||
superset_backup_repo
|
||||
)
|
||||
# sbx_success = backup_dashboards(
|
||||
# clients['sbx'],
|
||||
# "SBX",
|
||||
# superset_backup_repo
|
||||
# )
|
||||
|
||||
prod_success = backup_dashboards(
|
||||
clients['prod'],
|
||||
|
||||
Reference in New Issue
Block a user