DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
In order to augment the module, the "augment"
statement is used as follows:
import interface-statistics {
prefix "intf-stats";
}
augment "/intf-stats:statistics" {
leaf in-unicast-pkts {
type yang:counter64;
description "Number of unicast
packets received on the interface.";
}
leaf out-unicast-pkts {
type yang:counter64;
description "Number of unicast
packets sent out the interface.";
}
}

Notice in Example 12-5 that the augment statement
takes as input the relative path for the statistics object
in the intf-stats module. Two new leaves are added to
the model: in-unicast-pkts for inbound unicast data
packets on an interface and out-unicast-pkts for
outbound unicast data packets on the interface.


YANG supports the definition of NETCONF RPCs. This
means that in addition to the predefined NETCONF
operations (get, get-config, and edit-config),
additional operations can be defined in YANG. This is
done through the rpc declaration. It’s a common
occurrence to have several different operating system
images stored in the flash memory of networking
devices, including the current running image, the
previous image, and an image for upgrade. Upgrading
software packages and operating system images is a
common operational requirement for network
administrators. NETCONF does not support this
common operational task by default. Example 12-6
shows the YANG definition of a new NETCONF action to
activate a specific software image on the device that
implements this action.

Free download pdf