selfprivacy-rest-api/selfprivacy_api/graphql/queries/system.py

69 lines
1.5 KiB
Python
Raw Normal View History

2022-06-24 13:05:18 +00:00
"""Common system information and settings"""
# pylint: disable=too-few-public-methods
2022-06-24 12:26:51 +00:00
import typing
import strawberry
from selfprivacy_api.graphql.queries.common import Alert
from selfprivacy_api.graphql.queries.providers import DnsProvider, ServerProvider
@strawberry.type
class DnsRecord:
2022-06-24 13:05:18 +00:00
"""DNS record"""
2022-06-24 12:26:51 +00:00
recordType: str
name: str
content: str
ttl: int
priority: typing.Optional[int]
@strawberry.type
class SystemDomainInfo:
2022-06-24 13:05:18 +00:00
"""Information about the system domain"""
2022-06-24 12:26:51 +00:00
domain: str
hostname: str
provider: DnsProvider
required_dns_records: typing.List[DnsRecord]
@strawberry.type
class AutoUpgradeOptions:
2022-06-24 13:05:18 +00:00
"""Automatic upgrade options"""
2022-06-24 12:26:51 +00:00
enable: bool
allow_reboot: bool
@strawberry.type
class SshSettings:
2022-06-24 13:05:18 +00:00
"""SSH settings and root SSH keys"""
2022-06-24 12:26:51 +00:00
enable: bool
password_authentication: bool
root_ssh_keys: typing.List[str]
@strawberry.type
class SystemSettings:
2022-06-24 13:05:18 +00:00
"""Common system settings"""
2022-06-24 12:26:51 +00:00
auto_upgrade: AutoUpgradeOptions
ssh: SshSettings
timezone: str
@strawberry.type
class SystemInfo:
2022-06-24 13:05:18 +00:00
"""System components versions"""
2022-06-24 12:26:51 +00:00
system_version: str
python_version: str
@strawberry.type
class SystemProviderInfo:
2022-06-24 13:05:18 +00:00
"""Information about the VPS/Dedicated server provider"""
2022-06-24 12:26:51 +00:00
provider: ServerProvider
id: str
@strawberry.type
class System:
"""
Base system type which represents common system status
"""
status: Alert
domain: SystemDomainInfo
settings: SystemSettings
info: SystemInfo
provider: SystemProviderInfo
2022-06-24 13:05:18 +00:00
busy: bool