I have a Jinja template that I am currently attempting to apply via API. The workflow I have verifies via command-runner the output of a few commands associated with dhcp snooping to ensure the system will not break if the template below is applied. When stripping out the API for template provisioning, I receive an error indicating that portMode is undefined leading me to believe the API call does not have access to the system variable. Do I need to structure the API call a specific way to include system variables such as __interface?
Thank you in advance for your assistance!
Edit: The template below returns the expected output when ran in simulation. Also- this is Catalyst Center 2.3.7.9
{% set user_vlans = [15,16,17,28,38] %}
{% for iface in __interface %}
{% if iface.portMode == 'access' and iface.vlanId in user_vlans %}
interface {{ iface.portName }}
ip verify source
{% endif %}
{% endfor %}
Edit 2: Depending on the responses, my alternate workflow may be to analyze the system for template pre-deployment criteria and then use the "add members to tag" API to provision via Catalyst Center directly. This is not the ideal approach but if direct access to catalyst center system variables is not possible, I don't see many alternatives.