B.3.6. “filter”参数

以下URI显示了通知过滤器规范的一些示例:

  1. // filter = /event/event-class='fault'
  2. GET /streams/NETCONF?filter=%2Fevent%2Fevent-class%3D'fault'
  3. // filter = /event/severity<=4
  4. GET /streams/NETCONF?filter=%2Fevent%2Fseverity%3C%3D4
  5. // filter = /linkUp|/linkDown
  6. GET /streams/SNMP?filter=%2FlinkUp%7C%2FlinkDown
  7. // filter = /*/reporting-entity/card!='Ethernet0'
  8. GET /streams/NETCONF?filter=%2F*%2Freporting-entity%2Fcard%21%3D'Ethernet0'
  9. // filter = /*/email-addr[contains(.,'company.com')]
  10. GET /streams/critical-syslog?ilter=%2F*%2Femail-addr[contains(.%2C'company.com')]
  11. // Note: The module name is used as the prefix.
  12. // filter = (/example-mod:event1/name='joe' and
  13. // /example-mod:event1/status='online')
  14. GET /streams/NETCONF?filter=(%2Fexample-mod%3Aevent1%2Fname%3D'joe'%20and%20%2Fexample-mod%3Aevent1%2Fstatus%3D'online')
  15. // To get notifications from just two modules (e.g., m1 + m2)
  16. // filter=(/m1:* or /m2:*)
  17. GET /streams/NETCONF?filter=(%2Fm1%3A*%20or%20%2Fm2%3A*)