#2888: Update some additional services.

This commit is contained in:
Nick Todd
2024-12-12 17:01:40 +00:00
parent 4a52054ed6
commit 6380e01122
2 changed files with 17 additions and 2 deletions

View File

@@ -17,13 +17,15 @@ from primaite.utils.validation.port import PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class ExtendedService(Service, identifier="extendedservice"): class ExtendedService(Service, identifier="ExtendedService"):
""" """
A copy of DatabaseService that uses the extension framework instead of being part of PrimAITE. A copy of DatabaseService that uses the extension framework instead of being part of PrimAITE.
This class inherits from the `Service` class and provides methods to simulate a SQL database. This class inherits from the `Service` class and provides methods to simulate a SQL database.
""" """
config: "ExtendedService.ConfigSchema" = None
password: Optional[str] = None password: Optional[str] = None
"""Password that needs to be provided by clients if they want to connect to the DatabaseService.""" """Password that needs to be provided by clients if they want to connect to the DatabaseService."""
@@ -36,6 +38,11 @@ class ExtendedService(Service, identifier="extendedservice"):
latest_backup_file_name: str = None latest_backup_file_name: str = None
"""File name of latest backup.""" """File name of latest backup."""
class ConfigSchema(Service.ConfigSchema):
"""ConfigSchema for ExtendedService."""
type: str = "EXTENDED_SERVICE"
def __init__(self, **kwargs): def __init__(self, **kwargs):
kwargs["name"] = "ExtendedService" kwargs["name"] = "ExtendedService"
kwargs["port"] = PORT_LOOKUP["POSTGRES_SERVER"] kwargs["port"] = PORT_LOOKUP["POSTGRES_SERVER"]

View File

@@ -10,7 +10,15 @@ from primaite.utils.validation.ip_protocol import PROTOCOL_LOOKUP
from primaite.utils.validation.port import PORT_LOOKUP from primaite.utils.validation.port import PORT_LOOKUP
class TestSoftware(Service): class TestSoftware(Service, identifier="TestSoftware"):
config: "TestSoftware.ConfigSchema" = None
class ConfigSchema(Service.ConfigSchema):
"""ConfigSChema for TestSoftware."""
type: str = "TEST_SOFTWARE"
def describe_state(self) -> Dict: def describe_state(self) -> Dict:
pass pass