NAME
XAS::Lib::SSH::Client::Subsystem - A class to interact with the SSH Subsystem facility
SYNOPSIS
use XAS::Lib::SSH::Client::Subsystem;
my $client = XAS::Lib::SSH::Client::Subsystem->new(
-host => 'auburn-xen-01',
-username => 'root',
-password => 'secret',
);
$client->connect();
$client->run('echo');
my $output = $client->call('this is a test', sub {
my $output = shift;
...
});
$client->disconnect();
DESCRIPTION
The module uses a SSH subsystem to make RPC calls. Which means it sends formated packets to the remote host and parses the resulting output. This module inherits from XAS::Lib::SSH::Client.
METHODS
setup
This method will set up the environment.
run($subsystem)
This method will invoke a subsystem on the remote host. Wither the remote host supports subsystems is dependent on the SSH Server that is running.
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
AUTHOR
Kevin L. Esteb, <kevin@kesteb.us>
COPYRIGHT AND LICENSE
Copyright (C) 2014 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.