diff options
Diffstat (limited to 'templating/templates/switch.txt')
-rw-r--r-- | templating/templates/switch.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/templating/templates/switch.txt b/templating/templates/switch.txt new file mode 100644 index 0000000..0fd9754 --- /dev/null +++ b/templating/templates/switch.txt @@ -0,0 +1,19 @@ +{# + This can be used through GET /templating/switch.txt?switch=e41-2 + + It is provided as a simple demo of how to combine "GET parameters" with + templating. + + #} +{% set sw = options["switch"] %} +{% set s = objects["public/switches"].switches[sw] %} +{% if s %} +{% set mg = objects["read/switches-management"].switches[sw] %} + +Switch {{ sw }} has management ip {{ mg.mgmt_v4_addr }} + +It is assoicated with distro {{ s.distro_name }} +{% else %} +Switch not found +{% endif %} + |