init_metabase
This commit is contained in:
@@ -89,7 +89,6 @@ services:
|
||||
|
||||
mongodb:
|
||||
image: mongodb/mongodb-community-server:8.0-ubi8
|
||||
restart: no
|
||||
volumes:
|
||||
- mongodb_configdb:/data/configdb
|
||||
- mongodb_data:/data/db
|
||||
@@ -104,7 +103,6 @@ services:
|
||||
# https://redis.io/fr/
|
||||
redis:
|
||||
image: redis:8.2
|
||||
restart: no
|
||||
command:
|
||||
- 'redis-server'
|
||||
- '--save 60 1'
|
||||
@@ -126,7 +124,6 @@ services:
|
||||
# https://neo4j.com/
|
||||
neo4j:
|
||||
image: neo4j:5.26.12-community
|
||||
restart: no
|
||||
ports:
|
||||
- 7473:7473
|
||||
- 7474:7474
|
||||
|
||||
@@ -3,8 +3,7 @@ import requests
|
||||
import time
|
||||
import sys
|
||||
|
||||
METABASE_URL = os.getenv("METABASE_URL", "http://127.0.0.1:3000")
|
||||
payload = {
|
||||
METABASE_URL = os.getenv("METABASE_URL", "http://metabase:3000")
|
||||
|
||||
# Admin Metabase
|
||||
ADMIN_FIRST_NAME = os.getenv("MB_FIRST_NAME", "Admin")
|
||||
@@ -198,7 +197,7 @@ if __name__ == "__main__":
|
||||
session = run_setup(token)
|
||||
|
||||
db_id = add_database(session, DB)
|
||||
coll_id = get_or_create_collection(session, "IUT Dashboard")
|
||||
coll_id = get_or_create_collection(session, "Collection Cocagne")
|
||||
|
||||
# Exemple : une question SQL
|
||||
q1 = get_or_create_question(
|
||||
@@ -210,7 +209,7 @@ if __name__ == "__main__":
|
||||
)
|
||||
|
||||
# Exemple : un dashboard
|
||||
dash_id = get_or_create_dashboard(session, "Vue d'ensemble", coll_id)
|
||||
add_question_to_dashboard(session, dash_id, q1)
|
||||
dash_id = get_or_create_dashboard(session, "Statistiques Adhérents", coll_id)
|
||||
# add_question_to_dashboard(session, dash_id, q1)
|
||||
|
||||
print("🎉 Initialisation Metabase terminée avec dashboards/questions")
|
||||
print("🎉 Initialisation Metabase terminée")
|
||||
|
||||
Reference in New Issue
Block a user