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

Requesting All Configuration Objects of a Specified Type

To request complete information about all configuration objects of a specified type in a hierarchy level, a client application emits a <filter> 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 immediate parent level for the object type. An empty tag represents the requested object type. The entire request is enclosed in an <rpc> tag element:

<rpc>
    <get-config>
        <source>
            <!- - tag specifying the source configuration - ->
        </source>
        <filter type="subtree">
            <configuration>
                <!- - opening tags for each parent of the requested object type - ->
                    <object-type/>
                <!- - closing tags for each parent of the requested object type - ->
            </configuration>
        </filter>
    </get-config>
</rpc>
]]>]]>

For information about the <source> tag element, see Requesting Information from the Committed or Candidate Configuration.

This type of request is useful when the object’s parent hierarchy level has more than one type of child object. If the requested object is the only child type that can occur in its parent hierarchy level, then this type of request yields the same output as a request for the complete parent hierarchy, which is described in Requesting a Hierarchy Level or Container Object Without an Identifier.

The NETCONF server returns the requested objects in <data> and <rpc-reply> tag elements. For information about the attributes in the opening <configuration> tag, see Requesting Information from the Committed or Candidate Configuration.

<rpc-reply xmlns="URN" xmlns:junos="URL">
    <data>
        <configuration attributes>
            <!- - opening tags for each parent of the object type - ->
                <first-object>
                    <!- - child tag elements for the first object - ->
                </first-object>
                <second-object>
                    <!- - child tag elements for the second object - ->
                </second-object>
                <!- - additional instances of the object - ->
            <!- - closing tags for each parent of the object type - ->
        </configuration>
    </data>
</rpc-reply>
]]>]]>

The application can also request additional configuration elements of the same or other types by including the appropriate tag elements in the same <get-config> tag element. For more information, see Requesting Multiple Configuration Elements Simultaneously .

The following example shows how to request complete information about all radius-server objects at the [edit system] hierarchy level in the candidate configuration.

Image t2129.gif
[Contents] [Prev] [Next] [Index] [Report an Error]