[Contents] [Prev] [Next] [Index] [Report an Error]

Requesting Configuration Information

To request information about a configuration on a routing platform, a client application encloses the <get-configuration> tag element in an <rpc> tag element. By setting optional attributes, the client application can specify the source and formatting of the configuration information returned by the JUNOScript server. By including the appropriate optional child tag elements, the application can request the entire configuration or portions of it. 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 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 JUNOScript Server.

The JUNOScript server encloses its reply in an <rpc-reply> tag element. It includes attributes with the junos: prefix in the opening <configuration> tag to indicate when the 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:

<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 - ->
</configuration-text>
</rpc-reply>

If a JUNOS XML tag element is returned within an <undocumented> tag element, the corresponding configuration element is not documented in the JUNOS software configuration guides or officially supported by Juniper Networks. Most often, the enclosed element is used for debugging only by Juniper Networks personnel. In a smaller number of cases, the element is no longer supported or has been moved to another area of the configuration hierarchy, but appears in the current location for backward compatibility.

For reference pages for the <configuration>, <configuration-text>, and <undocumented> tag elements, see the JUNOS XML API Operational Reference.

Applications can also request other configuration-related information, including an XML schema representation of the configuration hierarchy or information about previously committed configurations. For more information, see the following sections:

The following sections describe how a client application specifies the source, format, and amount of information returned by the JUNOScript server:


[Contents] [Prev] [Next] [Index] [Report an Error]