Jump to: navigation, search

Difference between revisions of "Satori/SSHModuleProposal"

m
(update requirements)
Line 4: Line 4:
  
 
==== Desired Interface ====
 
==== Desired Interface ====
  Hello
+
  from satori.common.ssh import SSH
 +
client = SSH(host="123.456.789.11", host_password="pa$$word", host_username="Tobias")
 +
output = client.remote_execute("sudo echo hello", with_exit_code=True)
 +
print output
 +
    {'stdout': 'hello', 'stderr': '', 'exit_code': 0}
  
  
 
==== Requirements ====
 
==== Requirements ====
*
+
* Manage authentication mechanisms, retry authenticating, and prefer SSH keys.
 +
* Mange connecting and disconnecting when remote_execute is called. (Lazy load the auth object)
 +
* Support ssh proxy connections <ref name="sshproxy_connections" />, and create an implementation that provides the same behavior whether connection through a proxy or connecting to the remote host directly.
 +
* Provide a built in property, "platform_info", that will return the remote host's platform info using (python >=2.4)'s [http://docs.python.org/2/library/platform.html platform module]
 +
  * architecture, distro, version
 +
  * e.g. Ubuntu 12.04 x86_64 would return
 +
    * {'arch': 'x86_64', 'dist': 'ubuntu', 'version': '12.04'}
 +
 
 +
 
 +
<ref> name="sshproxy_connections" [https://github.com/paramiko/paramiko/blob/master/paramiko/client.py#L174] github.com/paramiko/paramiko</ref>
 +
 
 +
<references />

Revision as of 16:36, 7 March 2014

SSH Module Proposal

As an initial platform to enable data plane discovery, implement an SSH module using paramiko.

Desired Interface

from satori.common.ssh import SSH
client = SSH(host="123.456.789.11", host_password="pa$$word", host_username="Tobias")
output = client.remote_execute("sudo echo hello", with_exit_code=True)
print output
    {'stdout': 'hello', 'stderr': , 'exit_code': 0}


Requirements

  • Manage authentication mechanisms, retry authenticating, and prefer SSH keys.
  • Mange connecting and disconnecting when remote_execute is called. (Lazy load the auth object)
  • Support ssh proxy connections [1], and create an implementation that provides the same behavior whether connection through a proxy or connecting to the remote host directly.
  • Provide a built in property, "platform_info", that will return the remote host's platform info using (python >=2.4)'s platform module
 * architecture, distro, version
 * e.g. Ubuntu 12.04 x86_64 would return
   * {'arch': 'x86_64', 'dist': 'ubuntu', 'version': '12.04'}


[2]

  1. Cite error: Invalid <ref> tag; no text was provided for refs named sshproxy_connections
  2. name="sshproxy_connections" [1] github.com/paramiko/paramiko