-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsnapshot.slax
More file actions
38 lines (31 loc) · 944 Bytes
/
snapshot.slax
File metadata and controls
38 lines (31 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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";
ns date = "http://exslt.org/dates-and-times";
import "../import/junos.xsl";
match / {
<op-script-output> {
var $get-vpls = <get-configuration database="committed" inherit="inherit"> {
<configuration> {
<routing-instances>;
}
}
var $config = jcs:invoke($get-vpls);
for-each( $config/routing-instances/instance ) {
if (instance-type == "vpls") {
expr jcs:output(name);
expr jcs:output (instance-type);
var $rpc = <get-vpls-mac-table> {
<instance> name;
<extensive>;
}
var $out = jcs:invoke($rpc);
var $filename = "/var/tmp/mac/" _ name _ ".xml";
< xsl:document href=$filename indent="yes"> {
copy-of $out;
}
}
}
}
}