The RPC definition contains inputs and outputs. In this
case, the input leaf specifies the binary of the image that
will be activated, and the output leaf contains the status
of the RPC action. Keep in mind that the additional RPCs
are defined through YANG models and available on the
server side on the device. The client or the management
system interacting with the server would also have to be
able to interpret the output and execute the custom RPC
action.
Example 12-6 NETCONF RPC Action Definition
Click here to view code image
rpc activate-software-image {
input {
leaf image {
type binary;
}
}
output {
leaf status {
type string;
}
}
}
NETCONF supports notification messages, which are
similar to SNMP traps. The notification statement is
used to define NETCONF notifications. It takes only one
argument, which is the identifier, followed by a block of
data statements that contain the detailed notification
information. Example 12-7 shows a simple NETCONF
notification for a configuration change.
Example 12-7 NETCONF Notification Definition
Click here to view code image
notification config-change {
description "The configuration change.";
leaf operator-name {
type string;
}