waft.configuration.config_file.models module¶
Data models for configuration file handling.
- class waft.configuration.config_file.models.AgentConfig(*, port: int = 8000)¶
Bases:
BaseModelConfiguration for WAFT agent connection.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- port: int¶
- class waft.configuration.config_file.models.ConfigInfo(*, systems: list[~waft.configuration.config_file.models.ConfiguredSystem] = <factory>, proxies: list[~waft.configuration.config_file.models.ConfiguredProxy] = <factory>, groups: dict[str, list[str]] = <factory>)¶
Bases:
BaseModelDefinition of the configuration dictionary.
- groups: dict[str, list[str]]¶
- json() dict¶
Use Pydantic model_dump to serialize the system properly, converting enums to values.
- model_config: ClassVar[ConfigDict] = {'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(_ConfigInfo__context) None¶
Initialize configuration after deserialization.
- proxies: list[ConfiguredProxy]¶
- property proxy_map¶
Map proxy names to ConfiguredProxy objects.
- property system_map¶
Map system names to ConfiguredSystem objects.
- systems: list[ConfiguredSystem]¶
- waft.configuration.config_file.models.ConfiguredGroups¶
Represents a group of systems from the config file
alias of
dict[str,list[str]]
- class waft.configuration.config_file.models.ConfiguredLocalSystem(*, name: str = 'local', username: str = <factory>, hostname: str = 'localhost', port: int = 22, ssh_auth: bool = True, warp_version: str | None = None, warp_upgrade_from_version: str | None = None, cloud_provider: ~waft.enums.CloudProvider | None = None, vm_spec: str | None = None, size: str | None = None, auto_delete: bool = True, proxy: str | None = None, proxy_details: ~waft.configuration.config_file.models.ConfiguredProxy | None = None, description: str | None = None, resource_group: str | None = None, platform: ~typing.Literal['linux', 'windows', 'macos'] | None = None, client: ~waft.enums.Client = Client.LOCAL, agent: ~waft.configuration.config_file.models.AgentConfig | None = None)¶
Bases:
ConfiguredSystemLocal system is the class representing the literal local system
- hostname: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
- username: str¶
- class waft.configuration.config_file.models.ConfiguredProxy(*, name: str, username: str, hostname: str, port: int = 22, ssh_auth: bool = True)¶
Bases:
BaseModelRepresents a proxy system
- hostname: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
- port: int¶
- ssh_auth: bool¶
- username: str¶
- class waft.configuration.config_file.models.ConfiguredSystem(*, name: str, username: str, hostname: str | None = None, port: int = 22, ssh_auth: bool = True, warp_version: str | None = None, warp_upgrade_from_version: str | None = None, cloud_provider: CloudProvider | None = None, vm_spec: str | None = None, size: str | None = None, auto_delete: bool = True, proxy: str | None = None, proxy_details: ConfiguredProxy | None = None, description: str | None = None, resource_group: str | None = None, platform: Literal['linux', 'windows', 'macos'] | None = None, client: Client = Client.SSH, agent: AgentConfig | None = None)¶
Bases:
BaseModelConfiguredSystem is the python object deserialized from the configuration file
- agent: AgentConfig | None¶
- auto_delete: bool¶
- property cached_password: str | None¶
Cached target system password.
- cloud_provider: CloudProvider | None¶
- description: str | None¶
- static get_password(config: ConfiguredSystem | ConfiguredProxy) str | None¶
Prompt for password, securely.
- Parameters:
config (ConfiguredSystem | ConfiguredProxy) – Target configuration
- Returns:
System password or None if not able to secure it
- Return type:
Optional[str]
- get_platform() str¶
Determine platform from system configuration.
Priority: explicit platform field > vm_spec keywords > name keywords
- Returns:
Platform string (‘linux’, ‘windows’, or ‘macos’)
- Raises:
ValueError – If platform cannot be determined from available information
- hostname: str | None¶
- property is_local: bool¶
Indicates whether the local system client is configured.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(_ConfiguredSystem__context) None¶
Validate configuration after model initialization.
- name: str¶
- property password: str | None¶
Target system password.
- platform: Literal['linux', 'windows', 'macos'] | None¶
- port: int¶
- proxy: str | None¶
- proxy_details: ConfiguredProxy | None¶
- property proxy_password: str | None¶
Proxy system password.
- resource_group: str | None¶
- size: str | None¶
- ssh_auth: bool¶
- username: str¶
- validate_vm_configuration() None¶
Validates that vm_spec and cloud_provider both exist if one is specified.
- vm_spec: str | None¶
- warp_upgrade_from_version: str | None¶
- warp_version: str | None¶