pyceo/ceo_common/interfaces/IDatabaseService.py

17 lines
598 B
Python
Raw Normal View History

2021-08-21 00:34:10 -04:00
from zope.interface import Attribute, Interface
from .IUser import IUser
class IDatabaseService(Interface):
"""Interface to create databases for users."""
2021-08-24 02:14:28 -04:00
type = Attribute('the type of databases that will be created')
auth_username = Attribute('username to a privileged user on the database host')
auth_password = Attribute('password to a privileged user on the database host')
2021-08-21 00:34:10 -04:00
def create_db(username: str) -> str:
2021-08-24 02:14:28 -04:00
"""try to create a database and user and return its password"""
2021-08-24 22:31:50 -04:00
def delete_db(username: str):
"""remove user and delete their database"""