Skip to content

Commit

Permalink
add abstract retention policy method define
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangJian He <shoothzj@gmail.com>
  • Loading branch information
shoothzj committed Mar 27, 2024
1 parent d367eea commit e713cc6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
15 changes: 15 additions & 0 deletions opengemini_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,36 @@ def write_batch_points(self, database: str, batch_points: BatchPoints):
:return: return an error message
"""

@abstractmethod
def create_database(self, database: str, rp: RpConfig = None):
"""
create database
:param rp: RpConfig
:param database: name
"""

@abstractmethod
def show_databases(self) -> List[str]:
"""
show databases
:return: returns a databases list.
"""

@abstractmethod
def drop_database(self, database: str):
"""
drop database
:param database: name
"""

@abstractmethod
def create_retention_policy(self, dbname, rp_config: RpConfig, is_default: bool):
pass

@abstractmethod
def show_retention_policies(self, dbname):
pass

@abstractmethod
def drop_retention_policy(self, dbname, retention_policy: str):
pass
12 changes: 9 additions & 3 deletions opengemini_client/client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,17 @@ def write_batch_points(self, database: str, batch_points: BatchPoints):
def create_database(self, database: str, rp: RpConfig = None):
pass

def create_database_with_rp(self, database: str, ):
pass

def show_databases(self) -> List[str]:
pass

def drop_database(self, database: str):
pass

def create_retention_policy(self, dbname, rp_config: RpConfig, is_default: bool):
pass

def show_retention_policies(self, dbname):
pass

def drop_retention_policy(self, dbname, retention_policy: str):
pass

0 comments on commit e713cc6

Please sign in to comment.