Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Creating a Template Definition

You create a template definition to create custom device templates that can be deployed to devices through Junos Space Network Management Platform.

To create a template definition:

  1. On the Junos Space Network Management Platform user interface, select Device Templates > Definitions.

    The Definitions page is displayed.

  2. Click the Create Template Definition icon on the Actions menu.

    The Create Template Definition page is displayed.

  3. From the Device Family Series section, select the device family to which your template definition will apply.

    The Junos OS versions and hardware platforms supported by the selected device family appear in the Description section on the right. The OS version that appears on the drop-down list in the OS Version section below the Device Family Series section is the one that is set as default for that device family.

    Note:

    It is recommended to include the device family and OS version information in the description of the template definition. Unless you include the information in the definition name or description, the operator will not know which device family this definition applies to.

  4. Select the appropriate OS version from the drop-down list in the OS Version section below the Device Family Series section.
    Note:

    If you do not use the latest DMI schema , you will not have access to the most recent device configuration options.

  5. Click Next.
  6. In the Name field, type a user-defined template definition name.

    A template definition name cannot exceed 128 characters and can contain only letters, numbers, spaces, and some special characters. The special characters allowed are hyphen (-), underscore (_), period (.), at (@), single quotation mark (’), forward slash (/), and ampersand (&).

  7. (Optional) In the Description field, type a user-defined description.

    The description cannot exceed 256 characters. The operators who use the template definition to create templates rely on the description for information about the template definition.

  8. From the Available Configuration section on the left, select one of the following from the drop-down list:
    • View All Configuration — Provides all configuration options available for the selected device family’s default DMI schema

    • Common Configuration — Provides the parameters typically configured for the selected device family—for example, for J Series, M Series, MX Series, TSeries, and TX Series devices, the parameters are Interfaces, Routing options, SNMP, and System.

    • MPLS Pre-staging — Provides the parameters necessary to configure MPLS for the selected device family—for example, for J Series, M Series, MX Series, T Series, and TX Series devices, the parameters are Interfaces, Protocols, and Routing options.

  9. Display the hierarchy of Junos OS configuration options available for the device family by clicking the plus sign to the left of the Configuration node at the top of the tree.

    The hierarchy appears in the form of a tree. Each item can be expanded by clicking the plus sign.

  10. (Optional) Click the configuration option that you want to configure for this template definition. To find configuration options, see Finding Configuration Options in a Template Definition.

    The Selected Configuration Layout section on the right of the page displays the configuration pages. A default page, Config Page 1, is available to hold your groups of configuration options. You can create additional pages by clicking the Add Configuration Page icon at the top of the Selected Configuration Layout section.

  11. (Optional) To rename the configuration page and enter a description:
    1. Select the configuration page in the left panel of the Selected Configuration Layout section.

    2. In the Label field, enter a user-defined configuration page name.

    3. In the Description field, enter a user-defined description.

    Note:

    Delete a page by selecting a page from the left panel of the Selected Configuration Layout section and clicking the Delete Selected Page or Option icon.

  12. To choose the configurable options, drill down through the hierarchy in the Available Configuration section. Unless you have opened a directory, selecting it and moving it does not transfer the directory’s contents into your template definition. You can select multiple options simultaneously by holding down the Ctrl key.

    You can move an option from the Available Configurations panel to a page in the Selected Configuration Layout panel in three ways:

    • Drag one or more options from the Available Configuration panel to the Selected Configuration Layout panel, and drop it directly onto the appropriate page in the Selected Configuration Layout panel.

    • First, select the destination page in the Selected Configuration Layout panel, then select the options to be moved.

      Click the orange arrow between the panels.

      The option moves from the Available Configuration panel to the Selected Configuration Layout panel.

    • First, select a page in the Selected Configuration Layout panel, then double-click an option in the Available Configuration panel.

      The option moves to the selected page. Note that the page does not open automatically. The minus sign to the left of an empty page changes to a plus sign if the move was successful.

    Any sequence is permissible, and there is no limit on the number of options a page can hold. You cannot put children of the same parent into different pages. If you drill down and select a parameter deep in the hierarchy, dragging that parameter causes all the other parameters that require configuration to come with it.

    You can create field labels on the General tab to help the operator enter correct field data. The General tab applies to both the configuration pages and the configuration options you select.

  13. To create a field label for configuration options, in the Selected Configuration Layout section, select a configuration option.

    The General tab displays the default text.

  14. (Optional) To rename the selected option, in the Label field, overwrite the default or existing name.
    Tip:

    Because the configuration options lose their context when you move them out of the tree in the Available Configuration section, consider changing the default labels to indicate to operators creating device templates what these parameters are for. The default labels are ambiguous without the context of the tree. For example, there are many options called pool.

    The Data Type box displays the selected option’s data type, which determines not only the tabs displayed, but also the method of validation.

  15. (Optional) If the data type of an option is String, it is possible to provide the template administrator or operator a drop-down list to choose from when creating templates from this definition. To provide a drop-down list of choices, change the data type of the selected option to Enumeration by clicking the Enumeration option button in the Data Type box.

    Either a box containing ready-made choices appears, or a box to contain the choices you create appears, and next to it, a green plus [+] and a red minus [–] icon.

    • To create each drop-down list choice, click the green plus [+] icon

      A text field appears, to the right of which is an OK button, a Close button, and a red X.

    • Enter text in the field (limit 255 alphanumeric characters) and click OK when finished.

      The newly created choice appears in the box to the left of the text field.

      Tip:

      Keep your choices short;, otherwise, they are hard to read when you specify the default values or when the operator tries to select them from the list. You can create up to 23 choices.

    • (Optional) To delete a drop-down list choice, select the choice and click the red minus [–] icon.

      The choice disappears from the box.

    • To finish adding choices, click Close or the red X to the right of the text field.

  16. To save your entries on the General tab, select another tab or another option, or click Next.

    You can add descriptive text in the Description tab. This can help the operator enter the correct data. When the operator creates a device template, he or she can view your description or explanation by clicking the little Information icon to the right of the parameter (in the template). A pop-up box appears, displaying the content you entered in the Description field.

  17. To change the default description, click the Description tab.
  18. In the Description field, enter a user-defined description for the selected configuration option.
  19. To save your the description, move to another tab or another option, or click Next.

    The Validation tab displays the validation criteria for the selected configuration option. Not all options have Validation tabs. The validation criteria are determined by the option’s data type: string, integer/number, table, container, choice, or enumeration. When you define fields in which you intend the operator to enter content, you usually restrict or limit that content in order to prevent validation errors during deployment. For example, if you define a field that you label Hostname, you could use a regular expression to prevent the operator from entering anything other than an IP address. Another situation might be when a particular attribute allows values A, B, C, D, or E, but you want templates that allow only values A or C. To view the data type correlated to validation criteria, see Device Templates Overview

    Note:

    If values are already displayed on the Validation tab, they provide the range that governs the default values you set for the definition. The operator sees only the validation criteria and their values if you supply them when you create an error message. You do not always need to enter any character on the Validation tab. However, in certain cases, input is mandatory—for example, when a hostname is to be validated.

  20. To modify the details on the Validation tab, click the Validation tab.
  21. Enter the parameters for the option in the appropriate fields.

    If the fields already display default values and you change them, ensure that your values do not exceed the default values.

    The Regular Expression Error Message box on the Validation tab appears only if you configure an option of the string data type.

  22. (Optional) For a string, in the Regular Expression field, enter a regular expression to further restrict what the operator can enter.
  23. (Optional) For a string, compose an error message.

    This is not a validation parameter but rather a clue to enable the operator to enter correct field data. The text you enter here is displayed when an operator enters invalid content in a template field. An error message is very helpful for ensuring that operators are successful in creating templates. You cannot enter an error message if you have not entered a regular expression.

  24. To save your entries, select another tab or another option, or click Next.

    The settings on the Advanced tab determine whether:

    • The operator can see the selected option or edit its values.

    • Device-specific values are used for the selected option. The Device Specific check box appears only for options of these data types:

      • Integer

      • String

      • Boolean

      • List

  25. To modify the details on the Advanced tab, select the Advanced tab.
  26. Select Editable, Readonly, or Hidden, depending on whether the operator creating the device template should see this device configuration parameter, or change it.

    If you hide an option, the operator can see neither the settings for the option nor the option itself.

  27. (Optional) To mark this configuration option as device specific, click the Device Specific check box.

    SeeSpecifying Device-Specific Values in Template Definitions for further instructions on using CSV files for this purpose. You can use rules instead of or in addition to CSV files to specify device-specific values. See Working with Rules in a Template Definition for more information about working with rules in a template definition.

  28. To save your entries, select another tab or another option, or click Next.
  29. To specify default values for configuration options, select the configuration option.
  30. (Optional) To add comments for individual parameters, click the little yellow comment icons next to the configuration settings and enter your comments.
  31. (Optional) To activate or deactivate a configuration option, click the Activate or Deactivate link respectively.
    Note:

    You can activate or deactivate a configuration option only if the configuration node exists.

  32. To display the fields for the default values, click View/Configure.

    The layout of the fields on the page varies depending on the data type of the configuration option you selected. For more details, see the Finding Configuration Options in a Template Definition topic.

  33. To add a row to a table, click the plus sign (+).

    The fields for the options displayed in the previous view appear. Whether the operator can edit the option values depends on the settings you made on the Advanced tab: Editable, Readonly, or Hidden.

    To remove a row from a table, select the row and click the minus sign (–). To edit a table row, select the row and click the pencil icon .

    As you drill down, successive breadcrumbs appear, with the names of the options you clicked to configure, enabling you to navigate through multiple configuration option levels. The operator also sees these breadcrumbs and uses them to navigate.

  34. Enter the data as appropriate.
    Tip:

    To review your settings, click Back at the bottom of the page.

    Any field that you have marked as editable can remain empty, but do not leave hidden and read-only fields empty.

    If you enter an invalid value, a red exclamation mark icon appears. Click the icon to find out what the value should be. The same icon is also visible to the operator when creating a template.

    Click the blue Information icon on the far right of each setting to view the explanatory or descriptive text for the operator that you entered on the Description tab.

  35. (Optional) To view what the operator sees, click Operator View.
  36. (Optional) Add settings in the Operator View.

    When you click Designer View, a message appears, asking “Do you want to save this draft before you leave this page?”

  37. (Optional) To save the settings you made in the Operator View, click Yes.
  38. To complete your definition, return to the designer view by clicking Designer View .
  39. Click Finish