DESIGNER TOOLS
Help Center User GuideGetting StartedFAQ
 
X
User Guide
Getting Started
FAQ
Contents  

Designing Templates with a Configuration

You can design a configuration template either by using your own data model or by using the data model generated by the Configuration Designer. The Configuration Designer provides a configuration template wizard that takes you through a step-by-step procedure to create your configuration template. You can design multiple templates by creating requests and launching respective wizards from them.

To design a template using the data model generated by the Configuration Designer, you provide your Jinja configuration and the wizard automatically parses its parameters and generates the data model for your template. See http://jinja.pocoo.org/docs/2.10/templates/ for documenting the configuration templates of the jinja2 Python module.

Before You Begin

Before you begin, create a configuration template request. See Creating Requests for Configuration Templates.

Procedure

To design a template with your configuration:

  1. From the Configuration Template Request drop-down list, select Begin with config.

    The Templatize Config page appears.

  2. Enter or copy and paste your Jinja configuration in the space provided for it.

    The wizard parses the parameters in your configuration and generates a variables tree in the Detected Variables panel.

    Note You can also download a sample template from this page.

    Note  When you paste the Jinja template, the Configuration Designer detects the keywords post_config, pre_config, and diff_config, automatically. If the configuration template contains any one of these three keywords, the template will enable the Diff Config feature.

  3. Review your configuration and edit it as needed. The wizard accordingly updates the variables in the Detected Variables panel. Click Next.

    The Customize Variables page appears.

  4. Select any variable to update. You can update different attributes of your template, such as the Yang and data types. You can also add default values and descriptions. See Table 6 for sample fields and their descriptions.
  5. After completing your configuration, click Next.

    The Generate UI page appears and generates the data model according to your values and displays as read-only. You can drag and drop the field labels to reorder the UI.

    Note If you edit an existing template and change its data model, then you can generate a new UI for it by clicking Re-generate ui. If you do not want a new UI, skip to the next step.

  6. Click Next.

    The Validate Template page appears.

  7. Enter values that you want to validate, and ensure that the configuration template is displayed with the correct values.
  8. Click Validate.

    The Rendered Config page appears and the configuration template is generated using the values that you entered.

  9. Make sure your data in the configuration template is complete and correct.
  10. Click Yes, it looks good to close the page. If any parameter value in the configuration template needs to be changed, click No, it needs change to return to the previous page.
  11. Click Next.

    The Review Template page is displayed. It contains three tabs—Jinja Template, Data Model, and View Def. You can click through the tabs to view and update your Jinja template, data model, and the view definition.

  12. Click Done to save your configuration template.

The Designs page is updated with the new configuration template and its status shows as Validated. You can monitor and manage the new configuration template from the Configuration Design page.

Note You must publish the configuration template for it to be available for the Resource Designer to create virtualized network function (VNF) packages. See Publishing Configuration Templates.

Table 6: Sample Fields on the Customize Variables Page

Field

Description

Detected Variables

Edit the variable name. A configuration template contains variables that get replaced with values when a template is rendered. The Configuration Designer automatically generates these variables from your Jinja configuration.

You can edit the variable name.

Example: left_interface

Yang Type

Select an appropriate Yang type from the drop-down list. A Yang module defines a data model through its data, and through the hierarchical organization and constraints on that data. It uses a hierarchical, tree-based structure with the following nodes:

  • leaf node—Contains a single value of a specific type

  • leaf-list node—Contains a sequence of leaf nodes

  • container node—Contains a grouping of related nodes containing only child nodes, which can be any of the six node types

  • list node—Contains a sequence of list entries, each of which is uniquely identified by one or more key leafs

  • choice node—Contains a set of alternatives, only one of which may exist at any one time

  • case node—Contains branches of the choice node

Data Type

Select an appropriate data type based on your variable. In Yang, each leaf and leaf-list node includes the type statement to identify the data type for valid data for that node. Yang defines a set of built-in types and also provides the typedef statement for defining a derived type from a base type, which can be either a built-in type or another derived type.

  • String—Human-readable string

  • Boolean—True or false

  • Init8— 8-bit signed integer

  • Init16—16-bit signed integer

  • Init32—32-bit signed integer

  • Init64—64-bit signed integer

  • Uint8—8-bit unsigned integer

  • Uint16—16-bit unsigned integer

  • Uint32—32-bit unsigned integer

  • Uint64—64-bit unsigned integer

  • Enumeration—Enumerated strings with associated numeric values

  • Inet: ip-address—192.0.2.101

  • Inet: ip-prefix—192.0.2.0/24

  • Empty—A leaf that does not have any value

Display Name

Specify the name of the variable as you want it to display.

Key

Specify the key to be associated with the variable.

Keys are identifiers used in defining list entries in the Yang data hierarchy. They help distinguish one list entry from another.

Required

Specify if the variable is mandatory.

Default Value

Specify the default value for the variable.

Pattern

Specify the regular expression (regex pattern) if the data type of the variable is string.

Example: ^[a-z][A-Z]

Information

This field displays values only if the data type of the variable is enumeration. When you select the data type as enumeration, you need to specify the values for the enumeration list and these values are displayed in the Information column. You can also edit the enumeration list.

Example: [“abc”,”def”]

Description

Enter a meaningful description for the variable.

Example: Firewall policy information

To create an actual configuration for a device, you must log in to Administration Portal or Customer Portal. You must enter the actual values for the configuration in the configuration template. The configuration template then renders the actual values. You can click on stage2 configuration to view the actual configuration.

To delete an actual configuration for a device, you must login to Administration Portal or Customer Portal and execute the delete command, remove command or an alternate command for the configuration. The command to delete a configuration depends on the existing configuration on the device.

Related Documentation

Ask questions in TechWiki

Check documentation in TechLibrary

Rating by you:      
X

Additional Comments

800 characters remaining

May we contact you if necessary?

Name:
Email:

Need product assistance? Contact Juniper Support

Submit