The main differences are that you have to manually manage the SSH
connection, close its resources and that it won't fail with a nice
exception if the script execution returns non-zero.

The compute service also decorates the script to run it with sudo if
needed, and other convenient stuff.

On Dec 23, 2016 7:55 AM, "Poornima BS" <poornimabs.g...@gmail.com> wrote:

> Thanks let me try this out and get back.
>
> Any way how is manually running script using Ssh client different from
> runScriptonNodesMatching. However it uses ssh mechanism behind the scene.
>
> I get the result in runScriptOnnodesMatching at the end in execute
> response.
>
> Any thoughts.
>
> Thanks & Regards,
> Poornima.BS
>
> On Wed, Dec 21, 2016 at 6:10 PM, Ignasi Barrera <n...@apache.org> wrote:
>
> > Yes, there is, but you will need to manually run the script using the
> > SSH client instead of using the "runScript" method.
> >
> > You can do something like:
> >
> > SshClient ssh = context.utils().sshForNode().apply(node);
> > ExecChannel channel = ssh.execChannel(script);
> >
> > That ExecChannel object provides InputStreams for the stdout and
> > stderr you can use to push the realtime logs to your UI.
> >
> > On 21 December 2016 at 13:28, Poornima BS <poornimabs.g...@gmail.com>
> > wrote:
> > > Hi,
> > >
> > > Is there any way in which we can get intermediate response while
> > executing
> > > script.
> > >
> > > We have plans in pushing execution logs realtime to UI.
> > >
> > > Any help would be appreciated.
> > >
> > > Thanks & regards,
> > > Poornima.BS
> >
>

Reply via email to