Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Filter Operational Command Output for Container Elements Without an Identifier in NETCONF and Junos XML Protocol Sessions

In a NETCONF or Junos XML protocol session with a device running Junos OS, a client application can request operational information for the device and filter the output to select for a specific container element and its descendants. To filter the operational command output for a container element that does not have an identifier (<name> or equivalent element), a client application emits an RPC request for operational information and includes a <filter type="subtree"> element that encloses the tag elements representing all levels in the operational command output hierarchy from the root element down to the immediate parent level of the container object. The container itself is represented by an empty tag.

The server returns the container node specified in the request along with all of its descendants. The output is enclosed in an <rpc-reply> element.

In the following example, the client application requests information for the show system uptime operational command, which corresponds to the <get-system-uptime-information> RPC request tag. The client selects for the <uptime-information/> node in the output.

The RPC reply returns the requested output, which includes the <uptime-information> element and its descendants.

The client application can also select for specific leaf nodes in the container by including those nodes as selection nodes, or empty tags, within the container element in the request. To return just the <up-time> element in the output for the previous example, the client emits the empty tag for that node in the request.

The RPC reply returns only the requested node.