Add get_data_directory function

This commit is contained in:
Yaroslava Lukoyanova 2023-06-05 12:10:32 +03:00
parent e9777b63cd
commit 608a523b5e
3 changed files with 19 additions and 0 deletions

View file

@ -129,6 +129,10 @@ class DockerHost(Host):
timeout=service_attributes.start_timeout, timeout=service_attributes.start_timeout,
) )
def get_data_directory(self, service_name: str) -> str:
service_attributes = self._get_service_attributes(service_name)
return service_attributes.data_directory_path
def delete_metabase(self, service_name: str) -> None: def delete_metabase(self, service_name: str) -> None:
raise NotImplementedError("Not implemented for docker") raise NotImplementedError("Not implemented for docker")

View file

@ -112,6 +112,18 @@ class Host(ABC):
service_name: Name of the service to restart. service_name: Name of the service to restart.
""" """
@abstractmethod
def get_data_directory(self, service_name: str) -> str:
"""
Getting path to data directory on node for further usage
(example: list databases pilorama.db)
Args:
service_name: Name of storage node service.
"""
@abstractmethod @abstractmethod
def delete_storage_node_data(self, service_name: str, cache_only: bool = False) -> None: def delete_storage_node_data(self, service_name: str, cache_only: bool = False) -> None:
"""Erases all data of the storage node with specified name. """Erases all data of the storage node with specified name.

View file

@ -167,6 +167,9 @@ class StorageNode(NodeBase):
def get_un_locode(self): def get_un_locode(self):
return self._get_attribute(ConfigAttributes.UN_LOCODE) return self._get_attribute(ConfigAttributes.UN_LOCODE)
def get_data_directory(self) -> str:
return self.host.get_data_directory(self.name)
def delete_blobovnicza(self): def delete_blobovnicza(self):
self.host.delete_blobovnicza(self.name) self.host.delete_blobovnicza(self.name)