mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-23 04:21:29 +00:00
refactor(services): add get_folders() to the rest of the services
This commit is contained in:
parent
0207b5a473
commit
8a4f256c12
|
@ -115,6 +115,10 @@ class Jitsi(Service):
|
||||||
storage_usage += get_storage_usage("/var/lib/jitsi-meet")
|
storage_usage += get_storage_usage("/var/lib/jitsi-meet")
|
||||||
return storage_usage
|
return storage_usage
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_folders() -> typing.List[str]:
|
||||||
|
return ["/var/lib/jitsi-meet"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_drive() -> str:
|
def get_drive() -> str:
|
||||||
return "sda1"
|
return "sda1"
|
||||||
|
|
|
@ -100,6 +100,10 @@ class MailServer(Service):
|
||||||
def get_storage_usage() -> int:
|
def get_storage_usage() -> int:
|
||||||
return get_storage_usage("/var/vmail")
|
return get_storage_usage("/var/vmail")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_folders() -> typing.List[str]:
|
||||||
|
return ["/var/vmail", "/var/sieve"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_drive() -> str:
|
def get_drive() -> str:
|
||||||
with utils.ReadUserData() as user_data:
|
with utils.ReadUserData() as user_data:
|
||||||
|
|
|
@ -122,6 +122,10 @@ class Nextcloud(Service):
|
||||||
"""
|
"""
|
||||||
return get_storage_usage("/var/lib/nextcloud")
|
return get_storage_usage("/var/lib/nextcloud")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_folders() -> typing.List[str]:
|
||||||
|
return ["/var/lib/nextcloud"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_drive() -> str:
|
def get_drive() -> str:
|
||||||
"""Get the name of disk where Nextcloud is installed."""
|
"""Get the name of disk where Nextcloud is installed."""
|
||||||
|
|
|
@ -117,5 +117,9 @@ class Ocserv(Service):
|
||||||
def get_storage_usage() -> int:
|
def get_storage_usage() -> int:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_folders() -> typing.List[str]:
|
||||||
|
return []
|
||||||
|
|
||||||
def move_to_volume(self, volume: BlockDevice) -> Job:
|
def move_to_volume(self, volume: BlockDevice) -> Job:
|
||||||
raise NotImplementedError("ocserv service is not movable")
|
raise NotImplementedError("ocserv service is not movable")
|
||||||
|
|
|
@ -103,6 +103,10 @@ class Pleroma(Service):
|
||||||
storage_usage += get_storage_usage("/var/lib/postgresql")
|
storage_usage += get_storage_usage("/var/lib/postgresql")
|
||||||
return storage_usage
|
return storage_usage
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_folders() -> typing.List[str]:
|
||||||
|
return ["/var/lib/pleroma", "/var/lib/postgresql"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_drive() -> str:
|
def get_drive() -> str:
|
||||||
with ReadUserData() as user_data:
|
with ReadUserData() as user_data:
|
||||||
|
|
Loading…
Reference in a new issue