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
external-header-nav
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Request a Configuration Hierarchy Level or Container Object Without an Identifier Using the Junos XML Protocol

date_range 14-Jul-21

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.

content_copy zoom_out_map
<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.

content_copy zoom_out_map
<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.

external-footer-nav