lapapaye / parallel-ssh

Automatically exported from code.google.com/p/parallel-ssh
Other
0 stars 0 forks source link

API module to enable easier use of PSSH as a library (patch included) #100

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Patch file includes an API entrypoint in psshlib.api:

api.py has convencience wrappers for call, copy and slurp. These
are easy-to-use programmatic versions of pssh, pscp and pslurp.

Exposes an API for performing parallel SSH operations.

Three commands are supplied:

psshlib.api.call(hosts, cmdline, opts)

psshlib.api.copy(hosts, src, dst, opts)

psshlib.api.slurp(hosts, src, dst, opts)

call returns {host: (rc, stdout, stdin) | error}
copy returns {host: path | error}
slurp returns {host: path | error}

error is an error object which has an error message (or more)

opts is command line options as given to pssh/pscp/pslurp

call: Executes the given command on a set of hosts, collecting the output
copy: Copies files from the local machine to a set of remote hosts
slurp: Copies files from a set of remote hosts to local folders

Original issue reported on code.google.com by deceive...@gmail.com on 27 May 2014 at 12:59

Attachments: