【问题标题】:how is this yang notification valid?这个杨通知如何有效?
【发布时间】:2017-09-18 13:42:41
【问题描述】:

yang 1.1 规范有这个例子, 以下示例在数据节点中定义通知:

 module example-interface-module {
   yang-version 1.1;
   namespace "urn:example:interface-module";
   prefix "if";

   container interfaces {
     list interface {
       key "name";
       leaf name {
         type string;
       }
       notification interface-enabled {
         leaf by-user {
           type string;
         }
       }
     }
   }
 }

完整通知的对应XML实例示例:

 <notification
   xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
   <eventTime>2008-07-08T00:01:00Z</eventTime>
   <interfaces xmlns="urn:example:interface-module">
     <interface>
       <name>eth1</name>
       <interface-enabled>
         <by-user>fred</by-user>
       </interface-enabled>
     </interface>
   </interfaces>
 </notification>

我的问题是,当我从服务器发出通知时,我认为通知内容是这样的:

<notification
   xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
   <eventTime>2008-07-08T00:01:00Z</eventTime>
   <interface-enabled xmlns="urn:example:interface-module">
      <by-user>fred</by-user>
   </interface-enabled>
 </notification>

但是,如果不识别通知相关的数据节点,这样的通知将毫无用处。

我想我的问题是,规范中的什么规则/文本告诉我如何正确形成有效载荷

【问题讨论】:

    标签: ietf-netmod-yang


    【解决方案1】:

    https://www.rfc-editor.org/rfc/rfc7950#section-7.16.2

    当通知节点被定义为数据节点的子节点时, [RFC5277] 中定义的元素包含一个层次结构 标识数据存储中的节点的节点。 它必须包含所有 从顶层到列表的容器和列表节点或 包含通知的容器

    通知负载必须包括所有祖先容器/列表,直到模块根目录。只有这样,才能始终确定通知所指的确切节点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      • 2012-04-01
      • 2017-07-23
      • 2022-07-31
      • 1970-01-01
      • 2011-06-17
      相关资源
      最近更新 更多