Add Configuration Templates
In Administration Portal, users with the SP (Service Provider) Administrator role (on-premises installation only) or OpCo (Operating Company) Administrator role can add a configuration template by providing the device configuration using the Jinja template language syntax.
In CSO releases before Release 5.1.0, configuration templates are called stage-2 configuration templates.
If a user with the SP Administrator role adds a template, the template is available to the OpCos, OpCo’s tenants, and the SP Administrator’s tenants.
If a user with the OpCo Administrator role adds a template, the template is available only to the OpCos and the OpCo’s tenants.
Before you add the configuration template, ensure that you have the device configuration ready.
We recommend that you use a working configuration on the device to add the configuration template.
To add a configuration template:
- Select Resources > Templates > Configuration Templates.
The Configuration Templates page appears.
- Click the + (add) icon.
The Add Configuration Template page (wizard) appears.
Note Fields marked with an asterisk (*) are mandatory.
- Configure the fields on the Basic Information tab according
to the guidelines provided in Table 1.
Click Next to go to the Templatize Config tab.
- Add the configuration on the Templatize Config tab. Refer
to Table 2 for
an explanation of the actions on this tab
Click Next to go to the Customize Variables tab, where the template parameters that you configured are displayed in a grid.
- You can modify the parameters for one or more rows as
follows:
- Click inside a row to modify the values for the fields in that row according to the guidelines provided in Table 3.
- Click √ (check mark) to save your changes or X to discard the changes.
After you are finished, click Next to go to the Generated UI tab, where the UI for the variables that you entered is generated and displayed after a few seconds.
- Perform one or more actions on this tab, as explained in Table 4.
- Click OK.
The configuration template is added and you are returned to the Configuration Templates page, where a confirmation message is displayed. You can assign the configuration template to device templates or deploy the template on devices.
Table 1: Basic Information Settings (Add Configuration Template Page)
Setting | Guideline |
---|---|
Template Name | Enter a unique name that can only contain alphanumeric characters and hyphens; 15-character maximum. |
Description | Enter a description for the configuration template. |
Output Config Format | Select the output configuration format for the template:
|
Device Family | Select the device family for which you are adding the template; for example, juniper-nfx. |
Click Next to continue. |
Table 2: Templatize Config Actions (Add Configuration Template Page)
Action | Description |
---|---|
View the sample configuration and detected template variables | The Templatize Config tab displays a sample Jinja configuration template in an inline editor on the left and the corresponding template variables in the Detected Template Variables pane on the right. |
Download a sample configuration | You can download a sample configuration by clicking the here link near the top of the tab. |
Add the device configuration | To add the device configuration:
|
If the template variables detected match the configuration that you added to the template, click Next to continue. CSO validates the Jinja template and displays an error message if there are any errors. |
Table 3: Customize Variables Settings (Add Configuration Templates Page)
Setting | Guideline |
---|---|
Detected Variables | Displays the name of the detected variable. You cannot edit the name. |
Data Type | Select the data type for the variable: Note: You cannot specify a data type for a top-level variable that has one or more leaf nodes under it.
|
Key | Select this check box if the variable is to be used as a key. Keys are unique identifiers used in defining list entries in the Yang data hierarchy. They help distinguish one list entry from another. Note: For lists, you must define a key. |
Required | Select this check box if you want the parameter to be mandatory. |
Default Value | Enter a default value for the variable. |
Pattern | For data types string or number, specify one of the following:
|
Enumerated Values | If you entered enumerated values, the values are displayed here. Click inside the field to edit the enumerated values (in the Edit enumeration for variable-name page that appears). |
Scope | Note: This field can be configured only for the root-level (top-level) node. Select the scope of the parameter:
|
Description | Enter a meaningful description for the variable; for example, Gateway IP address. |
After you finish customizing the parameters, click Next. |
Table 4: Generated UI Actions (Add Configuration Template Page)
Action | Description |
---|---|
Reorder the UI | Drag and drop individual fields, grids, or sections to change the order in which the variables appear in the UI. |
Modify the settings for a field |
|
Modify the settings for a section |
|
Modify the settings for a grid |
|
Manage resources | Note: The Add/Edit Resources button is displayed only for users with the SP Administrator role. Click Add/Edit Resources to view the existing resources, and add, edit, and delete resources. The Resources management page appears displaying the existing resources. Resources are used to provide data to configuration templates You can do the following:
|
Reset the generated UI | Click Undo all edits to discard the changes that you made and undo the changes made in the UI. |
Validate and render the configuration | Validating the template and rendering the configuration enables you to check the configuration template that you added. To validate and render a configuration template:
|
After you are finished checking the configuration, click Next to continue. |
Table 5: Fields on the Resources Information Page
Setting | Guideline |
---|---|
Name | Enter a name for the resource. |
Resource Type | Select the type of resource:
|
Method | For resource type Remote, select the type of HTTPS method (GET or POST) to be used for the remote resource. |
URL | For resource type Remote, enter the URL of the API to be used for the GET or POST request. |
Use SP Token | For resource type Remote, click the toggle button to use the Service Provider (SP) token to obtain the data. This field is disabled by default. |
Body | For resource type Remote, enter the format of the payload (in JavaScript Object Notation [JSON]) of the API method, which is sent to the server. For example: { ”interface”:[ {”uuid”, “ab123”, “name”, “ge-0/0/1”}, {”uuid”, “ab456”, “name”, “ge-0/0/2”} ] } |
Mock Data | For resource type Remote, specify mock data (in JSON format) if the API request is unable to retrieve data. |
Output Type | For resource type Remote, select the type of processing to be done on the output of the remote request:
|
Output Function | For resource type Remote and output type Function or resource type Function, enter the function (in JavaScript) to process the output. |
Base Path | For resource type Remote and output type Mapping or resource type Mapping, enter the base path of the variable in the output from which you want to extract the data; for example, interface. |
Output ID Source | For resource type Remote and output type Mapping, enter the ID attribute of the output data. |
Output Text Source | For resource type Remote and output type Mapping, enter the text attribute of the output data. |
Base Path | For resource type Mapping, enter the base path of the variable in the output from which you want to extract the data; for example, interface. |
Input Resource | For resource type Mapping, select the input for the new resource. |
Placeholder | For resource type Mapping, enter the text, which provides guidance to the user, that you want displayed (as ghost text) in the field on the UI. |
Filter | For resource type Mapping, enter the function (in JavaScript) used to filter the data. |
ID Source | For resource type Mapping, enter the ID attribute for the source data. |
Text Source | For resource type Mapping, enter the text attribute for the source data. |
Function | For resource type Function, enter the function (in JavaScript) used to populate the data. |