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, create a configuration template request. See Creating Requests for Configuration Templates.
To design a template with your configuration:
The Templatize Config page appears.
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.
The Customize Variables page appears.
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.
The Validate Template page appears.
The Rendered Config page appears and the configuration template is generated using the values that you entered.
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.
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:
|
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.
|
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.