6.2. 事件流

支持通知的RESTCONF服务器将为每个通知传递服务访问点填充一个流资源。 RESTCONF客户端可以使用“stream”列表中的GET方法从RESTCONF服务器检索支持的事件流的列表。

在“ietf-restconf-monitoring”模块(在9.3节中定义)中的“restconf-state/streams”容器定义用于指定“streams”资源中的概念子资源的结构和语法。

例如:

客户端可能会发送以下请求:

GET /restconf/data/ietf-restconf-monitoring:restconf-state/streams HTTP/1.1
Host: example.com
Accept: application/yang-data+xml

服务器可能会发送以下响应:

HTTP/1.1 200 OK
Content-Type: application/yang-data+xml

<streams
  xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring">
   <stream>
      <name>NETCONF</name>
      <description>default NETCONF event stream</description>
      <replay-support>true</replay-support>
      <replay-log-creation-time>
         2007-07-08T00:00:00Z
      </replay-log-creation-time>
      <access>
         <encoding>xml</encoding>
         <location>https://example.com/streams/NETCONF</location>
      </access>
      <access>
         <encoding>json</encoding>
         <location>https://example.com/streams/NETCONF-JSON</location>
      </access>
   </stream>
   <stream>
    <name>SNMP</name>
       <description>SNMP notifications</description>
       <replay-support>false</replay-support>
       <access>
          <encoding>xml</encoding>
          <location>https://example.com/streams/SNMP</location>
       </access>
    </stream>
    <stream>
       <name>syslog-critical</name>
       <description>Critical and higher severity</description>
       <replay-support>true</replay-support>
       <replay-log-creation-time>
          2007-07-01T00:00:00Z
       </replay-log-creation-time>
       <access>
          <encoding>xml</encoding>
          <location>
            https://example.com/streams/syslog-critical
          </location>
       </access>
    </stream>
</streams>

results matching ""

    No results matching ""