aboutsummaryrefslogtreecommitdiffstats
path: root/web/templates/test.conf
blob: ce2fe0d6a37a161b917fd2f82617c559626476d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 %}