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

Requesting Specific Child Tags for a Configuration Object

To request specific child tag elements for a specific configuration object, a client application emits a <filter> tag element that encloses the tag elements representing all levels of the configuration hierarchy from the root (represented by the <configuration> tag element) down to the immediate parent level for the object. To represent the requested object, the application emits its container tag element and identifier tag element. For objects with a single identifier, the <name> tag element can always be used, even if the actual identifier tag element has a different name. The actual name is also valid. For objects with multiple identifiers, the actual names of the identifier tag elements must be used. To represent the child tag elements to return, it emits each one as an empty tag. 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 object - ->
                    <object>
                        <name>identifier</name>
                        <first-child/>
                        <second-child/>
                        <!- - empty tag for each additional child to return - ->
                    </object>
                <!- - closing tags for each parent of the object - ->
            </configuration>
        </filter>
    </get-config>
</rpc>
]]>]]>

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

The NETCONF server returns the requested children of the object in <data> and <rpc-reply> tag elements (here, an object for which the identifier tag element is called <name>). 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 - ->
                <object>
                    <name>identifier</name>
                    <!- - requested child tag elements - ->
                </object>
            <!- - closing tags for each parent of the object - ->
        </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 only the address of the next-hop router for the 192.168.5.0/24 route at the [edit routing-options static] hierarchy level in the candidate configuration.

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