To request that the JUNOScript server indicate whether a child configuration element is an identifier for its parent element, a client application includes the junos:key="key" attribute in the opening <junoscript> tag for the JUNOScript session, which appears here on two lines for legibility only:
<junoscript version="version" hostname="hostname" junos:key="key"
release="release-code">
For more information about the <junoscript> tag, see Emitting the Opening <junoscript> Tag.
When the identifier indicator is requested, the JUNOScript server includes the junos:key="key" attribute in the opening tag for each identifier. As always, the JUNOScript server encloses its response in <rpc-reply> and <configuration> tag elements. For information about the attributes in the opening <configuration> tag, see Requesting Information from the Committed or Candidate Configuration. In the following, the identifier tag element is called <name>:
<rpc-reply xmlns:junos="URL">
<configuration attributes>
<!- - opening tag for each parent of the object - ->
<!- - For each configuration object with an identifier - ->
<object>
<name junos:key="key">identifier</name>
<!- - additional children of object - ->
</object>
<!- - closing tag for each parent of the object - ->
</configuration>
</rpc-reply>
The client application can include one or more of the following other attributes in the <get-configuration/> tag or opening <get-configuration> tag when the junos:key attribute is included in the opening <junoscript> tag:
When requesting an indicator for identifiers, it does not make sense to include the format="text" attribute in the <get-configuration> tag element (as described in Requesting Output as Formatted ASCII Text or JUNOS XML Tag Elements). The junos:key="key" attribute appears only in JUNOS XML-tagged output, which is the default output format.
The following example shows how indicators for identifiers appear on configuration elements at the [edit interfaces] hierarchy level in the candidate configuration when the junos:key="key" attribute is included in the opening <junoscript> tag emitted by the client application for the session. The two opening <junoscript> tags appear on multiple lines for legibility only. Neither client applications nor the JUNOScript server insert newline characters within tags. Also, for brevity the output includes just one interface, the loopback interface lo0.
