6.2. 事件流

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

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

例如:

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

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

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

  1. HTTP/1.1 200 OK
  2. Content-Type: application/yang-data+xml
  3. <streams
  4. xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring">
  5. <stream>
  6. <name>NETCONF</name>
  7. <description>default NETCONF event stream</description>
  8. <replay-support>true</replay-support>
  9. <replay-log-creation-time>
  10. 2007-07-08T00:00:00Z
  11. </replay-log-creation-time>
  12. <access>
  13. <encoding>xml</encoding>
  14. <location>https://example.com/streams/NETCONF</location>
  15. </access>
  16. <access>
  17. <encoding>json</encoding>
  18. <location>https://example.com/streams/NETCONF-JSON</location>
  19. </access>
  20. </stream>
  21. <stream>
  22. <name>SNMP</name>
  23. <description>SNMP notifications</description>
  24. <replay-support>false</replay-support>
  25. <access>
  26. <encoding>xml</encoding>
  27. <location>https://example.com/streams/SNMP</location>
  28. </access>
  29. </stream>
  30. <stream>
  31. <name>syslog-critical</name>
  32. <description>Critical and higher severity</description>
  33. <replay-support>true</replay-support>
  34. <replay-log-creation-time>
  35. 2007-07-01T00:00:00Z
  36. </replay-log-creation-time>
  37. <access>
  38. <encoding>xml</encoding>
  39. <location>
  40. https://example.com/streams/syslog-critical
  41. </location>
  42. </access>
  43. </stream>
  44. </streams>