You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Poornima BS <po...@gmail.com> on 2016/12/21 12:28:40 UTC

Intermediate response logs while runningScripts on node

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

Re: Intermediate response logs while runningScripts on node

Posted by Ignasi Barrera <na...@apache.org>.
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" <po...@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 <na...@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 <po...@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
> >
>

Re: Intermediate response logs while runningScripts on node

Posted by Poornima BS <po...@gmail.com>.
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 <na...@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 <po...@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
>

Re: Intermediate response logs while runningScripts on node

Posted by Ignasi Barrera <na...@apache.org>.
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 <po...@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