This example shows how a NETCONF <get-config> request works.
Figure 2: <get-config> request
The send message request is to get the current configuration of CDP running on the router. The return message
includes the current CDP configuration.
NETCONF reply (server to client)NETCONF request (client to server)
<?xml version="1.0"?>
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:NETCONF:base:1.0">
<data>
<cdp
xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-cdp-cfg">
<timer>10</timer>
<enable>true</enable>
<log-adjacency></log-adjacency>
<hold-time>200</hold-time>
<advertise-v1-only></advertise-v1-only>
</cdp>
</data>
</rpc-reply>
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:NETCONF:base:1.0">
<get-config>
<source><running/></source>
<filter>
<cdp
xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-cdp-cfg"/>
</filter>
</get-config>
</rpc>
The RPC element is used to enclose a NETCONF request sent from the client to the server. The <rpc> element
has a mandatory attribute message-id, which is a string chosen by the sender of the RPC that will commonly
encode a monotonically increasing integer. The receiver of the RPC does not decode or interpret this string
but simply saves it to be used as a message-id attribute in any resulting <rpc-reply> message. The sender
MUST ensure that the message-id value is normalized. The RPC reply message contains the same message-id
when the client receives information from the server.
Subtree Filtering
XML subtree filtering is a mechanism that allows an application to select particular XML subtrees to include
in the <rpc-reply> for a <get> or <get-config> operation.
Subtree Filter Components
A subtree filter is comprised of XML elements and their XML attributes. Elements that can be present in a
subtree filter are:
•
Namespace selection - A namespace is considered to match (for filter purposes) if the XML namespace
associated with a particular node within the filter element is the same as in the underlying data model.
Data Models Configuration Guide for Cisco NCS 1001
6
Data models
Subtree Filtering