本文记录了ODL控制器中Notification的开发过程
1. Yang文件的编写
首先在api目录构建自己的yang文件:packetsend.yang
在yang文件里边编写notification服务
// Contents of "packetsend"
module packetsend {
namespace "urn:opendaylight:packetsend";
prefix "packetsend";
revision 2018-05-12 {
description "Initial revision";
}
notification send-packet{
leaf name{
type string;
}
leaf content{
type string;
}
}
notification news{
leaf content{
type string;
}
}
}通过notification关键字来创建notification服务
编写完成后保存会自动问我们生成binding接口
每一个notification会对应一