Re: [j-nsp] execute a command in SLAX script which does not have XML RPC equivalent available

2016-11-28 Thread Martin T
Phil,

>Looks like a bug to me.
Thank you for confirming this!

>Please have your AM PR it for us.
Done.


regards,
Martin

On Fri, Nov 25, 2016 at 7:55 PM, Phil Shafer  wrote:
> Looks like a bug to me.  Please have your AM PR it for us.
>
> Thanks,
>  Phil
>
>
>
> Martin T writes:
>>Jonathan, Phil,
>>
>>thank you for replies!  RPC does what I desire
>>for example in Junos versions 13.3R4.6 and 13.3R9.13 but not in
>>14.1R7.4. In 14.1 release for example following code:
>>
>>  var $request_system_license_save_cmd =  {
>> "/tmp/key" ;
>>  }
>>  var $request_system_license_save_results = jcs:invoke(
>>$request_system_license_save_cmd );
>>
>>..creates a file /tmp/key with no content:
>>
>>-rw---  1 root  wheel  0 Nov 25 10:18 key
>>
>>
>>On the other hand, "request system license save /tmp/key" CLI command
>>writes the key into the file. According to "Junos OS 14.1 XML API
>>Operational Developer Reference" the "" is
>>supported on MX series. Is this a bug? Or am I doing something wrong?
>>
>>
>>thanks,
>>Martin
>>
>>On Wed, Aug 17, 2016 at 1:19 AM, Phil Shafer  wrote:
>>> Martin T writes:
I have a SLAX script where I execute "request system license save
ftp://root:passwd@10.11.12.5"; command.
>>>
>>> [Background: the UI comes in two pieces.  The CLI process handles
>>> terminal I/O, key-bindings, automore, file transfers, and not much
>>> else.  The real brain resides in MGD, which understands commands,
>>> RPCs, how to parse them and what to do with them.]
>>>
>>> The "request system license save" command uses both halves.  MGD
>>> asks CLI to do the transfer, and then MGD does with real work.
>>>
>>> SLAX scripts use the API directly, so it cannot perform the
>>> file-transfer.
>>>
>>> The fix is to pass a local file name to the "request system license
>>> save" command RPC and then do the transfer explicitly using the
>>>  RPC.
>>>
>>> Thanks,
>>>  Phil
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] execute a command in SLAX script which does not have XML RPC equivalent available

2016-11-25 Thread Phil Shafer
Looks like a bug to me.  Please have your AM PR it for us.

Thanks,
 Phil



Martin T writes:
>Jonathan, Phil,
>
>thank you for replies!  RPC does what I desire
>for example in Junos versions 13.3R4.6 and 13.3R9.13 but not in
>14.1R7.4. In 14.1 release for example following code:
>
>  var $request_system_license_save_cmd =  {
> "/tmp/key" ;
>  }
>  var $request_system_license_save_results = jcs:invoke(
>$request_system_license_save_cmd );
>
>..creates a file /tmp/key with no content:
>
>-rw---  1 root  wheel  0 Nov 25 10:18 key
>
>
>On the other hand, "request system license save /tmp/key" CLI command
>writes the key into the file. According to "Junos OS 14.1 XML API
>Operational Developer Reference" the "" is
>supported on MX series. Is this a bug? Or am I doing something wrong?
>
>
>thanks,
>Martin
>
>On Wed, Aug 17, 2016 at 1:19 AM, Phil Shafer  wrote:
>> Martin T writes:
>>>I have a SLAX script where I execute "request system license save
>>>ftp://root:passwd@10.11.12.5"; command.
>>
>> [Background: the UI comes in two pieces.  The CLI process handles
>> terminal I/O, key-bindings, automore, file transfers, and not much
>> else.  The real brain resides in MGD, which understands commands,
>> RPCs, how to parse them and what to do with them.]
>>
>> The "request system license save" command uses both halves.  MGD
>> asks CLI to do the transfer, and then MGD does with real work.
>>
>> SLAX scripts use the API directly, so it cannot perform the
>> file-transfer.
>>
>> The fix is to pass a local file name to the "request system license
>> save" command RPC and then do the transfer explicitly using the
>>  RPC.
>>
>> Thanks,
>>  Phil
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] execute a command in SLAX script which does not have XML RPC equivalent available

2016-11-25 Thread Martin T
Jonathan, Phil,

thank you for replies!  RPC does what I desire
for example in Junos versions 13.3R4.6 and 13.3R9.13 but not in
14.1R7.4. In 14.1 release for example following code:

  var $request_system_license_save_cmd =  {
 "/tmp/key" ;
  }
  var $request_system_license_save_results = jcs:invoke(
$request_system_license_save_cmd );

..creates a file /tmp/key with no content:

-rw---  1 root  wheel  0 Nov 25 10:18 key


On the other hand, "request system license save /tmp/key" CLI command
writes the key into the file. According to "Junos OS 14.1 XML API
Operational Developer Reference" the "" is
supported on MX series. Is this a bug? Or am I doing something wrong?


thanks,
Martin

On Wed, Aug 17, 2016 at 1:19 AM, Phil Shafer  wrote:
> Martin T writes:
>>I have a SLAX script where I execute "request system license save
>>ftp://root:passwd@10.11.12.5"; command.
>
> [Background: the UI comes in two pieces.  The CLI process handles
> terminal I/O, key-bindings, automore, file transfers, and not much
> else.  The real brain resides in MGD, which understands commands,
> RPCs, how to parse them and what to do with them.]
>
> The "request system license save" command uses both halves.  MGD
> asks CLI to do the transfer, and then MGD does with real work.
>
> SLAX scripts use the API directly, so it cannot perform the
> file-transfer.
>
> The fix is to pass a local file name to the "request system license
> save" command RPC and then do the transfer explicitly using the
>  RPC.
>
> Thanks,
>  Phil
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] execute a command in SLAX script which does not have XML RPC equivalent available

2016-08-16 Thread Phil Shafer
Martin T writes:
>I have a SLAX script where I execute "request system license save
>ftp://root:passwd@10.11.12.5"; command.

[Background: the UI comes in two pieces.  The CLI process handles
terminal I/O, key-bindings, automore, file transfers, and not much
else.  The real brain resides in MGD, which understands commands,
RPCs, how to parse them and what to do with them.]

The "request system license save" command uses both halves.  MGD
asks CLI to do the transfer, and then MGD does with real work.

SLAX scripts use the API directly, so it cannot perform the
file-transfer.

The fix is to pass a local file name to the "request system license
save" command RPC and then do the transfer explicitly using the
 RPC.

Thanks,
 Phil
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] execute a command in SLAX script which does not have XML RPC equivalent available

2016-08-16 Thread Jonathan Looney
On Tue, Aug 16, 2016 at 8:43 AM, Martin T  wrote:

> However, FTP connection is not established. I am aware that this
> command does not have XML RPC equivalent available. However, is there
> some way to still use such commands in SLAX scripts?
>

Even though the CLI doesn't show an equivalent, there may actually be one.
We discuss this in the first chapter of Automating Junos Administration
.

In this case, does the 

RPC do what you desire?

Jonathan
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


[j-nsp] execute a command in SLAX script which does not have XML RPC equivalent available

2016-08-16 Thread Martin T
Hi,

I have a SLAX script where I execute "request system license save
ftp://root:passwd@10.11.12.5"; command. According to
UI_CMDLINE_READ_LINE and UI_JUNOSCRIPT_CMD log messages everything
seems to be fine:

Jan  2 04:39:56   file[5314]: UI_CMDLINE_READ_LINE: User 'root',
command 'rpc command request system license save
"ftp://root:passwd@10.11.12.5"; '
Jan  2 04:39:56   file[5314]: UI_JUNOSCRIPT_CMD: User 'root' used
JUNOScript client to run command 'request system license save
filename=ftp://root:passwd@10.11.12.5'

However, FTP connection is not established. I am aware that this
command does not have XML RPC equivalent available. However, is there
some way to still use such commands in SLAX scripts?


thanks,
Martin
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp