[j-nsp] junoscripts output format question
Pavel Gulchouck
gul at gul.kiev.ua
Wed Oct 21 12:08:00 EDT 2009
Hi.
I have a problem with output xml from op script.
If I output configuration from op script as xml, I see it if use
"| display xml" but see nothing if no pipe.
Where am I wrong?
"op show-dyn-config | display xml" looks like
"show configuration | display xml", I cannot find any diferences
in tags, but "op show-dyn-config" without pipe displays nothing.
Here's my script:
=====
version 1.0;
ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
import "../import/junos.xsl";
match / {
<op-script-results> {
var $connection = jcs:open();
var $conf-req = <rpc> {
<open-configuration> {
<dynamic>;
}
}
expr jcs:execute($connection, $conf-req);
var $configuration = jcs:execute($connection, "get-configuration");
expr jcs:execute($connection, "close-configuration");
expr jcs:close($connection);
copy-of $configuration;
}
}
=====
Thanks.
--
Pavel
More information about the juniper-nsp
mailing list