portal
dev_tool.services.portal
__all__ = ['PortalService']
module-attribute
PortalService
Bases: BaseService
A service class for interacting with the portal API.
This class provides high-level methods for database and environment operations, delegating to specialized service classes for specific functionality.
The constructor for the PortalService class.
Parameters:
-
config(PortalServiceConfig | None, default:None) –The portal service configuration. If None, uses default configuration.
Source code in dev_tool/services/portal/service.py
config = config or PortalServiceConfig()
instance-attribute
client = APIClientService(RequestService(), self.config.base_url, headers)
instance-attribute
database = DatabaseService(self.config, self.client)
instance-attribute
environment = EnvironmentService(self.config, self.client)
instance-attribute
backup_database
A method that backs up a database to a local .sql file as a background task.
Parameters:
-
project(str) –The project name from pyproject.toml.
-
database(str) –The name of the database to backup.
Returns:
-
str–The task ID for tracking the backup progress.
Source code in dev_tool/services/portal/service.py
download_environment_variables
get_environment_variables
get_decrypted_content_from_file
A method that decrypts an encrypted database file.
Parameters:
-
file(Path) –The path to the encrypted file.
Returns:
-
str–The decrypted content as a string.
Source code in dev_tool/services/portal/service.py
restore_database
A method that restores a database from the portal as a background task.
Parameters:
-
database(str) –The name of the database to restore.
Returns:
-
str–The task ID for tracking the restoration progress.
Source code in dev_tool/services/portal/service.py
set_environment_variables
A method that saves environment variables to a file.
Parameters:
-
variables(str) –The environment values string to save.