[j-nsp] sequential commands in SLAX

Wojciech Janiszewski wojciech.janiszewski at gmail.com
Thu Jan 14 06:31:24 EST 2016


Hi Martin,

I believe that jcs:invoke() is just a shortcut for jcs:open(),
jcs:execute() and jcs:close(), so you get a new connection each time you
execute jcs:invoke().

Regards,
Wojciech

2016-01-14 10:23 GMT+01:00 Martin T <m4rtntns at gmail.com>:

> Hi,
>
> while I am aware of jcs:open() function, which allows one to execute
> commands on other routing-engine, I was wondering if following logic
> is also possible in SLAX:
>
> $ cat login_to_other_re.slax
> version 1.0;
>
> ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
> import "../import/junos.xsl";
>
> match / {
>   <op-script-results> {
>
>     /* rlogin to second RE */
>     var $cmd_login_other_re = <command> "request routing-engine login
> other-routing-engine";
>     var $cmd_login_other_re_results = jcs:invoke( $cmd_login_other_re );
>
>     /* print out the name of the second RE */
>     <output> $junos-context//routing-engine-name;
>
>     /* exit rlogin session */
>     var $cmd_quit_other_re = <command> "quit";
>     var $cmd_quit_other_re_results = jcs:invoke( $cmd_quit_other_re );
>
>   }
> }
> $
>
>
> Why doesn't such approach work?
>
>
> thanks,
> Martin
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp
>


More information about the juniper-nsp mailing list