NAME
XAS::Lib::SSH::Client::Exec - A class to interact with the SSH Exec facility
SYNOPSIS
use XAS::Lib::SSH::Client::Exec;
my $client = XAS::Lib::SSH::Client::Exec->new(
-host => 'test-xen-01',
-username => 'root',
-password => 'secret',
);
$client->connect();
my @vms = $client->call('xe vm-list params', sub {
my $output = shift;
...
});
$client->disconnect();
DESCRIPTION
The module uses the SSH Exec 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 exec subsystem on a remote system.
run($command)
This method does nothing.
call($command, $parser)
This method executes the command on the remote host and parses the output.
- $command
-
The command string to be executed.
- $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.
The assumption with this method is that the remote command will return some sort of parsable data stream. After the data has been parsed the results is returned to the caller.
exit_code
Returns the exit code from the remote process.
exit_signal
Returns the exit signal from the remote process.
SEE ALSO
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.