{# 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 %}