Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Workspaces User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Nesting Parameters

Release: Junos Space 22.2
{}
Change Release
date_range 27-Sep-22

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:

content_copy zoom_out_map
#include_configlet("<CONFIGLET-NAME>")

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

Create a configlet named 'SayHello'

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

Create another configlet named 'Greeting'

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

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

content_copy zoom_out_map
This is a greeting example
Hello Bob
footer-navigation