NAME

XAS::Lib::SSH::Client::Shell - A class to interact with the SSH Shell facility

SYNOPSIS

 use XAS::Lib::SSH::Client::Shell;

 my $client = XAS::Lib::SSH::Client::Shell->new(
    -host     => 'test-xen-01',
    -username => 'root',
    -password => 'secret',
    -eol      => "\012",
 );

 $client->connect();

 my @vms = $client->call('xe vm-list params', sub {
     my $output = shift;
     ...
 });

 $client->disconnect();

DESCRIPTION

This module uses the SSH Shell subsystem to execute commands. Which means it executes a procedure on a remote host and parses the resulting output. This module inherits from XAS::Lib::SSH::Client.

METHODS

setup

This method will set up the environment to execute commands using the shell subsystem on a remote system.

run($command)

Run a command. The purpose is to run a procedure on the remote host that will interact with your process over STDIN/STDOUT. This is a work around for SSH Servers that don't support subsystems.

$command

The command to run on the remote system.

call($buffer, $parser)

This method sends a buffer to the remote host and parses the output.

The assumption with this method is that some sort of parsable data stream will be returned. After the data has been parsed the results are returned to the caller.

$buffer

The buffer to send.

$parser

A coderef to the parser that will parse the returned data. The parser will accept one parameter which is a reference to that data.

SEE ALSO

XAS::Lib::SSH::Client
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2015 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.