waft.system.clients.http_client module¶
HTTP client for remote command execution via WAFT agent.
- class waft.system.clients.http_client.HttpClient(connection_details, *, verify_ssl: bool = True)¶
Bases:
ClientBaseHTTP client for executing commands via WAFT agent API.
This client implements the ClientBase interface for command execution and file transfer via the WAFT agent’s HTTP API. For agent management operations like schedules and metrics, use get_agent_connection() to obtain connection info.
- bind_remote_port_to_local(remote_port: int, local_port: int | None = None, remote_host: str = '127.0.0.1', local_host: str = '127.0.0.1')¶
Port forwarding not supported for HTTP client.
For HTTP client, this is a no-op that returns the remote port as-is, since the agent is already accessible via HTTP.
- close()¶
Close the HTTP client connection.
- exec_command(command: list, input: str | list[str] | None = None, retry_handler: RetryHandler | None = None, expected_exit_code: int | None = 0, auto_raise: bool = True, custom_exception: Type[Exception] | None = None, custom_exception_msg: str | None = None, **kwargs) Result¶
Execute a command on the remote system via HTTP API.
- get_agent_connection() Generator[AgentConnectionInfo, None, None]¶
Get connection parameters for the WAFT agent.
- Yields:
AgentConnectionInfo with url and token.
- get_file(remote_file_path: PurePath, local_file_path: Path) None¶
Download a file from the remote system via HTTP API.
- reset_connection()¶
Reset HTTP client connection.
- send_file(remote_file_path: PurePath, local_file_path: Path) None¶
Upload a file to the remote system via HTTP API.
- test_connection() bool¶
Test HTTP connection to WAFT agent.