Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

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.

Note

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.

Note
  • 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:

  1. Select Resources > Templates > Configuration Templates.

    The Configuration Templates page appears.

  2. Click the + (add) icon.

    The Add Configuration Template page (wizard) appears.

    Note

    Fields marked with an asterisk (*) are mandatory.

  3. 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.

  4. 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.

  5. You can modify the parameters for one or more rows as follows:
    1. Click inside a row to modify the values for the fields in that row according to the guidelines provided in Table 3.
    2. 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.

  6. Perform one or more actions on this tab, as explained in Table 4.
  7. 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:

  • CLI (default)

  • XML

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:

  1. In the inline editor, copy and paste the device configuration ensuring that the syntax follows the Jinja Template language.

    CSO detects the template variables corresponding to the configuration that you entered and displays them in the Detected Template Variables pane.

  2. Check that the template variables detected match the configuration that you added to the template:
    • (Optional) If the template variables do not match, check the Jinja syntax that you used for the template configuration and make any changes needed in the inline editor as indicated in the first step.

 

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.

  • String (default)—If the variable is a string of characters.

  • Boolean—If the variable is a boolean value (true or false).

  • Number—If the variable is a number.

  • Enumeration—If the variable is an enumerated values with all strings or all numbers.

    In the Add enumeration for variable-name that appears, enter the list of enumerated values for the variable, separating each one by entering a space or pressing Enter. Click OK to save the values that you entered and go back to the Customize Variables tab.

    The values you entered are displayed in the Enumerated Values field.

  • IPv4—If the variable is an IPv4 address.

  • IP Prefix—If the variable is an IPv4 prefix.

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:

  • If the data type of the variable is string, specify the regular expression (regex pattern) ; for example, ^[a-z][A-Z].

  • If the data type is number, specify the range in the format Starting Number...Ending Number. For example, 1...100.

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:

  • Device, which means that the parameter is specific to each device. This is the default.

  • Global—The parameter is common across devices.

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

  1. Hover over a field and click the settings (gear) icon to modify the settings for a field.

    The Input setting for field-name page appears.

  2. Modify the following fields, as needed; fields marked with an asterisk (*) are mandatory.
    • Label—Enter the label that you want displayed in the UI.

    • Input type—Select whether you want the field to be a text box (Input text), list (input dropdown), or text area (input textarea). If you select input dropdown, the Resources and Multiple Selection fields appear.

    • Place holder—Enter the text that you want displayed in the field that provides guidance to the user (also known as ghost text).

    • Hidden—Click the toggle button to hide the field in the UI; by default, a field is displayed.

    • Resource—For a list (dropdown), if the SP Administrator created resources for the configuration template, then you can select a resource or choose not to use resources (No Resource, which is the default). If there are no resources for the configuration template, then No Resource is displayed and can’t be modified.

    • Multiple Selection—For a list (dropdown), click the toggle button to enable the selection of more than one items or not (default).

    • Event listener—If you want a field to be conditionally displayed based on an event, select Data change; if not, select No listener (default).

      If you select Data change, the following fields appear:

      • Event behavior—Displays the event behavior (function) based on which the field is conditionally displayed.

      • Change path—Click the Select path link to select the variable (that you want to conditionally display) from the viewdef tree in the popup page, and click OK. The selected path is displayed.

      • Event function—Enter a JavaScript function that will be used to determine whether the variable selected in the Change path field is displayed in the UI or not.

  3. Click OK to save your changes.

    You are returned to the Generated UI tab and the modifications that you made are displayed on the UI.

Modify the settings for a section

  1. Hover over a section and click the settings icon (gear).

    The Section setting for section-name page appears.

  2. Modify the following fields, as needed; fields marked with an asterisk (*) are mandatory.
    • Label—Enter the label that you want displayed in the UI.

    • Collapsed—Click the toggle button to expand (default) or collapse the section in the UI.

  3. Click OK to save your changes.

    You are returned to the Generated UI tab and the modifications that you made are displayed on the UI.

Modify the settings for a grid

  1. Hover over the grid area and click the settings (gear) icon to modify the settings for a field.

    The Grid setting for Grid-name page appears.

  2. Modify the following fields, as needed; fields marked with an asterisk (*) are mandatory.
    • Title—Enter the title that you want displayed in the UI.

    • Height—Enter the height (in pixels) of the grid or click the up or down arrows to specify a height.

    • Columns—You can modify the following for each field:

      • Header—Click inside the cell, modify as needed, and click (check mark) to save your changes

      • Values—Click inside the cell that you want to modify.

        The Settings for column column-name page appears.

        1. Resource—For a list (dropdown), if the SP Administrator created resources for the configuration template, then you can select a resource or choose not to use resources (No Resource, which is the default). If there are no resources for the configuration template, then No Resource is displayed and can’t be modified.
        2. If you chose No Resource, enter one or more values (in JavaScript Object Notation [JSON] format) in the Values field.
        3. Click OK.

          You are returned to the Grid setting for Grid-name page

        4. Click OK to save your changes.

          You are returned to the Generated UI tab and the modifications that you made are displayed on the UI.

  3. Click OK to save your changes.

    You are returned to the Generated UI tab and the modifications that you made are displayed on the UI.

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:

  • Add a resource:

    1. Click the add (+) icon.

      The Resources Information page appears.

    2. Configure the fields according to the guidelines provided in Table 5.
    3. Click OK.

      You are returned to the Resources Management page where the resource that you added is displayed.

  • Edit a resource:

    1. Select a resource and click the edit (pencil) icon.

      The Resources Information page appears.

    2. Modify the fields according to the guidelines provided in Table 5.

      Note: You can modify all fields except the name.

    3. Click OK.

      The modifications are saved and you are returned to the Resources Management page.

  • Delete a resource:

    1. Select a resource and click the X (delete) icon.

      You are asked to confirm the delete operation.

    2. Click Yes.

      The selected resource is deleted.

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:

  1. Click Validation.

    The Validate Template page appears.

  2. Enter values for the different parameters in the configuration template.
  3. Click Render.

    The Rendered Config page appears, where CSO displays the configuration that was rendered based on the values that you entered.

  4. Check if the configuration was rendered correctly. If the configuration was not rendered correctly, you can go back and make modifications as needed.
  5. Click OK.

    You are returned to the Validate Template page.

  6. Click Cancel to exit the template validation workflow.

    You are returned to the Generated UI page.

 

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:

  • Remote, which uses a REST API to retrieve data.

  • Mapping, which maps the values in the dropdown (list) with the resource data.

  • Function, which returns data using the function specified.

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:

  • Function—Use this option if you want to use a function to process the output.

  • Mapping—Use this option if you want to map the output using a base path, ID source, and text source.

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.