Describes how a YANG-Push Publisher capabilities can be discovered, YANG-Push subscriptions can be configured and YANG Library can be queried with Netconf by giving examples.
Netconf YANG-Push Capability Discovery Example
Shows which xpaths and subtrees can be subscribed in which intervall and dampening period
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <get> <filter type="subtree"> <system-capabilities xmlns="urn:ietf:params:xml:ns:yang:ietf-system-capabilities" /> </filter> </get> </rpc>
Netconf YANG Library Query Example
Shows YANG module names, versions and their dependencies
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <get> <filter type="subtree"> <yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library" /> </filter> </get> </rpc>
Netconf YANG-Push Configuration Examples
Configure a YANG-Push Receiver on a Publisher
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <edit-config> <target> <running /> </target> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <receiver-instances xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers"> <receiver-instance> <name>udpnotifdaemon</name> <udp-notif-receiver xmlns="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport"> <address>192.0.2.1</address> <port>10000</port> <enable-segmentation>true</enable-segmentation> <max-segment-size>1458</max-segment-size> </udp-notif-receiver> </receiver-instance> </receiver-instances> </subscriptions> </config> </edit-config> </rpc>
Delete YANG-Push Receiver
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <edit-config> <target> <running /> </target> <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <receiver-instances xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers"> <receiver-instance> <name>udpnotifdaemon</name> </receiver-instance> </receiver-instances> </subscriptions> </config> </edit-config> </rpc>
Configure a Periodical YANG-Push Subscription with Anchor-Time on a Publisher
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <edit-config> <target> <running /> </target> <config> <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <subscription> <id>1</id> <datastore xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">ds:operational </datastore> <datastore-xpath-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> /if:interfaces/if:interface[if:type='ianaift:ethernetCsmacd']/if:statistics </datastore-xpath-filter> <dscp>0</dscp> <transport xmlns:unt="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport">unt:udp-notif </transport> <encoding>encode-json</encoding> <purpose /> <source-address>10.190.64.79</source-address> <receivers> <receiver> <name>udpnotifdaemon</name> <receiver-instance-ref xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers">udpnotif </receiver-instance-ref> </receiver> </receivers> <periodic xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push"> <period>6000</period> <anchor-time>2025-03-02T00:00:00Z</anchor-time> </periodic> </subscription> </subscriptions> </config> </edit-config> </rpc>
Configure a On-Change YANG-Push Subscription with Sync-On-Start on a Publisher
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <edit-config> <target> <running /> </target> <config> <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <subscription> <id>2</id> <datastore xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">ds:operational </datastore> <datastore-xpath-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> /if:interfaces/if:interface[if:type='ianaift:ethernetCsmacd'] </datastore-xpath-filter> <dscp>0</dscp> <transport xmlns:unt="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport">unt:udp-notif </transport> <encoding>encode-json</encoding> <purpose /> <source-address>10.190.64.79</source-address> <receivers> <receiver> <name>udpnotifdaemon</name> <receiver-instance-ref xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers">udpnotif </receiver-instance-ref> </receiver> </receivers> <on-change xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push"> <dampening-period>5000</dampening-period> <sync-on-start>true</sync-on-start> </on-change> </subscription> </subscriptions> </config> </edit-config> </rpc>
Delete YANG-Push Subscription
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <edit-config> <target> <running /> </target> <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <subscription xc:operation="delete"> <id>1</id> </subscription> </subscriptions> </config> </edit-config> </rpc>