Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Resources in Jinja

SUMMARY This topic provides information about how Jinja uses and interacts with Apstra Freeform resources. Use Jinja with Freeform to create, edit, and update custom Config Templates in real time.

Examine Resources in Jinja

The Config Template editor features a three-pane interface for interacting with generated resources. Apstra Freeform utitlizes the Jinja code to find and include designated resources from the resource tree.

Use a Resource in Jinja

After you create Resources in the Blueprint, these resources can be accessed via the Device Context.

The following example shows how to use Jinja to include a function to get the resource value for a resource called 'ipv4_loopback' inside the resource group structure called 'underlay':

Use the Built-In Function for Resources

Apstra includes useful built-in functions that we recommend you use in Jinja creation. These functions are documented inside the user interface. To access the function documentation, use the built-in editor in Jinja to access the documentation page via the UI. The link to the documentation is the Apstra server UI: https://<apstra_ip>/static/jinja_docs/ for reference.

Use the Built-In Function for Resources

Create a Resource Generator

Follow these high-level steps to create and use a Resource Generator:

  1. Crete a Resourde Pool

  2. Create an Allocation Group

  3. Create a Resource Group under the default "root" Group

  4. Create a Resource Generator

  5. Use Resource in Jinja