Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions