l.s.BaseSSHClient(object) : class documentation

Part of libcloud.ssh View Source View In Hierarchy

Known subclasses: libcloud.ssh.ParamikoSSHClient, libcloud.ssh.ShellOutSSHClient

Base class representing a connection over SSH/SCP to a remote node.
Method __init__ @type hostname: C{str} @keyword hostname: Hostname or IP address to connect to.
Method connect Connect to the remote node over SSH.
Method put Upload a file to the remote node.
Method delete Delete/Unlink a file on the remote node.
Method run Run a command on a remote node.
Method close Shutdown connection to the remote node.
def __init__(self, hostname, port=22, username='root', password=None, key=None, timeout=None): (source)
@type hostname: C{str}
@keyword hostname: Hostname or IP address to connect to.

@type port: C{int}
@keyword port: TCP port to communicate on, defaults to 22.

@type username: C{str}
@keyword username: Username to use, defaults to root.

@type password: C{str}
@keyword password: Password to authenticate with.

@type key: C{list}
@keyword key: Private SSH keys to authenticate with.
def connect(self): (source)
Connect to the remote node over SSH.

@return: C{bool}
def put(self, path, contents=None, chmod=None): (source)
Upload a file to the remote node.

@type path: C{str}
@keyword path: File path on the remote node.

@type contents: C{str}
@keyword contents: File Contents.

@type chmod: C{int}
@keyword chmod: chmod file to this after creation.
def delete(self, path): (source)
Delete/Unlink a file on the remote node.

@type path: C{str}
@keyword path: File path on the remote node.
def run(self, cmd): (source)
Run a command on a remote node.

@type cmd: C{str}
@keyword cmd: Command to run.

@return C{list} of [stdout, stderr, exit_status]
def close(self): (source)
Shutdown connection to the remote node.
API Documentation for libcloud, generated by pydoctor at 2011-07-02 22:19:34.