Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Requesting Configuration Information Using NETCONF

In a NETCONF session with a device running Junos OS, to request information about a configuration on a routing, switching, or security platform, a client application encloses the <get-config>, <source>, and <filter> tag elements in an <rpc> tag element. By including the appropriate child tag element in the <source> tag element, the client application requests information from either the candidate or active configuration. By including the appropriate child tag elements in the <filter> tag element, the application can request the entire configuration or specific portions of the configuration:

<rpc><get-config><source><!-- tag specifying the source configuration --><( candidate | running )/></source><filter type="subtree"> <!-- tag elements representing the configuration elements to return --> </filter></get-config></rpc>
]]>]]>

The type="subtree" attribute in the opening <filter> tag indicates that the client application is using Junos XML tag elements to represent the configuration elements about which it is requesting information. .

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 Locking and Unlocking the Candidate Configuration Using NETCONF.

The NETCONF server encloses its reply in <configuration>, <data>, and <rpc-reply> tag elements. It includes attributes in the opening <configuration> tag that indicate the XML namespace for the enclosed tag elements and when the configuration was last changed or committed. For information about the attributes of the <configuration> tag, see Requesting Committed or Candidate Configuration Information Using NETCONF.

<rpc-reply xmlns="URN" xmlns:junos="URL"> <data> <configuration attributes><!-- JUNOS XML tag elements representing configuration elements --> </configuration></data></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 OS configuration guides or officially supported by Juniper Networks. Most often, the enclosed element is used for debugging only by support 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.

Client applications can also request other configuration-related information, including an XML schema representation of the configuration hierarchy or information about previously committed configurations.

Published: 2013-07-26