Initialize the cosdata client
()
| 17 | host = os.getenv("COSDATA_HOST", "http://127.0.0.1:8443") |
| 18 | |
| 19 | def create_session(): |
| 20 | """Initialize the cosdata client""" |
| 21 | # Use environment variable from .env file if available, otherwise prompt |
| 22 | password = os.getenv("COSDATA_PASSWORD") |
| 23 | if not password: |
| 24 | password = getpass.getpass("Enter admin password: ") |
| 25 | |
| 26 | username = os.getenv("COSDATA_USERNAME", "admin") |
| 27 | |
| 28 | global client |
| 29 | client = Client(host=host, username=username, password=password, verify=False) |
| 30 | return client |
| 31 | |
| 32 | |
| 33 | def create_db(name: str, description: str | None = None): |