Robot Framework SSH Library
SSHLibrary.pythonclient.PythonSSHClient Class Reference
Inheritance diagram for SSHLibrary.pythonclient.PythonSSHClient:
SSHLibrary.abstractclient.AbstractSSHClient

Public Member Functions

def get_banner (self)
 
def create_local_ssh_tunnel (self, local_port, remote_host, remote_port, bind_address)
 
def close (self)
 Closes the connection. More...
 
- Public Member Functions inherited from SSHLibrary.abstractclient.AbstractSSHClient
def __init__ (self, host, alias=None, port=22, timeout=3, newline='LF', prompt=None, term_type='vt100', width=80, height=24, path_separator='/', encoding='utf8', escape_ansi=False, encoding_errors='strict')
 
def login (self, username=None, password=None, allow_agent=False, look_for_keys=False, delay=None, proxy_cmd=None, read_config=False, jumphost_connection=None, keep_alive_interval='0 seconds')
 Logs into the remote host using password authentication. More...
 
def login_with_public_key (self, username, keyfile, password, allow_agent=False, look_for_keys=False, delay=None, proxy_cmd=None, jumphost_connection=None, read_config=False, keep_alive_interval='0 seconds')
 Logs into the remote host using the public key authentication. More...
 
def execute_command (self, command, sudo=False, sudo_password=None, timeout=None, output_during_execution=False, output_if_timeout=False, invoke_subsystem=False, forward_agent=False)
 Executes the command on the remote host. More...
 
def start_command (self, command, sudo=False, sudo_password=None, invoke_subsystem=False, forward_agent=False)
 Starts the execution of the command on the remote host. More...
 
def read_command_output (self, timeout=None, output_during_execution=False, output_if_timeout=False)
 Reads the output of the previous started command. More...
 
def write (self, text, add_newline=False)
 Writes text in the current shell. More...
 
def read (self, delay=None)
 Reads all output available in the current shell. More...
 
def read_char (self)
 Reads a single Unicode character from the current shell. More...
 
def read_until (self, expected)
 Reads output from the current shell until the expected text is encountered or the timeout expires. More...
 
def read_until_newline (self)
 Reads output from the current shell until a newline character is encountered or the timeout expires. More...
 
def read_until_prompt (self, strip_prompt=False)
 Reads output from the current shell until the prompt is encountered or the timeout expires. More...
 
def read_until_regexp (self, regexp)
 Reads output from the current shell until the regexp matches or the timeout expires. More...
 
def read_until_regexp_with_prefix (self, regexp, prefix)
 Read and return from output until regexp matches prefix + output. More...
 
def write_until_expected (self, text, expected, timeout, interval)
 Writes text repeatedly in the current shell until the expected appears in the output or the timeout expires. More...
 
def put_file (self, source, destination='.', mode='0o744', newline='', scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.put_file` with the given arguments. More...
 
def put_directory (self, source, destination='.', mode='0o744', newline='', recursive=False, scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.put_directory with the given arguments and the connection specific path separator. More...
 
def get_file (self, source, destination='.', scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.get_file with the given arguments. More...
 
def get_directory (self, source, destination='.', recursive=False, scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.get_directory with the given arguments and the connection specific path separator. More...
 
def list_dir (self, path, pattern=None, absolute=False)
 Calls :py:meth:.AbstractSFTPClient.list_dir with the given arguments. More...
 
def list_files_in_dir (self, path, pattern=None, absolute=False)
 Calls :py:meth:AbstractSFTPClient.list_files_in_dir with the given arguments. More...
 
def list_dirs_in_dir (self, path, pattern=None, absolute=False)
 Calls :py:meth:AbstractSFTPClient.list_dirs_in_dir with the given arguments. More...
 
def is_dir (self, path)
 Calls :py:meth:AbstractSFTPClient.is_dir with the given path. More...
 
def is_file (self, path)
 Calls :py:meth:AbstractSFTPClient.is_file with the given path. More...
 

Static Public Member Functions

def enable_logging (path)
 Enables logging of SSH events to a file. More...
 
def get_banner_without_login (host, port=22)
 

Static Public Attributes

 tunnel = None
 

Private Member Functions

def _get_client (self)
 
def _get_jumphost_tunnel (self, jumphost_connection)
 
def _login (self, username, password, allow_agent=False, look_for_keys=False, proxy_cmd=None, read_config=False, jumphost_connection=None, keep_alive_interval=None)
 
def _login_with_public_key (self, username, key_file, password, allow_agent, look_for_keys, proxy_cmd=None, jumphost_connection=None, read_config=False, keep_alive_interval=None)
 
def _start_command (self, command, sudo=False, sudo_password=None, invoke_subsystem=False, forward_agent=False)
 
def _create_sftp_client (self)
 
def _create_scp_transfer_client (self)
 
def _create_scp_all_client (self)
 
def _create_shell (self)
 
def _create_local_port_forwarder (self, local_port, remote_host, remote_port, bind_address)
 

Static Private Member Functions

def _read_login_ssh_config (host, username, port_number, proxy_cmd)
 
def _read_public_key_ssh_config (host, username, port_number, proxy_cmd, identity_file)
 
def _get_ssh_config_user (conf, host, user)
 
def _get_ssh_config_proxy_cmd (conf, host, proxy_cmd)
 
def _get_ssh_config_identity_file (conf, host, id_file)
 
def _get_ssh_config_port (conf, host, port_number)
 
def _get_ssh_config_host (conf, host)
 

Additional Inherited Members

- Public Attributes inherited from SSHLibrary.abstractclient.AbstractSSHClient
 config
 
 client
 
 width
 
 height
 
- Properties inherited from SSHLibrary.abstractclient.AbstractSSHClient
 sftp_client = property
 Gets the SFTP client for the connection. More...
 
 scp_transfer_client = property
 Gets the SCP client for the file transfer. More...
 
 scp_all_client = property
 Gets the SCP client for the file transfer. More...
 
 shell = property
 Gets the shell for the connection. More...
 

Detailed Description

Definition at line 68 of file pythonclient.py.

Member Function Documentation

◆ _create_local_port_forwarder()

def SSHLibrary.pythonclient.PythonSSHClient._create_local_port_forwarder (   self,
  local_port,
  remote_host,
  remote_port,
  bind_address 
)
private

Definition at line 292 of file pythonclient.py.

◆ _create_scp_all_client()

def SSHLibrary.pythonclient.PythonSSHClient._create_scp_all_client (   self)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 282 of file pythonclient.py.

◆ _create_scp_transfer_client()

def SSHLibrary.pythonclient.PythonSSHClient._create_scp_transfer_client (   self)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 279 of file pythonclient.py.

◆ _create_sftp_client()

def SSHLibrary.pythonclient.PythonSSHClient._create_sftp_client (   self)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 276 of file pythonclient.py.

◆ _create_shell()

def SSHLibrary.pythonclient.PythonSSHClient._create_shell (   self)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 285 of file pythonclient.py.

◆ _get_client()

def SSHLibrary.pythonclient.PythonSSHClient._get_client (   self)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 71 of file pythonclient.py.

◆ _get_jumphost_tunnel()

def SSHLibrary.pythonclient.PythonSSHClient._get_jumphost_tunnel (   self,
  jumphost_connection 
)
private

Definition at line 145 of file pythonclient.py.

◆ _get_ssh_config_host()

def SSHLibrary.pythonclient.PythonSSHClient._get_ssh_config_host (   conf,
  host 
)
staticprivate

Definition at line 139 of file pythonclient.py.

◆ _get_ssh_config_identity_file()

def SSHLibrary.pythonclient.PythonSSHClient._get_ssh_config_identity_file (   conf,
  host,
  id_file 
)
staticprivate

Definition at line 125 of file pythonclient.py.

◆ _get_ssh_config_port()

def SSHLibrary.pythonclient.PythonSSHClient._get_ssh_config_port (   conf,
  host,
  port_number 
)
staticprivate

Definition at line 132 of file pythonclient.py.

◆ _get_ssh_config_proxy_cmd()

def SSHLibrary.pythonclient.PythonSSHClient._get_ssh_config_proxy_cmd (   conf,
  host,
  proxy_cmd 
)
staticprivate

Definition at line 118 of file pythonclient.py.

◆ _get_ssh_config_user()

def SSHLibrary.pythonclient.PythonSSHClient._get_ssh_config_user (   conf,
  host,
  user 
)
staticprivate

Definition at line 111 of file pythonclient.py.

◆ _login()

def SSHLibrary.pythonclient.PythonSSHClient._login (   self,
  username,
  password,
  allow_agent = False,
  look_for_keys = False,
  proxy_cmd = None,
  read_config = False,
  jumphost_connection = None,
  keep_alive_interval = None 
)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 153 of file pythonclient.py.

◆ _login_with_public_key()

def SSHLibrary.pythonclient.PythonSSHClient._login_with_public_key (   self,
  username,
  key_file,
  password,
  allow_agent,
  look_for_keys,
  proxy_cmd = None,
  jumphost_connection = None,
  read_config = False,
  keep_alive_interval = None 
)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 203 of file pythonclient.py.

◆ _read_login_ssh_config()

def SSHLibrary.pythonclient.PythonSSHClient._read_login_ssh_config (   host,
  username,
  port_number,
  proxy_cmd 
)
staticprivate

Definition at line 82 of file pythonclient.py.

◆ _read_public_key_ssh_config()

def SSHLibrary.pythonclient.PythonSSHClient._read_public_key_ssh_config (   host,
  username,
  port_number,
  proxy_cmd,
  identity_file 
)
staticprivate

Definition at line 96 of file pythonclient.py.

◆ _start_command()

def SSHLibrary.pythonclient.PythonSSHClient._start_command (   self,
  command,
  sudo = False,
  sudo_password = None,
  invoke_subsystem = False,
  forward_agent = False 
)
private

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 263 of file pythonclient.py.

◆ close()

def SSHLibrary.pythonclient.PythonSSHClient.close (   self)

Closes the connection.

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 299 of file pythonclient.py.

◆ create_local_ssh_tunnel()

def SSHLibrary.pythonclient.PythonSSHClient.create_local_ssh_tunnel (   self,
  local_port,
  remote_host,
  remote_port,
  bind_address 
)

Definition at line 289 of file pythonclient.py.

◆ enable_logging()

def SSHLibrary.pythonclient.PythonSSHClient.enable_logging (   path)
static

Enables logging of SSH events to a file.

    :param str path: Path to the file the log is written to.

    :returns: `True`, if logging was successfully enabled. False otherwise.

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 77 of file pythonclient.py.

◆ get_banner()

def SSHLibrary.pythonclient.PythonSSHClient.get_banner (   self)

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 249 of file pythonclient.py.

◆ get_banner_without_login()

def SSHLibrary.pythonclient.PythonSSHClient.get_banner_without_login (   host,
  port = 22 
)
static

Reimplemented from SSHLibrary.abstractclient.AbstractSSHClient.

Definition at line 253 of file pythonclient.py.

Member Data Documentation

◆ tunnel

SSHLibrary.pythonclient.PythonSSHClient.tunnel = None
static

Definition at line 69 of file pythonclient.py.


The documentation for this class was generated from the following file: