models.options¶
Boundary specs for the per-protocol *_options tables.
Each *OptionsSpec validates the JSON-serializable curated fields of its
protocol and builds the matching runtime dataclass from
otto.host.options via to_runtime(). The runtime dataclasses (which
carry the library adapters, callables, and open extra dicts) are never
modified here.
- class otto.models.options.SshOptionsSpec(*, port: int = 22, known_hosts: ~typing.Any = None, connect_timeout: float | None = None, keepalive_interval: float | None = None, keepalive_count_max: int | None = None, client_keys: list[str] | None = None, client_host_keys: list[str] | None = None, agent_forwarding: bool = False, preferred_auth: str | list[str] | None = None, encryption_algs: list[str] | None = None, server_host_key_algs: list[str] | None = None, compression_algs: list[str] | None = None, local_forwards: list[~otto.host.options.LocalPortForward] = <factory>, remote_forwards: list[~otto.host.options.RemotePortForward] = <factory>, socks_forwards: list[~otto.host.options.SocksForward] = <factory>, extra: dict[str, ~typing.Any] = <factory>)¶
Bases:
OttoModelBoundary spec for the SSH connection options table (
[ssh_options]in lab data).Validates the asyncssh-facing tunables: port, authentication settings, cipher/host-key/compression algorithm lists, keepalive, local/remote/SOCKS port forwards, and an open
extradict for pass-through kwargs. Builds aSshOptionsruntime dataclass viato_runtime().- known_hosts : Any¶
- local_forwards : list[rt.LocalPortForward]¶
- remote_forwards : list[rt.RemotePortForward]¶
- socks_forwards : list[rt.SocksForward]¶
- to_runtime() SshOptions¶
Build the
SshOptionsruntime dataclass from the validated spec fields.
- class otto.models.options.FtpOptionsSpec(*, port: int = 21, encoding: str = 'utf-8', socket_timeout: float | None = None, connection_timeout: float | None = None, path_timeout: float | None = None, read_speed_limit: int | None = None, write_speed_limit: int | None = None, ssl: ~typing.Any = None, passive_commands: tuple[str, ...] = ('epsv', 'pasv'), extra: dict[str, ~typing.Any] = <factory>)¶
Bases:
OttoModelBoundary spec for the FTP transfer options table (
[ftp_options]in lab data).Validates port, encoding, timeout tunables, optional SSL config, speed limits, and passive-mode command order. Builds a
FtpOptionsruntime dataclass viato_runtime().- ssl : Any¶
- to_runtime() FtpOptions¶
Build the
FtpOptionsruntime dataclass from the validated spec fields.
- class otto.models.options.SftpOptionsSpec(*, env: dict[str, str] | None = None, send_env: list[str] | None = None, extra: dict[str, ~typing.Any] = <factory>)¶
Bases:
OttoModelBoundary spec for the SFTP transfer options table (
[sftp_options]in lab data).Validates environment variables to set on the remote SFTP session and an open
extradict for pass-through kwargs. Builds aSftpOptionsruntime dataclass viato_runtime().- to_runtime() SftpOptions¶
Build the
SftpOptionsruntime dataclass from the validated spec fields.
- class otto.models.options.ScpOptionsSpec(*, preserve: bool = False, recurse: bool = True, block_size: int = 16384, extra: dict[str, ~typing.Any] = <factory>)¶
Bases:
OttoModelBoundary spec for the SCP transfer options table (
[scp_options]in lab data).Validates file-preservation, recursion, and transfer block-size tunables, plus an open
extradict for pass-through kwargs. Builds aScpOptionsruntime dataclass viato_runtime().- to_runtime() ScpOptions¶
Build the
ScpOptionsruntime dataclass from the validated spec fields.
- class otto.models.options.TelnetOptionsSpec(*, port: int = 23, write_chunk_size: int = 0, write_chunk_delay: float = 0.0, cols: int = 400, rows: int = 24, encoding: str | bool = False, connect_timeout: float | None = None, echo_negotiation_timeout: float = 3.0, login_prompt: bytes = b':', login: bool = True, single_client_console: bool = False, auto_window_resize: bool = False, extra: dict[str, ~typing.Any] = <factory>)¶
Bases:
OttoModelBoundary spec for the Telnet terminal options table (
[telnet_options]in lab data).Validates port, character-encoding, terminal dimensions, write-chunking delays, login prompt delimiter, single-client-console mode, and connect/echo-negotiation timeouts. The
login_promptfield accepts a string from JSON and encodes it to bytes via_encode_login_prompt. Builds aTelnetOptionsruntime dataclass viato_runtime().- to_runtime() TelnetOptions¶
Build the
TelnetOptionsruntime dataclass from the validated spec fields.
-
class otto.models.options.NcOptionsSpec(*, exec_name: str =
'nc', port: int =9000, port_strategy: 'auto' | 'ss' | 'netstat' | 'python' | 'proc' | 'custom' ='auto', port_cmd: str | None =None, listener_check: 'auto' | 'ss' | 'netstat' | 'proc' | 'custom' ='auto', listener_cmd: str | None =None, listener_timeout: float =30.0)¶ Bases:
OttoModelBoundary spec for the netcat (nc) transfer options table (
[nc_options]in lab data).Validates the nc executable name, port number, port-discovery and listener-detection strategies, optional shell commands for each, and the listener-ready timeout. Builds a
NcOptionsruntime dataclass viato_runtime().- port_strategy : NcPortStrategy¶
- listener_check : NcListenerCheck¶
-
class otto.models.options.SnmpOptionsSpec(*, oids: tuple[str, ...] =
(), community: str ='public', port: int =161, version: '1' | '2c' ='2c', address: str | None =None)¶ Bases:
OttoModelBoundary spec for the SNMP monitor options table (
[snmp]in lab data).Validates the OID list, community string, port, SNMP version (
"1"or"2c"), and an optional override address. Builds aSnmpOptionsruntime dataclass viato_runtime().- version : Literal['1', '2c']¶
- to_runtime() SnmpOptions¶
Build the
SnmpOptionsruntime dataclass from the validated spec fields.
-
class otto.models.options.TftpOptionsSpec(*, port: int =
69, server_ip: str | None =None, block_size: int =512, timeout: float =5.0)¶ Bases:
OttoModelBoundary spec for the TFTP transfer options table (
[tftp_options]in lab data).Validates port, optional server IP override, transfer block size, and per-block timeout. Builds a
TftpOptionsruntime dataclass viato_runtime().- to_runtime() TftpOptions¶
Build the
TftpOptionsruntime dataclass from the validated spec fields.