IETF YANG-Push · How to Deploy

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 with netconf-console.



Netconf YANG-Push Capability Discovery Example

Shows which xpaths and subtrees can be subscribed in which intervall and dampening period


    netconf-console2 --host=192.0.2.1 --port=830 --db=running --user=user
		--rpc=get-yp-subscription.xml --commit

    <get>
      <filter type="subtree">
        <system-capabilities xmlns="urn:ietf:params:xml:ns:yang:ietf-system-capabilities" />
      </filter>
    </get>
    


Netconf YANG Library Query Example

Shows YANG module names, versions and their dependencies


    netconf-console2 --host=192.0.2.1 --port=830 --db=running --user=user
		--rpc=get-yp-subscription.xml --commit

    <get>
      <filter type="subtree">
        <yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library" />
        <modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library" />
      </filter>
    </get>
    


Netconf YANG-Push Configuration Examples

Configure a YANG-Push Receiver on a Publisher


    netconf-console2 --host=192.0.2.1 --port=830 --db=candidate --user=user 
		--edit-config=edit-config-yp-subscription-receiver.xml --commit

    <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>ypreceiver</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>
    

Delete YANG-Push Receiver


    netconf-console2 --host=192.0.2.1 --port=830 --db=candidate --user=user 
		--edit-config=edit-config-yp-subscription-receiver-delete.xml --commit
		
    <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 nc:operation="delete" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
          <name>ypreceiver</name>
        </receiver-instance>
      </receiver-instances>
    </subscriptions>
    

Configure a Periodical YANG-Push Subscription with Anchor-Time on a Publisher


    netconf-console2 --host=192.0.2.1 --port=830 --db=candidate --user=user 
		--edit-config=edit-config-yp-subscription-periodical.xml --commit

    <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>
        <transport xmlns:unt="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport">unt:udp-notif
        </transport>
        <encoding>encode-json</encoding>
        <source-address>192.0.2.254</source-address>
        <receivers>
          <receiver>
            <name>ypreceiver</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-01-01T00:00:30Z</anchor-time>
        </periodic>
      </subscription>
    </subscriptions>
    

Configure a On-Change YANG-Push Subscription with Sync-On-Start on a Publisher


    netconf-console2 --host=192.0.2.1 --port=830 --db=candidate --user=user 
		--edit-config=edit-config-yp-subscription-onchange.xml --commit

    <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>
        <transport xmlns:unt="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport">unt:udp-notif
        </transport>
        <encoding>encode-json</encoding>
        <source-address>192.0.2.254</source-address>
        <receivers>
          <receiver>
            <name>ypreceiver</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>
    

Delete YANG-Push Subscriptions


    netconf-console2 --host=192.0.2.1 --port=830 --db=candidate --user=user 
		--edit-config=edit-config-yp-subscription-delete.xml --commit

    <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
      <subscription nc:operation="delete" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
        <id>1</id>
      </subscription>
    </subscriptions>
    

Retrieve YANG-Push Subscriptions


    netconf-console2 --host=192.0.2.1 --port=830 --db=runnin --user=user 
		--rpc=get-yp-subscription.xml

    <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <filter type="subtree">
        <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"/>
        <filters xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"/>
      <filter>
    </get>