Junos 10.3 Junos XML Management Protocol Guide
Requesting Configuration Information
64
NOTE: The content and formatting of data within an
to change, so client applications must not depend on them. Future versions of the Junos
XML API will define specific response tag elements (instead of
for more commands. Client applications that rely on the content of
elements will not be able to interpret the output from future versions of the Junos XML
API.
To request information about a configuration on a routing, switching, or security platform,
a client application encloses the
By setting optional attributes, the client application can specify the source and formatting
of the configuration information returned by the Junos XML protocol server. By including
the appropriate optional child tag elements, the application can request the entire
configuration or specific portions of the configuration. The basic syntax is as follows:
<rpc>
<!-- If requesting the complete configuration -->
<get-configuration [optional attributes]/>
<!-- If requesting part of the configuration -->
<get-configuration [optional attributes]>
<configuration>
<!-- tag elements representing the data to return -->
</configuration>
</get-configuration>
</rpc>
NOTE: If the client application locks the candidate configuration before making requests,
it needs to unlock it after making its read requests. Other users and applications cannot
change the configuration while it remains locked. For more information, see "Exchanging
Information with the Junos XML Protocol Server" on page 45.
The Junos XML protocol server encloses its reply in an
attributes with the
junos:
prefix in the opening
configuration was last changed or committed and who committed it (the attributes
appear on multiple lines in the syntax statement only for legibility). For more information
about them, see "Requesting Information from the Committed or Candidate Configuration"
on page 65:
<rpc-reply xmlns:junos="URL">
<!-- If the application requests Junos XML tag elements -->
<configuration junos:(changed | commit)-seconds="seconds" \
junos:(changed | commit)-localtime="YYYY-MM-DD hh:mm:ss TZ" \
[junos:commit-user="username"]>
<!-- Junos XML tag elements representing configuration elements -->
</configuration>
<!-- If the application requests formatted ASCII text -->
<configuration-text>
<!-- formatted ASCII configuration statements -->
<output>
tag element in an
<get-configuration>
<rpc-reply>
<configuration>
Copyright © 2010, Juniper Networks, Inc.
tag element are subject
tag elements)
<output>
<output>
tag
tag element.
<rpc>
tag element. It includes
tag to indicate when the