mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
feat(backups): expose if the service can be backed up
This commit is contained in:
parent
21c5f6814c
commit
2c21bd2a14
|
@ -93,6 +93,7 @@ class Service:
|
||||||
is_movable: bool
|
is_movable: bool
|
||||||
is_required: bool
|
is_required: bool
|
||||||
is_enabled: bool
|
is_enabled: bool
|
||||||
|
can_be_backed_up: bool
|
||||||
status: ServiceStatusEnum
|
status: ServiceStatusEnum
|
||||||
url: typing.Optional[str]
|
url: typing.Optional[str]
|
||||||
dns_records: typing.Optional[typing.List[DnsRecord]]
|
dns_records: typing.Optional[typing.List[DnsRecord]]
|
||||||
|
@ -124,6 +125,7 @@ def service_to_graphql_service(service: ServiceInterface) -> Service:
|
||||||
is_movable=service.is_movable(),
|
is_movable=service.is_movable(),
|
||||||
is_required=service.is_required(),
|
is_required=service.is_required(),
|
||||||
is_enabled=service.is_enabled(),
|
is_enabled=service.is_enabled(),
|
||||||
|
can_be_backed_up=service.can_be_backed_up(),
|
||||||
status=ServiceStatusEnum(service.get_status().value),
|
status=ServiceStatusEnum(service.get_status().value),
|
||||||
url=service.get_url(),
|
url=service.get_url(),
|
||||||
dns_records=[
|
dns_records=[
|
||||||
|
|
|
@ -44,6 +44,10 @@ class Ocserv(Service):
|
||||||
def is_required() -> bool:
|
def is_required() -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def can_be_backed_up() -> bool:
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_enabled() -> bool:
|
def is_enabled() -> bool:
|
||||||
with ReadUserData() as user_data:
|
with ReadUserData() as user_data:
|
||||||
|
|
|
@ -81,6 +81,10 @@ class Service(ABC):
|
||||||
def is_required() -> bool:
|
def is_required() -> bool:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def can_be_backed_up() -> bool:
|
||||||
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def is_enabled() -> bool:
|
def is_enabled() -> bool:
|
||||||
|
|
Loading…
Reference in a new issue