GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::SSH::MECHANIZE::SESSION (3)

.ds Aq ’

NAME

Net::SSH::Mechanize::Session - manage a running ssh process.

CONTENTS

VERSION

version 0.1.3

SYNOPSIS

This class represents a sunning ssh process. It is a subclass of AnyEvent::Subprocess::Running, with methods to manage the authentication and other interaction with the sub-process.

Typically you will not create one directly, but obtain one via Net::SSH::Mechanize::Session->login, or Net::SSH::Mechanize->session

You might invoke methods directly, or via Net::SSH::Mechanize instance’s methods which delegate to the instance’s session attribute (which is an instance of this class).



   use Net::SSH::Mechanize;

   my $mech = Net::SSH::Mechanize->new(hostname => somewhere);

   my $session = $mech->session;
   # ...



CLASS METHODS

CW$obj = $class->new(%params)

Creates a new instance. Not intended for public use. Use Net::SSH::Mechanize->session instead.

INSTANCE ATTRIBUTES

CW$params = $obj->connection_params

This is a read-only accessor for the connection_params instance passed to the constructor by Net::SSH::Mechanize.

CW$obj->login_timeout($integer) =head2 CW$integer = $obj->login_timeout

This is a read-write accessor to the log-in timeout parameter passed to the constructor.

If you plan to modify it, do so before ->login or ->login_async has been invoked or it will not have any effect on anything.

INSTANCE METHODS

Note, all of these will throw an exception if used before ->login
or before ->login_async has successfully completed, except of course ->login and ->login_async themselves. These latter methods do nothing after the first invocation.

CW$session = $obj->login

This method logs into the remote host using the defined connection parameters, and returns a Net::SSH::Mechanize::Session instance on success, or throws an exception on failure.

It is safe to use in AnyEvent applications or Coro co-routines, because the implementation is asynchronous and will not block the whole process.

CW$condvar = $obj->login_async

This is an asynchronous method used to implement the synchronous ->login method. It returns an AnyEvent::CondVar instance immediately, which can be used to wait for completion, or register a callback to be notified when the log-in has completed.

CW$obj->logout

Logs out of the remote host by issuing an exit command.

CW$condvar = $obj->capture_async($command)

The returns a condvar immediately, which can be used to wait for successful completion (or otherwise) of the command(s) defined by $command.

CW$result = $obj->capture($command)

This invokes the command(s) defined by $command on the remote host, and returns the result.

CW$condvar = $obj->sudo_capture_async($command)

The returns a condvar immediately, which can be used to wait for successful completion (or otherwise) in a sudo’ed sub-shell of the command(s) defined by $command.

A password is required in connection_params for this to authenticate with sudo.

CW$result = $obj->sudo_capture($command)

This invokes the command(s) defined by $command in a sudo’ed sub-shell on the remote host, and returns the result.

AUTHOR

Nick Stokoe <wulee@cpan.org>

LICENCE AND COPYRIGHT

Copyright (c) 2011, Nick Stokoe <wulee@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::SSH::MECHANIZE::SESSION (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.