diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/templates/test.conf | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/web/templates/test.conf b/web/templates/test.conf new file mode 100644 index 0000000..ce2fe0d --- /dev/null +++ b/web/templates/test.conf @@ -0,0 +1,17 @@ +{# Fetches something simple from gondul #} +{# Query parameters: ?switch=e1-1 #} + +{# Check if ?switch option is given#} +{% if not options["switch"] %} + {# pretty print public/switches endpoint#} + {{ objects["public/switches"] | pprint }} +{% else %} + {# sets sw variable using the query parameter #} + {% set sw = options["switch"] %} +{% endif %} +{% if sw %} + {# find the correct switch from public/switches api endpoint using query paramter#} + {% set switch = objects["public/switches"].switches[sw] %} + {# pretty print info in api #} + {{ switch | tojson }} +{% endif %} |