Request a Configuration Hierarchy Level or Container Object Without an Identifier Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to request complete information about all child configuration
elements at a hierarchy level or in a container object that does not
have an identifier, a client application emits a <get-configuration>
tag element that encloses the tag elements representing all levels
in the configuration hierarchy from the root (represented by the <configuration>
tag element) down to the the immediate
parent level of the level or container object, which is represented
by an empty tag. The entire request is enclosed in an <rpc>
tag element.
<rpc> <get-configuration> <configuration> <!-- opening tags for each parent of the level --> <requested-level/> <!-- closing tags for each parent of the level --> </configuration> </get-configuration> </rpc>
When the application requests Junos XML-tagged output
(the default), the Junos XML protocol server returns the requested
section of the configuration in <configuration>
and <rpc-reply>
tag elements. For
information about the attributes in the opening <configuration>
tag, see Specifying the Source for Configuration
Information Requests in a Junos XML Protocol Session.
<rpc-reply xmlns:junos="URL"> <configuration attributes> <!-- opening tags for each parent of the level --> <hierarchy-level> <!-- child tag elements of the level --> </hierarchy-level> <!-- closing tags for each parent of the level --> </configuration> </rpc-reply>
To specify the source of the output (candidate or active configuration)
and request special formatting of the output (for example, formatted
ASCII or JSON or an indicator for identifiers), the application can
include attributes in the opening <get-configuration>
tag, its opening <junoscript>
tag,
or both. For more information, see Specifying
the Source for Configuration Information Requests in a Junos XML Protocol
Session and Specifying the
Output Format for Configuration Data in a Junos XML Protocol Session.
The application can also request additional configuration elements
of the same or other types by including the appropriate tag elements
in the same <get-configuration>
tag
element. For more information, see Requesting
Multiple Configuration Elements Using the Junos XML Protocol.
The following example shows how to request the contents of the [edit system login]
hierarchy level in the candidate
configuration. The output is tagged with Junos XML tag elements, which
is the default.