Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Nesting Parameters

    You can use XPath context to define the default option or selectable options of a parameter. This XPath could have dependencies on other parameters. Consider the example below A configlet requires two inputs, a Physical Interface (Input-1) and a Logical Interface (Input-2) that is a part of the selected Physical Interface(Input-1). We define a parameter PHYINT to get the name of the physical interface and a parameter LOGINT to get the name of the logical interface. We define the SELECTIONVALUESXPATH for PHYINT as "/device/interface-information/physical-interface/name/text()". User selects a value from the options listed by the XPath. Since the selection values listed for LOGINT parameter is dependent on the value selected for PHYINT, we can define the SELECTIONVALUESXPATH of LOGINT as "/device/configuration/interfaces/interface[name='$PHYINT']/unit/name/text()". This ensures that, only the logical interfaces of the selected physical interface are listed.

    A configlet could refer another configlet present in Junos Space Network Management Platform using the following statement:

    #include_configlet("<CONFIGLET-NAME>")

    Junos Space Network Management Platform would merge the referred configlets inline.

    Create a configlet named 'SayHello'

    #set( $person = "Bob" )
    Hello $person
    

    Create another configlet named 'Greeting'

    This is a greeting example
    #include_configlet("SayHello")
    

    When the confilget 'Greeting' gets evaluated, it generates the following string.

    This is a greeting example
    Hello Bob

    Modified: 2015-06-08