Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Working with Rules in a Template Definition

Device Templates uses rules to supplement the device-specific value capability supplied by CSV files. Specify rules to resolve device specific values at the time of deployment. You can use rules in addition to CSV files, or instead of CSV files. The system resolves device specific values by first checking the CSV file and then the rules. If both the CSV file and the rules return a value, the CSV file takes precedence. If neither the CSV file nor the rules return a value, deployment validation will fail. If a rule cannot provide the requisite value, the operator will be prompted to enter it at deployment.

The system resolves device specific values by first checking the CSV file and then the rules. If both the CSV file and the rules return a value, the CSV file takes precedence. If neither the CSV file nor the rules return a value, deployment validation will fail. If a rule cannot provide the requisite value, the operator will be prompted to enter it at deployment.

Rules are applied in the order shown. You can change the order as necessary. You can create rules for devices whose names start with a specific word, or rules for devices with a specific tag.

You can add, edit, move, and delete rules. You can only select one rule at a time.

To add a rule:

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

    The Create Template Definition page is displayed.

  3. Add the configuration option for which you want to supply device-specific values using a CSV file that you have already created.
  4. Click the Advanced tab.
  5. Select the Device Specific check box.
  6. Click Next.
  7. Click Please select a CSV file.

    The Manage CSV files pop-up window is displayed.

    Use the Manage CSV files workflow to either select a file already in the system, or to navigate and upload CSV files from the local file system. You can view the content of a CSV file already in the system by selecting it in the left pane. Its content displays in the right pane.

  8. To use a CSV file already in the system, select it and click OK.
  9. Specify the column and the key column in the CSV file.
  10. Select the Resolve the value from a CSV file at deploy time check box.

    You can now add rules.

  11. Click the [+] icon.

    Two options appear:

    • Rule matching tagged device

    • Rule matching device name.

  12. Select the appropriate option.

    A rule appears, depending on your selection in the previous step, either of the following:

    • Set to a specific value for devices tagged with a specific tag

    • Set to a specific value for devices with name starting with a specific word.

    In both cases, the phrase “a specific value” is a link, as are “a specific tag” and “a specific word.”

  13. Click either a specific tag or a specific value.

    The Set $dsv field appears.

  14. Enter the appropriate value.

    If the value you enter is not valid, an error message appears in the form of a tool tip explaining why the entry is invalid.

  15. To save your input, click the OK button. To clear your input, click the [X] button.

    The rule reappears, this time with your input replacing the link.

  16. (Optional) To change the sequence of in which the rules will be applied, select a rule and click either the up arrow icon or the down arrow icon.

    The selected rule moves to the new position.

  17. (Optional) To delete a rule, select the rule and click the [X] button.

    The selected rule disappears.

  18. (Optional) To clone a rule, select the rule and click the last icon on the right, next to the down arrow.

    A clone of the selected rule appears.

  19. (Optional) Refresh the rules display by clicking the Refresh icon in the lower bar of the Rules section of the Device Specific Value dialog.

  20. When you have finished working with rules, close the Device Specific Value dialog box by clicking Close.