Internet Engineering Task Force (IETF) E. Voit Request for Comments: 8639 Cisco Systems Category: Standards Track A. Clemm ISSN: 2070-1721 Futurewei A. Gonzalez Prieto Microsoft E. Nilsen-Nygaard A. Tripathy Cisco Systems September 2019
Internet Engineering Task Force (IETF) E. Voit Request for Comments: 8639 Cisco Systems Category: Standards Track A. Clemm ISSN: 2070-1721 Futurewei A. Gonzalez Prieto Microsoft E. Nilsen-Nygaard A. Tripathy Cisco Systems September 2019
Subscription to YANG Notifications
订阅YANG通知
Abstract
摘要
This document defines a YANG data model and associated mechanisms enabling subscriber-specific subscriptions to a publisher's event streams. Applying these elements allows a subscriber to request and receive a continuous, customized feed of publisher-generated information.
本文档定义了一个数据模型和相关机制,使订阅者能够订阅发布者的事件流。应用这些元素允许订阅者请求和接收发布者生成的信息的连续、自定义提要。
Status of This Memo
关于下段备忘
This is an Internet Standards Track document.
这是一份互联网标准跟踪文件。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.
本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 7841第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8639.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问https://www.rfc-editor.org/info/rfc8639.
Copyright Notice
版权公告
Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.
版权(c)2019 IETF信托基金和被确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(https://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.
本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,也不得在IETF标准流程之外创建其衍生作品,除了将其格式化以RFC形式发布或将其翻译成英语以外的其他语言。
Table of Contents
目录
1. Introduction ....................................................3 1.1. Motivation .................................................4 1.2. Terminology ................................................4 1.3. Solution Overview ..........................................6 1.4. Relationship to RFC 5277 ...................................7 2. Solution ........................................................8 2.1. Event Streams ..............................................8 2.2. Event Stream Filters .......................................9 2.3. QoS ........................................................9 2.4. Dynamic Subscriptions .....................................10 2.5. Configured Subscriptions ..................................19 2.6. Event Record Delivery .....................................27 2.7. Subscription State Change Notifications ...................28 2.8. Subscription Monitoring ...................................33 2.9. Support for the "ietf-subscribed-notifications" YANG Module ...............................................34 3. YANG Data Model Tree Diagrams ..................................34 3.1. The "streams" Container ...................................34 3.2. The "filters" Container ...................................35 3.3. The "subscriptions" Container .............................35 4. Event Notification Subscription YANG Module ....................37 5. IANA Considerations ............................................66 6. Implementation Considerations ..................................66 7. Transport Requirements .........................................67 8. Security Considerations ........................................68 9. References .....................................................72 9.1. Normative References ......................................72 9.2. Informative References ....................................74 Appendix A. Example Configured Transport Augmentation .............75 Acknowledgments ...................................................77 Authors' Addresses ................................................77
1. Introduction ....................................................3 1.1. Motivation .................................................4 1.2. Terminology ................................................4 1.3. Solution Overview ..........................................6 1.4. Relationship to RFC 5277 ...................................7 2. Solution ........................................................8 2.1. Event Streams ..............................................8 2.2. Event Stream Filters .......................................9 2.3. QoS ........................................................9 2.4. Dynamic Subscriptions .....................................10 2.5. Configured Subscriptions ..................................19 2.6. Event Record Delivery .....................................27 2.7. Subscription State Change Notifications ...................28 2.8. Subscription Monitoring ...................................33 2.9. Support for the "ietf-subscribed-notifications" YANG Module ...............................................34 3. YANG Data Model Tree Diagrams ..................................34 3.1. The "streams" Container ...................................34 3.2. The "filters" Container ...................................35 3.3. The "subscriptions" Container .............................35 4. Event Notification Subscription YANG Module ....................37 5. IANA Considerations ............................................66 6. Implementation Considerations ..................................66 7. Transport Requirements .........................................67 8. Security Considerations ........................................68 9. References .....................................................72 9.1. Normative References ......................................72 9.2. Informative References ....................................74 Appendix A. Example Configured Transport Augmentation .............75 Acknowledgments ...................................................77 Authors' Addresses ................................................77
This document defines a YANG data model and associated mechanisms enabling subscriber-specific subscriptions to a publisher's event streams. This effectively enables a "subscribe, then publish" capability where the customized information needs and access permissions of each target receiver are understood by the publisher before subscribed event records are marshaled and pushed. The receiver then gets a continuous, customized feed of publisher-generated information.
本文档定义了一个数据模型和相关机制,使订阅者能够订阅发布者的事件流。这有效地实现了“先订阅,然后发布”功能,其中发布者在封送和推送订阅的事件记录之前了解每个目标接收器的自定义信息需求和访问权限。然后,接收者获得发布者生成的信息的连续、定制的提要。
While the functionality defined in this document is transport agnostic, transports like the Network Configuration Protocol (NETCONF) [RFC6241] or RESTCONF [RFC8040] can be used to configure or dynamically signal subscriptions. Bindings for subscribed event record delivery for NETCONF and RESTCONF are defined in [RFC8640] and [RESTCONF-Notif], respectively.
虽然本文档中定义的功能与传输无关,但网络配置协议(NETCONF)[RFC6241]或RESTCONF[RFC8040]等传输可用于配置订阅或动态发送订阅信号。NETCONF和RESTCONF的订阅事件记录传递绑定分别在[RFC8640]和[RESTCONF Notif]中定义。
The YANG data model defined in this document conforms to the Network Management Datastore Architecture defined in [RFC8342].
本文件中定义的YANG数据模型符合[RFC8342]中定义的网络管理数据存储体系结构。
Various limitations to subscriptions as described in [RFC5277] were alleviated to some extent by the requirements provided in [RFC7923]. Resolving any remaining issues is the primary motivation for this work. Key capabilities supported by this document include:
[RFC5277]中所述的各种订阅限制通过[RFC7923]中提供的要求在一定程度上得到缓解。解决任何遗留问题是这项工作的主要动机。本文档支持的关键功能包括:
o multiple subscriptions on a single transport session
o 单个传输会话上的多个订阅
o support for dynamic and configured subscriptions
o 支持动态订阅和配置订阅
o modification of an existing subscription in progress
o 正在修改现有订阅
o per-subscription operational counters
o 每个订阅操作计数器
o negotiation of subscription parameters (through the use of hints returned as part of declined subscription requests)
o 订阅参数协商(通过使用作为拒绝订阅请求的一部分返回的提示)
o subscription state change notifications (e.g., publisher-driven suspension, parameter modification)
o 订阅状态更改通知(例如,发布者驱动的暂停、参数修改)
o independence from transport
o 独立于运输
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”在所有大写字母出现时(如图所示)应按照BCP 14[RFC2119][RFC8174]所述进行解释。
o Client: Defined in [RFC8342].
o 客户机:在[RFC8342]中定义。
o Configuration: Defined in [RFC8342].
o 配置:在[RFC8342]中定义。
o Configuration datastore: Defined in [RFC8342].
o 配置数据存储:在[RFC8342]中定义。
o Configured subscription: A subscription installed via configuration into a configuration datastore.
o 配置订阅:通过配置安装到配置数据存储中的订阅。
o Dynamic subscription: A subscription created dynamically by a subscriber via a Remote Procedure Call (RPC).
o 动态订阅:订阅服务器通过远程过程调用(RPC)动态创建的订阅。
o Event: An occurrence of something that may be of interest. Examples include a configuration change, a fault, a change in status, crossing a threshold, or an external input to the system.
o 事件:可能感兴趣的事情的发生。示例包括配置更改、故障、状态更改、超过阈值或系统的外部输入。
o Event occurrence time: A timestamp matching the time an originating process identified as when an event happened.
o 事件发生时间:与原始进程标识为事件发生时的时间匹配的时间戳。
o Event record: A set of information detailing an event.
o 事件记录:详细描述事件的一组信息。
o Event stream: A continuous, chronologically ordered set of events aggregated under some context.
o 事件流:在某些上下文下聚合的连续、按时间顺序排列的事件集。
o Event stream filter: Evaluation criteria that may be applied against event records in an event stream. Event records pass the filter when specified criteria are met.
o 事件流筛选器:可对事件流中的事件记录应用的评估标准。当满足指定条件时,事件记录通过筛选器。
o Notification message: Information intended for a receiver indicating that one or more events have occurred.
o 通知消息:用于接收者的信息,指示发生了一个或多个事件。
o Publisher: An entity responsible for streaming notification messages per the terms of a subscription.
o 发布者:根据订阅条款负责流式发送通知消息的实体。
o Receiver: A target to which a publisher pushes subscribed event records. For dynamic subscriptions, the receiver and subscriber are the same entity.
o 接收者:发布者将订阅的事件记录推送到的目标。对于动态订阅,接收方和订阅方是同一实体。
o Subscriber: A client able to request and negotiate a contract for the generation and push of event records from a publisher. For dynamic subscriptions, the receiver and subscriber are the same entity.
o 订阅者:能够请求和协商从发布者生成和推送事件记录的合同的客户端。对于动态订阅,接收方和订阅方是同一实体。
o Subscription: A contract with a publisher, stipulating the information that one or more receivers wish to have pushed from the publisher without the need for further solicitation.
o 订阅:与出版商签订的合同,规定一个或多个接收者希望从出版商处推送信息,而无需进一步征求。
All YANG tree diagrams used in this document follow the notation defined in [RFC8340].
本文件中使用的所有杨树图均遵循[RFC8340]中定义的符号。
This document describes a transport-agnostic mechanism for subscribing to and receiving content from an event stream in a publisher. This mechanism operates through the use of a subscription.
本文档描述了一种传输无关机制,用于订阅发布服务器中的事件流并从中接收内容。此机制通过使用订阅进行操作。
Two types of subscriptions are supported:
支持两种类型的订阅:
1. Dynamic subscriptions, where a subscriber initiates a subscription negotiation with a publisher via an RPC. If the publisher is able to serve this request, it accepts it and then starts pushing notification messages back to the subscriber. If the publisher is not able to serve it as requested, then an error response is returned. This response MAY include hints for subscription parameters that, had they been present, may have enabled the dynamic subscription request to be accepted.
1. 动态订阅,其中订阅服务器通过RPC发起与发布服务器的订阅协商。如果发布者能够为该请求提供服务,它将接受该请求,然后开始将通知消息推送回订阅服务器。如果发布服务器无法按请求提供服务,则返回错误响应。此响应可能包括订阅参数的提示,如果存在这些参数,则可能已允许接受动态订阅请求。
2. Configured subscriptions, which allow the management of subscriptions via a configuration so that a publisher can send notification messages to a receiver. Support for configured subscriptions is optional, with its availability advertised via a YANG feature.
2. 已配置订阅,允许通过配置管理订阅,以便发布者可以向接收者发送通知消息。对已配置订阅的支持是可选的,其可用性通过一个功能进行广告。
Additional characteristics differentiating configured from dynamic subscriptions include the following:
与动态订阅不同的其他特征包括:
o The lifetime of a dynamic subscription is bound by the transport session used to establish it. For connection-oriented stateful transports like NETCONF, the loss of the transport session will result in the immediate termination of any associated dynamic subscriptions. For connectionless or stateless transports like HTTP, a lack of receipt acknowledgment of a sequential set of notification messages and/or keep-alives can be used to trigger a termination of a dynamic subscription. Contrast this to the lifetime of a configured subscription. This lifetime is driven by relevant configuration being present in the publisher's applied configuration. Being tied to configuration operations implies that (1) configured subscriptions can be configured to persist across reboots and (2) a configured subscription can persist even when its publisher is fully disconnected from any network.
o 动态订阅的生存期受用于建立它的传输会话的限制。对于面向连接的有状态传输(如NETCONF),传输会话的丢失将导致任何关联的动态订阅立即终止。对于HTTP之类的无连接或无状态传输,可以使用缺少一组连续通知消息和/或保持有效性的接收确认来触发动态订阅的终止。将其与已配置订阅的生存期进行对比。此生存期由发布者应用的配置中存在的相关配置驱动。绑定到配置操作意味着(1)可以将配置的订阅配置为在重新启动期间保持不变,(2)即使其发布服务器与任何网络完全断开连接,配置的订阅也可以保持不变。
o Configured subscriptions can be modified by any configuration client with write permission on the configuration of the subscription. Dynamic subscriptions can only be modified via an RPC request made by the original subscriber or by a change to configuration data referenced by the subscription.
o 任何具有订阅配置写权限的配置客户端都可以修改配置的订阅。只能通过原始订阅服务器发出的RPC请求或通过更改订阅引用的配置数据来修改动态订阅。
Note that there is no mixing and matching of dynamic and configured operations on a single subscription. Specifically, a configured subscription cannot be modified or deleted using RPCs defined in this document. Similarly, a dynamic subscription cannot be directly modified or deleted by configuration operations. It is, however, possible to perform a configuration operation that indirectly impacts a dynamic subscription. By changing the value of a preconfigured filter referenced by an existing dynamic subscription, the selected event records passed to a receiver might change.
请注意,在单个订阅上不存在动态操作和配置操作的混合和匹配。具体而言,无法使用本文档中定义的RPC修改或删除已配置的订阅。类似地,动态订阅不能通过配置操作直接修改或删除。但是,可以执行间接影响动态订阅的配置操作。通过更改现有动态订阅引用的预配置筛选器的值,传递给接收器的选定事件记录可能会更改。
Also note that transport-specific specifications based on this specification MUST detail the lifecycle of dynamic subscriptions as well as the lifecycle of configured subscriptions (if supported).
还请注意,基于此规范的特定于传输的规范必须详细说明动态订阅的生命周期以及配置订阅的生命周期(如果支持)。
A publisher MAY terminate a dynamic subscription at any time. Similarly, it MAY decide to temporarily suspend the sending of notification messages for any dynamic subscription, or for one or more receivers of a configured subscription. Such termination or suspension is driven by internal considerations of the publisher.
发布者可以随时终止动态订阅。类似地,它可以决定暂时暂停发送任何动态订阅的通知消息,或者暂停发送已配置订阅的一个或多个接收器的通知消息。此类终止或暂停由出版商的内部考虑决定。
This document is intended to provide a superset of the subscription capabilities initially defined in [RFC5277]. It is important to understand what has been reused and what has been replaced, especially when extending an existing implementation that is based on [RFC5277]. Key relationships between these two documents include the following:
本文档旨在提供[RFC5277]中最初定义的订阅功能的超集。理解重用了什么和替换了什么很重要,尤其是在扩展基于[RFC5277]的现有实现时。这两份文件之间的关键关系包括:
o This document defines a transport-independent capability; [RFC5277] is specific to NETCONF.
o 本文件定义了独立于运输的能力;[RFC5277]特定于NETCONF。
o For the new operations, the data model defined in this document is used instead of the data model defined in Section 3.4 of [RFC5277].
o 对于新操作,使用本文件中定义的数据模型,而不是[RFC5277]第3.4节中定义的数据模型。
o The RPC operations in this document replace the operation <create-subscription> as defined in [RFC5277], Section 4.
o 本文档中的RPC操作替换[RFC5277]第4节中定义的操作<create subscription>。
o The <notification> message of [RFC5277], Section 4 is used.
o 使用[RFC5277]第4节的<notification>消息。
o The included contents of the "NETCONF" event stream are identical between this document and [RFC5277].
o “NETCONF”事件流的包含内容在本文档和[RFC5277]之间是相同的。
o A publisher MAY implement both the Notification Management Schema and RPCs defined in [RFC5277] and this document concurrently.
o 发布者可以同时实现[RFC5277]和本文档中定义的通知管理模式和RPC。
o Unlike [RFC5277], this document enables a single transport session to intermix notification messages and RPCs for different subscriptions.
o 与[RFC5277]不同,本文档允许单个传输会话混合不同订阅的通知消息和RPC。
o A subscription "stop-time" can be specified as part of a notification replay. This supports a capability analogous to the <stopTime> parameter of [RFC5277]. However, in this specification, a "stop-time" parameter can also be applied without replay.
o 订阅“停止时间”可以指定为通知重播的一部分。这支持类似于[RFC5277]的<stopTime>参数的功能。然而,在本规范中,“停止时间”参数也可以在不重播的情况下应用。
Per the overview provided in Section 1.3, this section details the overall context, state machines, and subsystems that may be assembled to allow the subscription of events from a publisher.
根据第1.3节中提供的概述,本节详细介绍了可用于从发布服务器订阅事件的总体上下文、状态机和子系统。
An event stream is a named entity on a publisher; this entity exposes a continuously updating set of YANG-defined event records. An event record is an instantiation of a "notification" YANG statement. If the "notification" is defined as a child to a data node, the instantiation includes the hierarchy of nodes that identifies the data node in the datastore (see Section 7.16.2 of [RFC7950]). Each event stream is available for subscription. Identifying a) how event streams are defined (other than the NETCONF stream), b) how event records are defined/generated, and c) how event records are assigned to event streams is out of scope for this document.
事件流是发布服务器上的命名实体;此实体公开一组连续更新的事件记录。事件记录是“通知”语句的实例化。如果将“通知”定义为数据节点的子节点,则实例化包括在数据存储中标识数据节点的节点层次结构(参见[RFC7950]第7.16.2节)。每个事件流都可供订阅。识别a)如何定义事件流(NETCONF流除外),b)如何定义/生成事件记录,以及c)如何将事件记录分配给事件流超出了本文档的范围。
There is only one reserved event stream name in this document: "NETCONF". The "NETCONF" event stream contains all NETCONF event record information supported by the publisher, except where an event record has explicitly been excluded from the stream. Beyond the "NETCONF" stream, implementations MAY define additional event streams.
此文档中只有一个保留的事件流名称:“NETCONF”。“NETCONF”事件流包含发布服务器支持的所有NETCONF事件记录信息,除非事件记录已明确从流中排除。除了“NETCONF”流之外,实现还可以定义其他事件流。
As YANG-defined event records are created by a system, they may be assigned to one or more streams. The event record is distributed to a subscription's receiver(s) where (1) a subscription includes the identified stream and (2) subscription filtering does not exclude the event record from that receiver.
由于定义的事件记录是由系统创建的,因此可以将它们分配给一个或多个流。将事件记录分发给订阅的接收器,其中(1)订阅包括已识别的流,并且(2)订阅筛选不会将事件记录从该接收器中排除。
Access control permissions may be used to silently exclude event records from an event stream for which the receiver has no read access. See [RFC8341], Section 3.4.6 for an example of how this might be accomplished. Note that per Section 2.7 of this document, subscription state change notifications are never filtered out.
访问控制权限可用于从接收方没有读取权限的事件流中以静默方式排除事件记录。参见[RFC8341],第3.4.6节,了解如何实现这一点的示例。请注意,根据本文档第2.7节,订阅状态更改通知从未被过滤掉。
If no access control permissions are in place for event records on an event stream, then a receiver MUST be allowed access to all the event records. If subscriber permissions change during the lifecycle of a subscription and event stream access is no longer permitted, then the subscription MUST be terminated.
如果事件流上的事件记录没有访问控制权限,则必须允许接收者访问所有事件记录。如果订阅服务器权限在订阅的生命周期内发生更改,并且不再允许访问事件流,则必须终止订阅。
Event records MUST NOT be delivered to a receiver in a different order than the order in which they were placed on an event stream.
事件记录不得以不同于其在事件流中的放置顺序的顺序交付给接收者。
This document defines an extensible filtering mechanism. The filter itself is a boolean test that is placed on the content of an event record. A "false" filtering result causes the event record to be excluded from delivery to a receiver. A filter never results in information being stripped from an event record prior to that event record being encapsulated in a notification message. The two optional event stream filtering syntaxes supported are [XPATH] and subtree [RFC6241].
本文档定义了一个可扩展的筛选机制。过滤器本身是放置在事件记录内容上的布尔测试。“false”筛选结果导致事件记录被排除在发送给接收者之外。在事件记录封装在通知消息中之前,筛选器不会导致从事件记录中剥离信息。支持的两个可选事件流过滤语法是[XPATH]和子树[RFC6241]。
If no event stream filter is provided in a subscription, all event records on an event stream are to be sent.
如果订阅中未提供事件流筛选器,则将发送事件流上的所有事件记录。
This document provides for several Quality of Service (QoS) parameters. These parameters indicate the treatment of a subscription relative to other traffic between publisher and receiver. Included are:
本文档提供了几个服务质量(QoS)参数。这些参数表示订阅相对于发布者和接收者之间的其他流量的处理方式。包括:
o A "dscp" marking to differentiate prioritization of notification messages during network transit.
o “dscp”标记,用于区分网络传输期间通知消息的优先级。
o A "weighting" so that bandwidth proportional to this weighting can be allocated to this subscription relative to other subscriptions.
o 一种“权重”,使得与此权重成比例的带宽可以相对于其他订阅分配给此订阅。
o A "dependency" upon another subscription.
o 对另一订阅的“依赖关系”。
If the publisher supports the "dscp" feature, then a subscription with a "dscp" leaf MUST result in a corresponding Differentiated Services Code Point (DSCP) marking [RFC2474] being placed in the IP header of any resulting notification messages and subscription state change notifications. A publisher MUST respect the DSCP markings for subscription traffic egressing that publisher.
如果发布服务器支持“dscp”功能,则带有“dscp”叶的订阅必须在任何生成的通知消息和订阅状态更改通知的IP标头中放置相应的区分服务代码点(dscp)标记[RFC2474]。发布服务器必须遵守DSCP标记,才能使订阅流量离开该发布服务器。
Different DSCP code points require different transport connections. As a result, where TCP is used, a publisher that supports the "dscp" feature must ensure that a subscription's notification messages are returned in a single TCP transport session where all traffic shares the subscription's "dscp" leaf value. If this cannot be guaranteed, any "establish-subscription" RPC request SHOULD be rejected with a "dscp-unavailable" error.
不同的DSCP代码点需要不同的传输连接。因此,在使用TCP的情况下,支持“dscp”功能的发布服务器必须确保在单个TCP传输会话中返回订阅的通知消息,其中所有通信共享订阅的“dscp”叶值。如果无法保证这一点,则应拒绝任何“建立订阅”RPC请求,并出现“dscp不可用”错误。
For the "weighting" parameter, when concurrently dequeuing notification messages from multiple subscriptions to a receiver, the publisher MUST allocate bandwidth to each subscription proportional to the weights assigned to those subscriptions. "Weighting" is an optional capability of the publisher; support for it is identified via the "qos" feature.
对于“权重”参数,当同时将来自多个订阅的通知消息从队列中释放到接收器时,发布者必须按分配给这些订阅的权重比例为每个订阅分配带宽。“加权”是发布者的可选功能;通过“qos”功能确定对它的支持。
If a subscription has the "dependency" parameter set, then any buffered notification messages containing event records selected by the parent subscription MUST be dequeued prior to the notification messages of the dependent subscription. If notification messages have dependencies on each other, the notification message queued the longest MUST go first. If a "dependency" included in an RPC references a subscription that does not exist or is no longer accessible to that subscriber, that "dependency" MUST be silently removed. "Dependency" is an optional capability of the publisher; support for it is identified via the "qos" feature.
如果订阅设置了“dependency”参数,则包含父订阅选择的事件记录的任何缓冲通知消息必须在从属订阅的通知消息之前退出队列。如果通知消息相互依赖,则队列最长的通知消息必须先到达。如果RPC中包含的“依赖项”引用的订阅不存在或该订阅服务器无法再访问,则必须以静默方式删除该“依赖项”。“依赖性”是发布者的可选功能;通过“qos”功能确定对它的支持。
"Dependency" and "weighting" parameters will only be respected and enforced between subscriptions that share the same "dscp" leaf value.
“依赖项”和“权重”参数将仅在共享相同“dscp”叶值的订阅之间得到尊重和实施。
There are additional types of publisher capacity overload that this specification does not address, as they are out of scope. For example, the prioritization of which subscriptions have precedence when the publisher CPU is overloaded is not discussed. As a result, implementation choices will need to be made to address such considerations.
本规范没有解决其他类型的发布服务器容量过载问题,因为它们超出了范围。例如,未讨论发布服务器CPU过载时哪些订阅具有优先权的优先级。因此,需要做出实施选择来解决这些问题。
Dynamic subscriptions are managed via protocol operations (in the form of RPCs, per [RFC7950], Section 7.14) made against targets located in the publisher. These RPCs have been designed extensibly so that they may be augmented for subscription targets beyond event streams. For examples of such augmentations, see the RPC augmentations in the YANG data model provided in [RFC8641].
动态订阅通过针对发布服务器中的目标进行的协议操作(按照[RFC7950]第7.14节,以RPC的形式)进行管理。这些RPC的设计是可扩展的,因此可以针对事件流以外的订阅目标进行扩展。有关此类增强的示例,请参见[RFC8641]中提供的YANG数据模型中的RPC增强。
Below is the publisher's state machine for a dynamic subscription. Each state is shown in its own box. It is important to note that such a subscription doesn't exist at the publisher until an "establish-subscription" RPC is accepted. The mere request by a subscriber to establish a subscription is not sufficient for that subscription to be externally visible. Start and end states are depicted to reflect subscription creation and deletion events.
下面是发布者的动态订阅状态机。每个状态都显示在自己的框中。请务必注意,在接受“建立订阅”RPC之前,发布服务器上不存在此类订阅。订户仅请求建立订阅并不足以使该订阅在外部可见。开始和结束状态被描述为反映订阅创建和删除事件。
......... : start : :.......: | establish-subscription | | .-------modify-subscription--------. v v | .-----------. .-----------. .--------. | receiver |--insufficient CPU, b/w-->| receiver | modify- '| active | | suspended | subscription | |<----CPU, b/w sufficient--| | ---------->'-----------' '-----------' | | delete/kill-subscription delete/kill- | subscription v | ......... | : end :<---------------------------------' :.......:
......... : start : :.......: | establish-subscription | | .-------modify-subscription--------. v v | .-----------. .-----------. .--------. | receiver |--insufficient CPU, b/w-->| receiver | modify- '| active | | suspended | subscription | |<----CPU, b/w sufficient--| | ---------->'-----------' '-----------' | | delete/kill-subscription delete/kill- | subscription v | ......... | : end :<---------------------------------' :.......:
Figure 1: Publisher's State Machine for a Dynamic Subscription
图1:发布者的动态订阅状态机
Of interest in this state machine are the following:
该状态机的主要功能如下:
o Successful "establish-subscription" or "modify-subscription" RPCs move the subscription to the "active" state.
o 成功的“建立订阅”或“修改订阅”RPC将订阅移动到“活动”状态。
o Failed "modify-subscription" RPCs will leave the subscription in its previous state, with no visible change to any streaming updates.
o 失败的“修改订阅”RPC将使订阅保持其以前的状态,对任何流式更新没有可见的更改。
o A "delete-subscription" or "kill-subscription" RPC will end the subscription, as will reaching a "stop-time".
o “删除订阅”或“终止订阅”RPC将结束订阅,并达到“停止时间”。
o A publisher may choose to suspend a subscription when there is not sufficient CPU or bandwidth available to service the subscription. This is announced to the subscriber via the "subscription-suspended" subscription state change notification.
o 当没有足够的CPU或带宽为订阅提供服务时,发布者可以选择挂起订阅。这将通过“订阅已暂停”订阅状态更改通知通知订阅方。
o A suspended subscription may be modified by the subscriber (for example, in an attempt to use fewer resources). Successful modification returns the subscription to the "active" state.
o 订户可以修改挂起的订阅(例如,试图使用更少的资源)。成功的修改会使订阅返回“活动”状态。
o Even without a "modify-subscription" request, a publisher may return a subscription to the "active" state when sufficient resources are again available. This is announced to the subscriber via the "subscription-resumed" subscription state change notification.
o 即使没有“修改订阅”请求,发布者也可以在再次有足够的资源可用时将订阅返回到“活动”状态。这将通过“订阅已恢复”订阅状态更改通知通知订阅方。
The "establish-subscription" RPC allows a subscriber to request the creation of a subscription.
“建立订阅”RPC允许订阅服务器请求创建订阅。
The input parameters of the operation are:
操作的输入参数为:
o A "stream" name, which identifies the targeted event stream against which the subscription is applied.
o “流”名称,用于标识应用订阅的目标事件流。
o An event stream filter, which may reduce the set of event records pushed.
o 事件流过滤器,可减少推送的事件记录集。
o If the transport used by the RPC supports multiple encodings, an optional "encoding" for the event records pushed. If no "encoding" is included, the encoding of the RPC MUST be used.
o 如果RPC使用的传输支持多个编码,则会推送事件记录的可选“编码”。如果未包含“编码”,则必须使用RPC的编码。
o An optional "stop-time" for the subscription. If no "stop-time" is present, notification messages will continue to be sent until the subscription is terminated.
o 订阅的可选“停止时间”。如果不存在“停止时间”,将继续发送通知消息,直到订阅终止。
o An optional "replay-start-time" for the subscription. The "replay-start-time" MUST be in the past and indicates that the subscription is requesting a replay of previously generated information from the event stream. For more on replay, see Section 2.4.2.1. If there is no "replay-start-time", the subscription starts immediately.
o 订阅的可选“重播开始时间”。“重播开始时间”必须在过去,并表示订阅正在请求重播事件流中先前生成的信息。有关回放的更多信息,请参见第2.4.2.1节。如果没有“重播开始时间”,订阅将立即开始。
If the publisher can satisfy the "establish-subscription" request, it replies with an identifier for the subscription and then immediately starts streaming notification messages.
如果发布服务器能够满足“建立订阅”请求,它将使用订阅的标识符进行答复,然后立即开始流式发送通知消息。
Below is a tree diagram for "establish-subscription". All objects contained in this tree are described in the YANG module in Section 4.
下面是“建立订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---x establish-subscription +---w input | +---w (target) | | +--:(stream) | | +---w (stream-filter)? | | | +--:(by-reference) | | | | +---w stream-filter-name | | | | stream-filter-ref | | | +--:(within-subscription) | | | +---w (filter-spec)? | | | +--:(stream-subtree-filter) | | | | +---w stream-subtree-filter? <anydata> | | | | {subtree}? | | | +--:(stream-xpath-filter) | | | +---w stream-xpath-filter? | | | yang:xpath1.0 {xpath}? | | +---w stream stream-ref | | +---w replay-start-time? | | yang:date-and-time {replay}? | +---w stop-time? | | yang:date-and-time | +---w dscp? inet:dscp | | {dscp}? | +---w weighting? uint8 | | {qos}? | +---w dependency? | | subscription-id {qos}? | +---w encoding? encoding +--ro output +--ro id subscription-id +--ro replay-start-time-revision? yang:date-and-time {replay}?
+---x establish-subscription +---w input | +---w (target) | | +--:(stream) | | +---w (stream-filter)? | | | +--:(by-reference) | | | | +---w stream-filter-name | | | | stream-filter-ref | | | +--:(within-subscription) | | | +---w (filter-spec)? | | | +--:(stream-subtree-filter) | | | | +---w stream-subtree-filter? <anydata> | | | | {subtree}? | | | +--:(stream-xpath-filter) | | | +---w stream-xpath-filter? | | | yang:xpath1.0 {xpath}? | | +---w stream stream-ref | | +---w replay-start-time? | | yang:date-and-time {replay}? | +---w stop-time? | | yang:date-and-time | +---w dscp? inet:dscp | | {dscp}? | +---w weighting? uint8 | | {qos}? | +---w dependency? | | subscription-id {qos}? | +---w encoding? encoding +--ro output +--ro id subscription-id +--ro replay-start-time-revision? yang:date-and-time {replay}?
Figure 2: "establish-subscription" RPC Tree Diagram
图2:“建立订阅”RPC树图
A publisher MAY reject the "establish-subscription" RPC for many reasons, as described in Section 2.4.6. The contents of the resulting RPC error response MAY include details on input parameters that, if considered in a subsequent "establish-subscription" RPC, may result in successful subscription establishment. Any such hints MUST be transported in a yang-data "establish-subscription-stream-error-info" container included in the RPC error response.
发布者可能出于多种原因拒绝“建立订阅”RPC,如第2.4.6节所述。产生的RPC错误响应的内容可以包括关于输入参数的详细信息,如果在随后的“建立订阅”RPC中考虑这些参数,则可能导致成功建立订阅。任何此类提示都必须在RPC错误响应中包含的数据“建立订阅流错误信息”容器中传输。
Below is a tree diagram for "establish-subscription-stream-error-info" RPC yang-data. All objects contained in this tree are described in the YANG module in Section 4.
下面是“建立订阅流错误信息”RPC数据的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
yang-data establish-subscription-stream-error-info +--ro establish-subscription-stream-error-info +--ro reason? identityref +--ro filter-failure-hint? string
yang-data establish-subscription-stream-error-info +--ro establish-subscription-stream-error-info +--ro reason? identityref +--ro filter-failure-hint? string
Figure 3: "establish-subscription-stream-error-info" RPC yang-data Tree Diagram
图3:“建立订阅流错误信息”RPC数据树图
Replay provides the ability to establish a subscription that is also capable of passing event records generated in the recent past. In other words, as the subscription initializes itself, it sends any event records in the target event stream that meet the filter criteria that have an event time that is after the "replay-start-time" and also have an event time before the "stop-time" should this "stop-time" exist. The end of these historical event records is identified via a "replay-completed" subscription state change notification. Any event records generated since the subscription establishment may then follow. For a particular subscription, all event records will be delivered in the order in which they are placed in the event stream.
Replay提供了建立订阅的能力,该订阅还能够传递最近生成的事件记录。换句话说,当订阅自身初始化时,它会在目标事件流中发送符合筛选条件的任何事件记录,这些事件记录的事件时间在“重播开始时间”之后,如果存在此“停止时间”,则在“停止时间”之前也有事件时间。通过“重播完成”订阅状态更改通知来标识这些历史事件记录的结束。随后可能会出现自订阅建立以来生成的任何事件记录。对于特定订阅,所有事件记录都将按照它们在事件流中的放置顺序交付。
Replay is an optional feature that is dependent on an event stream supporting some form of logging. This document puts no restrictions on the size or form of the log, where it resides in the publisher, or when event record entries in the log are purged.
Replay是一个可选功能,它依赖于支持某种形式日志记录的事件流。本文档对日志的大小或形式、日志在发布服务器中的位置或日志中的事件记录项被清除时没有任何限制。
The inclusion of a "replay-start-time" in an "establish-subscription" RPC indicates a replay request. If the "replay-start-time" contains a value that is earlier than what a publisher's retained history supports, then if the subscription is accepted, the actual publisher's revised start time MUST be set in the returned "replay-start-time-revision" object.
在“建立订阅”RPC中包含“重播开始时间”表示重播请求。如果“重播开始时间”包含的值早于发布服务器的保留历史支持的值,则如果接受订阅,则必须在返回的“重播开始时间修订”对象中设置实际发布服务器的修订开始时间。
A "stop-time" parameter may be included in a replay subscription. For a replay subscription, the "stop-time" MAY be earlier than the current time but MUST be later than the "replay-start-time".
重播订阅中可能包含“停止时间”参数。对于重播订阅,“停止时间”可能早于当前时间,但必须晚于“重播开始时间”。
If the given "replay-start-time" is later than the time marked in any event records retained in the replay buffer, then the publisher MUST send a "replay-completed" notification immediately after a successful "establish-subscription" RPC response.
如果给定的“replay开始时间”晚于replay缓冲区中保留的任何事件记录中标记的时间,则发布者必须在成功的“建立订阅”RPC响应后立即发送“replay completed”通知。
If an event stream supports replay, the "replay-support" leaf is present in the "/streams/stream" list entry for the event stream. An event stream that does support replay is not expected to have an unlimited supply of saved notifications available to accommodate any given replay request. To assess the timeframe available for replay, subscribers can read the leafs "replay-log-creation-time" and "replay-log-aged-time". See Figure 18 for the YANG tree and Section 4 for the YANG module describing these elements. The actual size of the replay log at any given time is a publisher-specific matter. Control parameters for the replay log are outside the scope of this document.
如果事件流支持重播,则事件流的“/streams/stream”列表项中会出现“重播支持”叶。不支持replay的事件流不需要无限量地提供已保存的通知来满足任何给定的replay请求。为了评估可用于重播的时间范围,订阅者可以读取LEFS“重播日志创建时间”和“重播日志过期时间”。杨树如图18所示,描述这些元素的杨氏模块如第4节所示。重播日志在任何给定时间的实际大小都是特定于发布者的问题。replay日志的控制参数超出了本文档的范围。
The "modify-subscription" operation permits changing the terms of an existing dynamic subscription. Dynamic subscriptions can be modified any number of times. Dynamic subscriptions can only be modified via this RPC using a transport session connecting to the subscriber. If the publisher accepts the requested modifications, it acknowledges success to the subscriber, then immediately starts sending event records based on the new terms.
“修改订阅”操作允许更改现有动态订阅的条款。动态订阅可以被修改任意次数。只能使用连接到订阅服务器的传输会话通过此RPC修改动态订阅。如果发布者接受请求的修改,它会向订阅者确认成功,然后立即开始根据新条款发送事件记录。
Subscriptions created by configuration cannot be modified via this RPC. However, configuration may be used to modify objects referenced by the subscription (such as a referenced filter).
无法通过此RPC修改由配置创建的订阅。但是,配置可用于修改订阅引用的对象(例如引用的筛选器)。
Below is a tree diagram for "modify-subscription". All objects contained in this tree are described in the YANG module in Section 4.
下面是“修改订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---x modify-subscription +---w input +---w id | subscription-id +---w (target) | +--:(stream) | +---w (stream-filter)? | +--:(by-reference) | | +---w stream-filter-name | | stream-filter-ref | +--:(within-subscription) | +---w (filter-spec)? | +--:(stream-subtree-filter) | | +---w stream-subtree-filter? <anydata> | | {subtree}? | +--:(stream-xpath-filter) | +---w stream-xpath-filter? | yang:xpath1.0 {xpath}? +---w stop-time? yang:date-and-time
+---x modify-subscription +---w input +---w id | subscription-id +---w (target) | +--:(stream) | +---w (stream-filter)? | +--:(by-reference) | | +---w stream-filter-name | | stream-filter-ref | +--:(within-subscription) | +---w (filter-spec)? | +--:(stream-subtree-filter) | | +---w stream-subtree-filter? <anydata> | | {subtree}? | +--:(stream-xpath-filter) | +---w stream-xpath-filter? | yang:xpath1.0 {xpath}? +---w stop-time? yang:date-and-time
Figure 4: "modify-subscription" RPC Tree Diagram
图4:“修改订阅”RPC树图
If the publisher accepts the requested modifications on a currently suspended subscription, the subscription will immediately be resumed (i.e., the modified subscription is returned to the "active" state). The publisher MAY immediately suspend this newly modified subscription through the "subscription-suspended" notification before any event records are sent.
如果发布者接受对当前挂起的订阅请求的修改,订阅将立即恢复(即,修改后的订阅将返回到“活动”状态)。在发送任何事件记录之前,发布者可以通过“subscription suspended”(订阅已暂停)通知立即暂停此新修改的订阅。
If the publisher rejects the RPC request, the subscription remains as it was prior to the request. That is, the request has no impact whatsoever. Rejection of the RPC for any reason is indicated via an RPC error as described in Section 2.4.6. The contents of such a rejected RPC MAY include hints on inputs that (if considered) may result in a successfully modified subscription. These hints MUST be transported in a yang-data "modify-subscription-stream-error-info" container inserted into the RPC error response.
如果发布服务器拒绝RPC请求,则订阅将保持在请求之前的状态。也就是说,该请求没有任何影响。如第2.4.6节所述,通过RPC错误指示因任何原因拒绝RPC。此类被拒绝的RPC的内容可能包括(如果考虑)可能导致成功修改订阅的输入提示。这些提示必须在插入RPC错误响应的数据“修改订阅流错误信息”容器中传输。
Below is a tree diagram for "modify-subscription-stream-error-info" RPC yang-data. All objects contained in this tree are described in the YANG module in Section 4.
下面是“修改订阅流错误信息”RPC数据的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
yang-data modify-subscription-stream-error-info +--ro modify-subscription-stream-error-info +--ro reason? identityref +--ro filter-failure-hint? string
yang-data modify-subscription-stream-error-info +--ro modify-subscription-stream-error-info +--ro reason? identityref +--ro filter-failure-hint? string
Figure 5: "modify-subscription-stream-error-info" RPC yang-data Tree Diagram
图5:“修改订阅流错误信息”RPC数据树图
The "delete-subscription" operation permits canceling an existing subscription. If the publisher accepts the request and the publisher has indicated success, the publisher MUST NOT send any more notification messages for this subscription.
“删除订阅”操作允许取消现有订阅。如果发布者接受该请求,并且发布者已指示成功,则发布者不得再为此订阅发送任何通知消息。
Below is a tree diagram for "delete-subscription". All objects contained in this tree are described in the YANG module in Section 4.
下面是“删除订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---x delete-subscription +---w input +---w id subscription-id
+---x delete-subscription +---w input +---w id subscription-id
Figure 6: "delete-subscription" RPC Tree Diagram
图6:“删除订阅”RPC树图
Dynamic subscriptions can only be deleted via this RPC using a transport session connecting to the subscriber. Configured subscriptions cannot be deleted using RPCs.
只能使用连接到订阅服务器的传输会话通过此RPC删除动态订阅。无法使用RPC删除已配置的订阅。
The "kill-subscription" operation permits an operator to end a dynamic subscription that is not associated with the transport session used for the RPC. A publisher MUST terminate any dynamic subscription identified by the "id" parameter in the RPC request, if such a subscription exists.
“终止订阅”操作允许操作员结束与RPC使用的传输会话不关联的动态订阅。如果存在由RPC请求中的“id”参数标识的任何动态订阅,则发布者必须终止该订阅。
Configured subscriptions cannot be killed using this RPC. Instead, configured subscriptions are deleted as part of regular configuration operations. Publishers MUST reject any RPC attempt to kill a configured subscription.
无法使用此RPC终止已配置的订阅。相反,作为常规配置操作的一部分,已配置的订阅将被删除。发布者必须拒绝任何试图终止已配置订阅的RPC尝试。
Below is a tree diagram for "kill-subscription". All objects contained in this tree are described in the YANG module in Section 4.
下面是“终止订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---x kill-subscription +---w input +---w id subscription-id
+---x kill-subscription +---w input +---w id subscription-id
Figure 7: "kill-subscription" RPC Tree Diagram
图7:“终止订阅”RPC树图
Whenever an RPC is unsuccessful, the publisher returns relevant information as part of the RPC error response. Transport-level error processing MUST be done before the RPC error processing described in this section. In all cases, RPC error information returned by the publisher will use existing transport-layer RPC structures, such as those seen with NETCONF (Appendix A of [RFC6241]) or RESTCONF (Section 7.1 of [RFC8040]). These structures MUST be able to encode subscription-specific errors identified below and defined in this document's YANG data model.
每当RPC失败时,发布者将返回相关信息作为RPC错误响应的一部分。传输级错误处理必须在本节中描述的RPC错误处理之前完成。在所有情况下,发布者返回的RPC错误信息都将使用现有的传输层RPC结构,如NETCONF(RFC6241的附录A)或RESTCONF(RFC8040的第7.1节)中的结构。这些结构必须能够编码以下识别的订阅特定错误,并在本文档的数据模型中定义。
As a result of this variety, how subscription errors are encoded in an RPC error response is transport dependent. Valid errors that can occur for each RPC are as follows:
由于这种多样性,订阅错误在RPC错误响应中的编码方式取决于传输。每个RPC可能发生的有效错误如下所示:
establish-subscription modify-subscription ---------------------- ---------------------- dscp-unavailable filter-unsupported encoding-unsupported insufficient-resources filter-unsupported no-such-subscription insufficient-resources replay-unsupported
establish-subscription modify-subscription ---------------------- ---------------------- dscp-unavailable filter-unsupported encoding-unsupported insufficient-resources filter-unsupported no-such-subscription insufficient-resources replay-unsupported
delete-subscription kill-subscription ---------------------- ---------------------- no-such-subscription no-such-subscription
delete-subscription kill-subscription ---------------------- ---------------------- no-such-subscription no-such-subscription
To see a NETCONF-based example of an error response from the list above, see the "no-such-subscription" error response illustrated in [RFC8640], Figure 10.
要查看上面列表中基于NETCONF的错误响应示例,请参见[RFC8640]中所示的“无此类订阅”错误响应,图10。
There is one final set of transport-independent RPC error elements included in the YANG data model defined in this document: three yang-data structures that enable the publisher to provide to the receiver any error information that does not fit into existing transport-layer RPC structures. These structures are:
本文档中定义的YANG数据模型中包含了最后一组与传输无关的RPC错误元素:三个YANG数据结构,使发布者能够向接收方提供任何不适合现有传输层RPC结构的错误信息。这些结构是:
1. "establish-subscription-stream-error-info": This MUST be returned with the leaf "reason" populated if an RPC error reason has not been placed elsewhere in the transport portion of a failed "establish-subscription" RPC response. This MUST be sent if hints on how to overcome the RPC error are included.
1. “建立订阅流错误信息”:如果未在失败的“建立订阅”RPC响应的传输部分的其他位置放置RPC错误原因,则必须返回此信息并填充叶“原因”。如果包含关于如何克服RPC错误的提示,则必须发送此消息。
2. "modify-subscription-stream-error-info": This MUST be returned with the leaf "reason" populated if an RPC error reason has not been placed elsewhere in the transport portion of a failed "modify-subscription" RPC response. This MUST be sent if hints on how to overcome the RPC error are included.
2. “修改订阅流错误信息”:如果未在失败的“修改订阅”RPC响应的传输部分的其他位置放置RPC错误原因,则必须返回此消息并填充叶“原因”。如果包含关于如何克服RPC错误的提示,则必须发送此消息。
3. "delete-subscription-error-info": This MUST be returned with the leaf "reason" populated if an RPC error reason has not been placed elsewhere in the transport portion of a failed "delete-subscription" or "kill-subscription" RPC response.
3. “删除订阅错误信息”:如果RPC错误原因未放置在失败的“删除订阅”或“终止订阅”RPC响应的传输部分的其他位置,则必须返回此信息并填充叶“原因”。
A configured subscription is a subscription installed via configuration. Configured subscriptions may be modified by any configuration client with the proper permissions. Subscriptions can be modified or terminated via configuration at any point during their lifetime. Multiple configured subscriptions MUST be supportable over a single transport session.
配置的订阅是通过配置安装的订阅。任何具有适当权限的配置客户端都可以修改配置的订阅。订阅可以在其生命周期内的任何时间点通过配置进行修改或终止。在单个传输会话上必须支持多个配置的订阅。
Configured subscriptions have several characteristics distinguishing them from dynamic subscriptions:
配置的订阅有几个不同于动态订阅的特征:
o persistence across publisher reboots,
o 跨发布服务器重新启动的持久性,
o persistence even when transport is unavailable, and
o 即使在传输不可用的情况下仍保持,以及
o an ability to send notification messages to more than one receiver. (Note that receivers are unaware of the existence of any other receivers.)
o 向多个接收者发送通知消息的能力。(请注意,接收者不知道任何其他接收者的存在。)
On the publisher, support for configured subscriptions is optional and advertised using the "configured" feature. On a receiver of a configured subscription, support for dynamic subscriptions is optional. However, if replaying missed event records is required for
在发布服务器上,对已配置订阅的支持是可选的,并使用“已配置”功能发布。在已配置订阅的接收器上,对动态订阅的支持是可选的。但是,如果需要重放丢失的事件记录
a configured subscription, support for dynamic subscription is highly recommended. In this case, a separate dynamic subscription can be established to retransmit the missing event records.
对于已配置的订阅,强烈建议支持动态订阅。在这种情况下,可以建立单独的动态订阅来重新传输丢失的事件记录。
In addition to the subscription parameters available to dynamic subscriptions as described in Section 2.4.2, the following additional parameters are also available to configured subscriptions:
除了第2.4.2节中描述的可用于动态订阅的订阅参数外,以下附加参数也可用于已配置的订阅:
o A "transport", which identifies the transport protocol to use to connect with all subscription receivers.
o “传输”,标识用于连接所有订阅接收器的传输协议。
o One or more receivers, each intended as the destination for event records. Note that each individual receiver is identifiable by its "name".
o 一个或多个接收器,每个接收器都计划作为事件记录的目的地。请注意,每个接收者都可以通过其“名称”进行识别。
o Optional parameters to identify where traffic should egress a publisher:
o 用于标识流量应该从发布服务器的出口位置的可选参数:
* A "source-interface", which identifies the egress interface to use from the publisher. Publisher support for this parameter is optional and advertised using the "interface-designation" feature.
* “源接口”,用于标识要从发布服务器使用的出口接口。发布者对此参数的支持是可选的,并使用“接口指定”功能公布。
* A "source-address" address, which identifies the IP address to stamp on notification messages destined for the receiver.
* 一个“源地址”地址,用于标识发送给接收方的通知消息上要标记的IP地址。
* A "source-vrf", which identifies the Virtual Routing and Forwarding (VRF) instance on which to reach receivers. This VRF is a network instance as defined in [RFC8529]. Publisher support for VRFs is optional and advertised using the "supports-vrf" feature.
* 一个“源vrf”,用于标识要到达接收器的虚拟路由和转发(vrf)实例。此VRF是[RFC8529]中定义的网络实例。发行商对vrf的支持是可选的,并使用“支持vrf”功能进行宣传。
If none of the above parameters are set, notification messages MUST egress the publisher's default interface.
如果未设置上述任何参数,则通知消息必须退出发布者的默认界面。
A tree diagram that includes these parameters is provided in Figure 20 in Section 3.3. These parameters are described in the YANG module in Section 4.
第3.3节图20提供了包含这些参数的树形图。这些参数在第4节的YANG模块中进行了描述。
Below is the state machine for a configured subscription on the publisher. This state machine describes the three states ("valid", "invalid", and "concluded") as well as the transitions between these states. Start and end states are depicted to reflect configured subscription creation and deletion events. The creation or modification of a configured subscription initiates an evaluation by the publisher to determine if the subscription is in the
下面是发布服务器上已配置订阅的状态机。此状态机描述三种状态(“有效”、“无效”和“已结束”)以及这些状态之间的转换。开始和结束状态被描述为反映配置的订阅创建和删除事件。创建或修改已配置的订阅将启动发布服务器的评估,以确定订阅是否处于可用状态
"valid" state or the "invalid" state. The publisher uses its own criteria in making this determination. If in the "valid" state, the subscription becomes operational. See (1) in the diagram below.
“有效”状态或“无效”状态。出版商使用其自己的标准进行此确定。如果处于“有效”状态,订阅将开始运行。见下图中的(1)。
......... : start :-. :.......: | create .---modify-----.----------------------------------. | | | | V V .-------. ....... .---------. .----[evaluate]--no--->|invalid|-delete->: end :<-delete-|concluded| | '-------' :.....: '---------' |-[evaluate]--no-(2). ^ ^ ^ | ^ | | | | yes | '->unsupportable delete stop-time | modify (subscription- (subscription- (subscription- | | terminated*) terminated*) concluded*) | | | | | (1) | (3) (4) (5) | .---------------------------------------------------------------. '-->| valid | '---------------------------------------------------------------'
......... : start :-. :.......: | create .---modify-----.----------------------------------. | | | | V V .-------. ....... .---------. .----[evaluate]--no--->|invalid|-delete->: end :<-delete-|concluded| | '-------' :.....: '---------' |-[evaluate]--no-(2). ^ ^ ^ | ^ | | | | yes | '->unsupportable delete stop-time | modify (subscription- (subscription- (subscription- | | terminated*) terminated*) concluded*) | | | | | (1) | (3) (4) (5) | .---------------------------------------------------------------. '-->| valid | '---------------------------------------------------------------'
Legend: Dotted boxes: subscription added or removed via configuration Dashed boxes: states for a subscription [evaluate]: decision point on whether the subscription is supportable (*): resulting subscription state change notification
图例:虚线框:通过配置添加或删除的订阅虚线框:订阅状态[评估]:关于订阅是否可支持的决策点(*):生成的订阅状态更改通知
Figure 8: Publisher's State Machine for a Configured Subscription
图8:已配置订阅的发布服务器状态机
A subscription in the "valid" state may move to the "invalid" state in one of two ways. First, it may be modified in a way that fails a re-evaluation. See (2) in the diagram. Second, the publisher might determine that the subscription is no longer supportable. This could be because of an unexpected but sustained increase in an event stream's event records, degraded CPU capacity, a more complex referenced filter, or other subscriptions that have usurped resources. See (3) in the diagram. No matter the case, a "subscription-terminated" notification is sent to any receivers in the "active" or "suspended" state. A subscription in the "valid" state may also transition to the "concluded" state via (5) if a configured stop time has been reached. In this case, a "subscription-concluded" notification is sent to any receivers in the "active" or "suspended" state. Finally, a subscription may be deleted by configuration (4).
处于“有效”状态的订阅可以通过以下两种方式之一移动到“无效”状态。首先,可能会以无法重新评估的方式对其进行修改。参见图中的(2)。其次,发布者可能会确定订阅不再受支持。这可能是因为事件流的事件记录意外但持续增加、CPU容量降低、引用的筛选器更复杂或其他已占用资源的订阅。参见图中的(3)。无论何种情况,都会向处于“活动”或“暂停”状态的任何接收者发送“订阅终止”通知。如果达到配置的停止时间,处于“有效”状态的订阅也可以通过(5)转换到“结束”状态。在这种情况下,向处于“活动”或“暂停”状态的任何接收者发送“订阅结束”通知。最后,可以通过配置(4)删除订阅。
When a subscription is in the "valid" state, a publisher will attempt to connect with all receivers of a configured subscription and deliver notification messages. Below is the state machine for each receiver of a configured subscription. This receiver state machine is fully contained in the state machine of the configured subscription and is only relevant when the configured subscription is in the "valid" state.
当订阅处于“有效”状态时,发布者将尝试与已配置订阅的所有接收器连接,并传递通知消息。下面是已配置订阅的每个接收器的状态机。此接收器状态机完全包含在已配置订阅的状态机中,并且仅当已配置订阅处于“有效”状态时才相关。
.-----------------------------------------------------------------. | valid | | .----------. .------------. | | | receiver |---timeout---------------->| receiver | | | |connecting|<----------------reset--(c)|disconnected| | | | |<-transport '------------' | | '----------' loss,reset------------------------------. | | (a) | | | | subscription- (b) (b) | | started* .--------. .---------. | | '----->| |(d)-insufficient CPU,------->| | | | |receiver| buffer overflow |receiver | | | subscription-| active | |suspended| | | modified* | |<----CPU, b/w sufficient,-(e)| | | | '---->'--------' subscription-modified* '---------' | '-----------------------------------------------------------------'
.-----------------------------------------------------------------. | valid | | .----------. .------------. | | | receiver |---timeout---------------->| receiver | | | |connecting|<----------------reset--(c)|disconnected| | | | |<-transport '------------' | | '----------' loss,reset------------------------------. | | (a) | | | | subscription- (b) (b) | | started* .--------. .---------. | | '----->| |(d)-insufficient CPU,------->| | | | |receiver| buffer overflow |receiver | | | subscription-| active | |suspended| | | modified* | |<----CPU, b/w sufficient,-(e)| | | | '---->'--------' subscription-modified* '---------' | '-----------------------------------------------------------------'
Legend: Dashed boxes that include the word "receiver" show the possible states for an individual receiver of a valid configured subscription.
图例:包含单词“receiver”的虚线框显示有效配置订阅的单个接收器的可能状态。
* indicates a subscription state change notification
* 指示订阅状态更改通知
Figure 9: Receiver State Machine for a Configured Subscription on a Publisher
图9:发布服务器上已配置订阅的接收器状态机
When a configured subscription first moves to the "valid" state, the "state" leaf of each receiver is initialized to the "connecting" state. If transport connectivity is not available to any receivers and there are any notification messages to deliver, a transport session is established (e.g., per [RFC8071]). Individual receivers are moved to the "active" state when a "subscription-started" subscription state change notification is successfully passed to that receiver (a). Event records are only sent to active receivers. Receivers of a configured subscription remain active on the publisher if both (1) transport connectivity to the receiver is active and (2) event records are not being dropped due to a publisher's sending capacity being reached. In addition, a configured subscription's receiver MUST be moved to the "connecting" state if the receiver is
当配置的订阅第一次移动到“有效”状态时,每个接收器的“状态”叶被初始化为“连接”状态。如果传输连接对任何接收器都不可用,并且有任何通知消息要传递,则建立传输会话(例如,根据[RFC8071])。当“订阅已启动”订阅状态更改通知成功传递给单个接收器(a)时,单个接收器将移动到“活动”状态。事件记录仅发送给活动接收器。如果(1)到接收器的传输连接处于活动状态,并且(2)由于达到发布服务器的发送容量而未删除事件记录,则已配置订阅的接收器在发布服务器上保持活动状态。此外,如果已配置订阅的接收器处于“连接”状态,则必须将其移动到“连接”状态
reset via the "reset" action (b), (c). For more on the "reset" action, see Section 2.5.5. If transport connectivity cannot be achieved while in the "connecting" state, the receiver MAY be moved to the "disconnected" state.
通过“复位”动作(b)、(c)复位。有关“重置”操作的更多信息,请参见第2.5.5节。如果在“连接”状态下无法实现传输连接,则接收器可能会移动到“断开”状态。
A configured subscription's receiver MUST be moved to the "suspended" state if there is transport connectivity between the publisher and receiver but (1) delivery of notification messages is failing due to a publisher's buffer capacity being reached or (2) notification messages cannot be generated for that receiver due to insufficient CPU (d). This is indicated to the receiver by the "subscription-suspended" subscription state change notification.
如果发布服务器和接收器之间存在传输连接,但(1)由于达到发布服务器的缓冲区容量而无法传递通知消息,或者(2)由于CPU(d)不足而无法为该接收器生成通知消息,则必须将已配置订阅的接收器移动到“挂起”状态。这通过“订阅已暂停”订阅状态更改通知向接收方指示。
A configured subscription's receiver MUST be returned to the "active" state from the "suspended" state when notification messages can be generated, bandwidth is sufficient to handle the notification messages, and a receiver has successfully been sent a "subscription-resumed" or "subscription-modified" subscription state change notification (e). The choice as to which of these two subscription state change notifications is sent is determined by whether the subscription was modified during the period of suspension.
当可以生成通知消息,带宽足以处理通知消息,并且已成功向接收器发送“订阅恢复”或“订阅修改”订阅状态更改通知(e)时,已配置订阅的接收器必须从“暂停”状态返回到“活动”状态。选择发送这两个订阅状态更改通知中的哪一个,取决于在暂停期间是否修改了订阅。
Modification of a configured subscription is possible at any time. A "subscription-modified" subscription state change notification will be sent to all active receivers, immediately followed by notification messages conforming to the new parameters. Suspended receivers will also be informed of the modification. However, this notification will await the end of the suspension for that receiver (e).
可以随时修改已配置的订阅。“订阅已修改”订阅状态更改通知将发送给所有活动接收器,紧接着是符合新参数的通知消息。暂停接收的接收器也将被告知修改。然而,该通知将等待该接收者(e)的暂停结束。
The mechanisms described above are mirrored in the RPCs and notifications defined in this document. It should be noted that these RPCs and notifications have been designed to be extensible and allow subscriptions into targets other than event streams. For instance, the YANG module defined in Section 5 of [RFC8641] augments "/sn:modify-subscription/sn:input/sn:target".
上述机制反映在本文档中定义的RPC和通知中。应该注意的是,这些RPC和通知被设计为可扩展的,并允许订阅到事件流以外的目标。例如,[RFC8641]第5节中定义的YANG模块增加了“/sn:modify subscription/sn:input/sn:target”。
Configured subscriptions are established using configuration operations against the top-level "subscriptions" subtree.
配置的订阅是通过对顶级“订阅”子树的配置操作建立的。
Because there is no explicit association with an existing transport session, configuration operations MUST include additional parameters beyond those of dynamic subscriptions. These parameters identify each receiver, how to connect with that receiver, and possibly whether the notification messages need to come from a specific egress
由于与现有传输会话没有显式关联,因此配置操作必须包括动态订阅以外的其他参数。这些参数标识每个接收器、如何与该接收器连接,以及通知消息是否需要来自特定出口
interface on the publisher. Receiver-specific transport connectivity parameters MUST be configured via transport-specific augmentations to this specification. See Section 2.5.7 for details.
发布服务器上的接口。特定于接收器的传输连接参数必须通过对本规范的特定于传输的扩展进行配置。详见第2.5.7节。
After a subscription is successfully established, the publisher immediately sends a "subscription-started" subscription state change notification to each receiver. It is quite possible that upon configuration, reboot, or even steady-state operations, a transport session may not be currently available to the receiver. In this case, when there is something to transport for an active subscription, transport-specific "call home" operations [RFC8071] will be used to establish the connection. When transport connectivity is available, notification messages may then be pushed.
成功建立订阅后,发布者立即向每个接收者发送“订阅已启动”订阅状态更改通知。很可能在配置、重新启动或甚至稳态操作时,传输会话当前可能不可用于接收器。在这种情况下,当活动订阅需要传输某些内容时,将使用特定于传输的“呼叫总部”操作[RFC8071]来建立连接。当传输连接可用时,可以推送通知消息。
With active configured subscriptions, it is allowable to buffer event records even after a "subscription-started" has been sent. However, if events are lost (rather than just delayed) due to replay buffer capacity being reached, a new "subscription-started" must be sent. This new "subscription-started" indicates an event record discontinuity.
对于活动配置的订阅,即使在发送“订阅已启动”后,也允许缓冲事件记录。但是,如果由于达到重播缓冲区容量而导致事件丢失(而不仅仅是延迟),则必须发送新的“订阅已启动”。此新“订阅已启动”表示事件记录不连续。
To see an example of subscription creation using configuration operations over NETCONF, see Appendix A.
要查看使用NETCONF上的配置操作创建订阅的示例,请参阅附录A。
Configured subscriptions can be modified using configuration operations against the top-level "subscriptions" subtree.
可以对顶级“订阅”子树使用配置操作修改配置的订阅。
If the modification involves adding receivers, added receivers are placed in the "connecting" state. If a receiver is removed, the subscription state change notification "subscription-terminated" is sent to that receiver if that receiver is active or suspended.
如果修改涉及添加接收器,则添加的接收器将处于“连接”状态。如果删除了某个接收器,则如果该接收器处于活动或挂起状态,将向该接收器发送订阅状态更改通知“订阅已终止”。
If the modification involves changing the policies for the subscription, the publisher sends to currently active receivers a "subscription-modified" notification. For any suspended receivers, a "subscription-modified" notification will be delayed until the receiver's subscription has been resumed. (Note: In this case, the "subscription-modified" notification informs the receiver that the subscription has been resumed, so no additional "subscription-resumed" need be sent. Also note that if multiple modifications have occurred during the suspension, only the "subscription-modified" notification describing the latest one need be sent to the receiver.)
如果修改涉及更改订阅的策略,则发布者将向当前活动的接收者发送“订阅已修改”通知。对于任何暂停的接收者,“订阅已修改”通知将延迟,直到接收者的订阅已恢复。(注意:在这种情况下,“订阅已修改”通知通知接收者订阅已恢复,因此无需发送额外的“订阅已恢复”。还请注意,如果在暂停期间发生多个修改,则只有“订阅已修改”需要向接收方发送描述最新版本的通知。)
Subscriptions can be deleted through configuration against the top-level "subscriptions" subtree.
可以通过配置顶级“订阅”子树来删除订阅。
Immediately after a subscription is successfully deleted, the publisher sends to all receivers of that subscription a subscription state change notification stating that the subscription has ended (i.e., "subscription-terminated").
成功删除订阅后,发布者立即向该订阅的所有接收者发送订阅状态更改通知,说明订阅已结束(即“订阅已终止”)。
It is possible that a configured subscription to a receiver needs to be reset. This is accomplished via the "reset" action in the YANG module at "/subscriptions/subscription/receivers/receiver/reset". This action may be useful in cases where a publisher has timed out trying to reach a receiver. When such a reset occurs, a transport session will be initiated if necessary, and a new "subscription-started" notification will be sent. This action does not have any effect on transport connectivity if the needed connectivity already exists.
可能需要重置对接收器的已配置订阅。这是通过“订阅/订阅/接收者/接收者/重置”处的YANG模块中的“重置”操作完成的。在发布者试图联系接收者时超时的情况下,此操作可能很有用。发生此类重置时,将在必要时启动传输会话,并发送新的“订阅已启动”通知。如果所需的连接已存在,则此操作不会对传输连接产生任何影响。
It is possible to do replay on a configured subscription. This is supported via the configuration of the "configured-replay" object on the subscription. The setting of this object enables the streaming of the buffered event records for the subscribed event stream. All buffered event records that have been retained since the last publisher restart will be sent to each configured receiver.
可以对已配置的订阅执行重播。通过在订阅上配置“已配置的replay”对象来支持这一点。此对象的设置启用订阅事件流的缓冲事件记录流。自上次发布服务器重新启动以来保留的所有缓冲事件记录都将发送到每个已配置的接收器。
Replay of event records created since restart is useful. It allows event records generated before transport connectivity establishment to be passed to a receiver. Setting the restart time as the earliest configured replay time precludes the possibility of resending event records that were logged prior to publisher restart. It also ensures that the same records will be sent to each configured receiver, regardless of the speed of transport connectivity establishment to each receiver. Finally, by establishing restart as the earliest potential time for event records to be included in notification messages, a well-understood timeframe for replay is defined.
重新启动后创建的事件记录的重播非常有用。它允许将在建立传输连接之前生成的事件记录传递给接收器。将重新启动时间设置为最早配置的重播时间将排除重新发送发布服务器重新启动之前记录的事件记录的可能性。它还确保将相同的记录发送到每个已配置的接收器,而不管到每个接收器的传输连接建立速度如何。最后,通过将重新启动确定为事件记录包含在通知消息中的最早可能时间,定义了一个易于理解的重播时间框架。
As a result, when any configured subscription's receivers become active, buffered event records will be sent immediately after the "subscription-started" notification. If the publisher knows the last event record sent to a receiver and the publisher has not rebooted, the next event record on the event stream that meets filtering criteria will be the leading event record sent. Otherwise, the
因此,当任何已配置订阅的接收器处于活动状态时,缓冲事件记录将在“订阅已启动”通知后立即发送。如果发布服务器知道发送给接收器的最后一条事件记录,并且发布服务器尚未重新启动,则事件流上符合筛选条件的下一条事件记录将是发送的前导事件记录。否则
leading event record will be the first event record meeting filtering criteria subsequent to the latest of three different times: the "replay-log-creation-time", the "replay-log-aged-time", or the most recent publisher boot time. The "replay-log-creation-time" and "replay-log-aged-time" are discussed in Section 2.4.2.1. The most recent publisher boot time ensures that duplicate event records are not replayed from a previous time the publisher was booted.
前导事件记录将是符合筛选条件的第一个事件记录,位于三个不同时间的最新时间之后:“重播日志创建时间”、“重播日志过期时间”或最近的发布服务器启动时间。第2.4.2.1节讨论了“回放日志创建时间”和“回放日志老化时间”。最近的发布服务器启动时间可确保不会重放上次启动发布服务器时的重复事件记录。
It is quite possible that a receiver might want to retrieve event records from an event stream prior to the latest boot. If such records exist where there is a configured replay, the publisher MUST send the time of the event record immediately preceding the "replay-start-time" in the "replay-previous-event-time" leaf. Through the existence of the "replay-previous-event-time", the receiver will know that earlier events prior to reboot exist. In addition, if the subscriber was previously receiving event records with the same subscription "id", the receiver can determine if there was a time gap where records generated on the publisher were not successfully received. And with this information, the receiver may choose to dynamically subscribe to retrieve any event records placed in the event stream before the most recent boot time.
很可能在最近一次引导之前,接收器可能希望从事件流中检索事件记录。如果在配置了重播的情况下存在此类记录,则发布者必须在“重播以前的事件时间”叶中的“重播开始时间”之前发送事件记录的时间。通过“replay previous event time”(回放先前事件时间)的存在,接收器将知道在重新启动之前存在较早的事件。此外,如果订阅服务器以前接收到具有相同订阅“id”的事件记录,则接收方可以确定在发布服务器上生成的记录未成功接收的时间间隔是否存在。并且利用该信息,接收器可以选择动态订阅以检索在最近引导时间之前放置在事件流中的任何事件记录。
All other replay functionality remains the same as with dynamic subscriptions as described in Section 2.4.2.1.
所有其他重播功能与第2.4.2.1节所述的动态订阅功能相同。
This specification is transport independent. However, supporting a configured subscription will often require the establishment of transport connectivity. And the parameters used for this transport connectivity establishment are transport specific. As a result, the YANG module defined in Section 4 is not able to directly define and expose these transport parameters.
本规范与传输无关。但是,支持配置的订阅通常需要建立传输连接。用于此传输连接建立的参数是特定于传输的。因此,第4节中定义的YANG模块无法直接定义和公开这些传输参数。
It is necessary for an implementation to support the connection establishment process. To support this function, the YANG data model defined in this document includes a node where transport-specific parameters for a particular receiver may be augmented. This node is "/subscriptions/subscription/receivers/receiver". By augmenting transport parameters from this node, system developers are able to incorporate the YANG objects necessary to support the transport connectivity establishment process.
实现需要支持连接建立过程。为了支持此功能,本文档中定义的YANG数据模型包括一个节点,其中特定接收器的传输特定参数可以被增加。此节点为“/subscriptions/subscription/receivers/receiver”。通过增加该节点的传输参数,系统开发人员能够合并支持传输连接建立过程所需的对象。
The result of this is the following requirement. A publisher supporting the feature "configured" MUST also support at least one YANG data model that augments transport connectivity parameters on "/subscriptions/subscription/receivers/receiver". For an example of such an augmentation, see Appendix A.
其结果是满足以下要求。支持“已配置”功能的发布服务器还必须至少支持一种数据模型,以增强“/subscriptions/subscription/receivers/receivers”上的传输连接参数。有关此类增强的示例,请参见附录A。
Whether dynamic or configured, once a subscription has been set up, the publisher streams event records via notification messages per the terms of the subscription. For dynamic subscriptions, notification messages are sent over the session used to establish the subscription. For configured subscriptions, notification messages are sent over the connections specified by the transport and each receiver of a configured subscription.
无论是动态的还是配置的,一旦设置了订阅,发布服务器将根据订阅条款通过通知消息流式传输事件记录。对于动态订阅,通过用于建立订阅的会话发送通知消息。对于已配置的订阅,通知消息通过已配置订阅的传输和每个接收器指定的连接发送。
A notification message is sent to a receiver when an event record is not blocked by either the specified filter criteria or receiver permissions. This notification message MUST include an <eventTime> object, as shown in [RFC5277], Section 4. This <eventTime> MUST be at the top level of a YANG structured event record.
当事件记录未被指定的筛选条件或接收者权限阻止时,将向接收者发送通知消息。此通知消息必须包含<eventTime>对象,如[RFC5277]第4节所示。此<eventTime>必须位于结构化事件记录的顶层。
The following example of XML [W3C.REC-xml-20081126], adapted from Section 4.2.10 of [RFC7950], illustrates a compliant message:
根据[RFC7950]第4.2.10节改编的以下XML示例[W3C.REC-XML-20081126]说明了一条符合要求的消息:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2007-09-01T10:00:00Z</eventTime> <link-failure xmlns="https://acme.example.com/system"> <if-name>so-1/2/3.0</if-name> <if-admin-status>up</if-admin-status> <if-oper-status>down</if-oper-status> </link-failure> </notification>
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2007-09-01T10:00:00Z</eventTime> <link-failure xmlns="https://acme.example.com/system"> <if-name>so-1/2/3.0</if-name> <if-admin-status>up</if-admin-status> <if-oper-status>down</if-oper-status> </link-failure> </notification>
Figure 10: Subscribed Notification Message
图10:订阅的通知消息
[RFC5277], Section 2.2.1 states that a notification message is to be sent to a subscriber that initiated a <create-subscription>. With this document, this statement from [RFC5277] should be more broadly interpreted to mean that notification messages can also be sent to a subscriber that initiated an "establish-subscription" or to a configured receiver that has been sent a "subscription-started".
[RFC5277],第2.2.1节规定将向发起<创建订阅>的订户发送通知消息。在本文档中,[RFC5277]中的这一陈述应该被更广泛地解释为,通知消息也可以发送给发起“建立订阅”的订阅者,或者发送给已发送“订阅已启动”的已配置接收器。
When a dynamic subscription has been started or modified with "establish-subscription" or "modify-subscription", respectively, event records matching the newly applied filter criteria MUST NOT be sent until after the RPC reply has been sent.
当分别使用“建立订阅”或“修改订阅”启动或修改动态订阅时,在发送RPC回复之前,不得发送与新应用的筛选条件匹配的事件记录。
When a configured subscription has been started or modified, event records matching the newly applied filter criteria MUST NOT be sent until after the "subscription-started" or "subscription-modified" notification has been sent, respectively.
启动或修改配置的订阅后,在分别发送“订阅已启动”或“订阅已修改”通知之前,不得发送与新应用的筛选条件匹配的事件记录。
In addition to sending event records to receivers, a publisher MUST also send subscription state change notifications when events related to subscription management have occurred.
除了向接收者发送事件记录外,发布者还必须在发生与订阅管理相关的事件时发送订阅状态更改通知。
Subscription state change notifications are unlike other notifications in that they are never included in any event stream. Instead, they are inserted (as defined in this section) into the sequence of notification messages sent to a particular receiver. Subscription state change notifications cannot be dropped or filtered out, they cannot be stored in replay buffers, and they are delivered only to impacted receivers of a subscription. The identification of subscription state change notifications is easy to separate from other notification messages through the use of the YANG extension "subscription-state-notif". This extension tags a notification as a subscription state change notification.
订阅状态更改通知与其他通知不同,因为它们从不包含在任何事件流中。相反,它们被插入(如本节所定义)到发送给特定接收者的通知消息序列中。无法删除或过滤订阅状态更改通知,它们不能存储在重播缓冲区中,并且只能传递给受影响的订阅接收者。通过使用扩展名“subscription state notif”,订阅状态更改通知的标识很容易与其他通知消息分离。此扩展将通知标记为订阅状态更改通知。
The complete set of subscription state change notifications is described in the following subsections.
以下小节介绍了一整套订阅状态更改通知。
This notification indicates that a configured subscription has started, and event records may be sent. Included in this subscription state change notification are all the parameters of the subscription, except for (1) transport connection information for one or more receivers and (2) origin information indicating where notification messages will egress the publisher. Note that if a referenced filter from the "filters" container has been used in the subscription, the notification still provides the contents of that referenced filter under the "within-subscription" subtree.
此通知表示已启动配置的订阅,并且可能会发送事件记录。此订阅状态更改通知中包括订阅的所有参数,但(1)一个或多个接收器的传输连接信息和(2)指示通知消息将从发布服务器传出的位置的来源信息除外。请注意,如果订阅中使用了“过滤器”容器中的引用过滤器,则通知仍会在“订阅内”子树下提供该引用过滤器的内容。
Note that for dynamic subscriptions, no "subscription-started" notifications are ever sent.
请注意,对于动态订阅,不会发送“订阅已启动”通知。
Below is a tree diagram for "subscription-started". All objects contained in this tree are described in the YANG module in Section 4.
下面是“订阅已启动”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n subscription-started {configured}? +--ro id | subscription-id +--ro (target) | +--:(stream) | +--ro (stream-filter)? | | +--:(by-reference) | | | +--ro stream-filter-name | | | stream-filter-ref | | +--:(within-subscription) | | +--ro (filter-spec)? | | +--:(stream-subtree-filter) | | | +--ro stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--ro stream-xpath-filter? yang:xpath1.0 | | {xpath}? | +--ro stream stream-ref | +--ro replay-start-time? | | yang:date-and-time {replay}? | +--ro replay-previous-event-time? | yang:date-and-time {replay}? +--ro stop-time? | yang:date-and-time +--ro dscp? inet:dscp | {dscp}? +--ro weighting? uint8 {qos}? +--ro dependency? | subscription-id {qos}? +--ro transport? transport | {configured}? +--ro encoding? encoding +--ro purpose? string {configured}?
+---n subscription-started {configured}? +--ro id | subscription-id +--ro (target) | +--:(stream) | +--ro (stream-filter)? | | +--:(by-reference) | | | +--ro stream-filter-name | | | stream-filter-ref | | +--:(within-subscription) | | +--ro (filter-spec)? | | +--:(stream-subtree-filter) | | | +--ro stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--ro stream-xpath-filter? yang:xpath1.0 | | {xpath}? | +--ro stream stream-ref | +--ro replay-start-time? | | yang:date-and-time {replay}? | +--ro replay-previous-event-time? | yang:date-and-time {replay}? +--ro stop-time? | yang:date-and-time +--ro dscp? inet:dscp | {dscp}? +--ro weighting? uint8 {qos}? +--ro dependency? | subscription-id {qos}? +--ro transport? transport | {configured}? +--ro encoding? encoding +--ro purpose? string {configured}?
Figure 11: "subscription-started" Notification Tree Diagram
图11:“订阅已启动”通知树图
This notification indicates that a subscription has been modified by configuration operations. It is delivered directly after the last event records processed using the previous subscription parameters, and before any event records processed after the modification.
此通知表示订阅已被配置操作修改。它直接在使用以前的订阅参数处理的最后一个事件记录之后,以及在修改后处理的任何事件记录之前传递。
Below is a tree diagram for "subscription-modified". All objects contained in this tree are described in the YANG module in Section 4.
下面是“订阅已修改”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n subscription-modified +--ro id | subscription-id +--ro (target) | +--:(stream) | +--ro (stream-filter)? | | +--:(by-reference) | | | +--ro stream-filter-name | | | stream-filter-ref | | +--:(within-subscription) | | +--ro (filter-spec)? | | +--:(stream-subtree-filter) | | | +--ro stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--ro stream-xpath-filter? yang:xpath1.0 | | {xpath}? | +--ro stream stream-ref | +--ro replay-start-time? | yang:date-and-time {replay}? +--ro stop-time? | yang:date-and-time +--ro dscp? inet:dscp | {dscp}? +--ro weighting? uint8 {qos}? +--ro dependency? | subscription-id {qos}? +--ro transport? transport | {configured}? +--ro encoding? encoding +--ro purpose? string {configured}?
+---n subscription-modified +--ro id | subscription-id +--ro (target) | +--:(stream) | +--ro (stream-filter)? | | +--:(by-reference) | | | +--ro stream-filter-name | | | stream-filter-ref | | +--:(within-subscription) | | +--ro (filter-spec)? | | +--:(stream-subtree-filter) | | | +--ro stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--ro stream-xpath-filter? yang:xpath1.0 | | {xpath}? | +--ro stream stream-ref | +--ro replay-start-time? | yang:date-and-time {replay}? +--ro stop-time? | yang:date-and-time +--ro dscp? inet:dscp | {dscp}? +--ro weighting? uint8 {qos}? +--ro dependency? | subscription-id {qos}? +--ro transport? transport | {configured}? +--ro encoding? encoding +--ro purpose? string {configured}?
Figure 12: "subscription-modified" Notification Tree Diagram
图12:“订阅修改”通知树图
A publisher most often sends this notification directly after the modification of any configuration parameters impacting a configured subscription. But it may also be sent at two other times:
发布者通常在修改影响已配置订阅的任何配置参数后直接发送此通知。但也可以在另外两个时间发送:
1. If a configured subscription has been modified during the suspension of a receiver, the notification will be delayed until the receiver's suspension is lifted. In this situation, the notification indicates that the subscription has been both modified and resumed.
1. 如果在接收器暂停期间修改了配置的订阅,则通知将延迟,直到接收器的暂停解除。在这种情况下,通知表示订阅已被修改并已恢复。
2. A "subscription-modified" subscription state change notification MUST be sent if the contents of the filter identified by the subscription's "stream-filter-ref" leaf have changed. This state change notification is to be sent for a filter change impacting any active receivers of a configured or dynamic subscription.
2. 如果订阅的“流筛选器引用”叶标识的筛选器内容已更改,则必须发送“订阅已修改”订阅状态更改通知。此状态更改通知将针对影响已配置订阅或动态订阅的任何活动接收器的筛选器更改发送。
This notification indicates that no further event records for this subscription should be expected from the publisher. A publisher may terminate the sending of event records to a receiver for the following reasons:
此通知表示不应期望发布服务器提供此订阅的其他事件记录。发布者可出于以下原因终止向接收者发送事件记录:
1. Configuration that removes a configured subscription, or a "kill-subscription" RPC that ends a dynamic subscription. These are identified via the reason "no-such-subscription".
1. 删除已配置订阅的配置,或结束动态订阅的“终止订阅”RPC。通过“无此类订阅”的原因识别这些信息。
2. A referenced filter is no longer accessible. This reason is identified by the "filter-unavailable" identity.
2. 引用的筛选器不再可访问。此原因由“过滤器不可用”标识标识标识。
3. The event stream referenced by a subscription is no longer accessible by the receiver. This reason is identified by the "stream-unavailable" identity.
3. 订阅引用的事件流不再可由接收方访问。此原因由“流不可用”标识标识标识。
4. A suspended subscription has exceeded some timeout. This reason is identified by the "suspension-timeout" identity.
4. 挂起的订阅已超过某个超时时间。此原因由“暂停超时”标识标识标识。
Each reason listed above derives from the "subscription-terminated-reason" base identity specified in the YANG data model in this document.
上面列出的每个原因都源自本文档中YANG数据模型中指定的“订阅终止原因”基本标识。
Below is a tree diagram for "subscription-terminated". All objects contained in this tree are described in the YANG module in Section 4.
下面是“已终止订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n subscription-terminated +--ro id subscription-id +--ro reason identityref
+---n subscription-terminated +--ro id subscription-id +--ro reason identityref
Figure 13: "subscription-terminated" Notification Tree Diagram
图13:“订阅终止”通知树图
Note: This subscription state change notification MUST be sent to a dynamic subscription's receiver when the subscription ends unexpectedly. This might happen when a "kill-subscription" RPC is successful or when some other event, not including reaching the subscription's "stop-time", results in a publisher choosing to end the subscription.
注意:当订阅意外结束时,必须将此订阅状态更改通知发送给动态订阅的接收者。当“终止订阅”RPC成功时,或者当某些其他事件(不包括达到订阅的“停止时间”)导致发布者选择终止订阅时,可能会发生这种情况。
This notification indicates that a publisher has suspended the sending of event records to a receiver and also indicates the possible loss of events. Suspension happens when capacity constraints stop a publisher from serving a valid subscription. The two conditions where this is possible are:
此通知表示发布者已暂停向接收者发送事件记录,还表示可能会丢失事件。当容量限制阻止发布服务器为有效订阅提供服务时,将发生挂起。可能的两个条件是:
1. "insufficient-resources", when a publisher is unable to produce the requested event stream of notification messages, and
1. “资源不足”,发布者无法生成请求的通知消息事件流,以及
2. "unsupportable-volume", when the bandwidth needed to get generated notification messages to a receiver exceeds a threshold.
2. “不受支持的卷”,当向接收器获取生成的通知消息所需的带宽超过阈值时。
These conditions are encoded in the "reason" object. No further notifications will be sent until the subscription resumes or is terminated.
这些条件编码在“reason”对象中。在订阅恢复或终止之前,不会发送进一步的通知。
Below is a tree diagram for "subscription-suspended". All objects contained in this tree are described in the YANG module in Section 4.
下面是“已暂停订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n subscription-suspended +--ro id subscription-id +--ro reason identityref
+---n subscription-suspended +--ro id subscription-id +--ro reason identityref
Figure 14: "subscription-suspended" Notification Tree Diagram
图14:“已暂停订阅”通知树图
This notification indicates that a previously suspended subscription has been resumed under the unmodified terms previously in place. Subscribed event records generated after the issuance of this subscription state change notification may now be sent.
此通知表示以前暂停的订阅已根据以前未修改的条款恢复。发布此订阅状态更改通知后生成的订阅事件记录现在可以发送。
Below is a tree diagram for "subscription-resumed". All objects contained in this tree are described in the YANG module in Section 4.
下面是“已恢复订阅”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n subscription-resumed +--ro id subscription-id
+---n subscription-resumed +--ro id subscription-id
Figure 15: "subscription-resumed" Notification Tree Diagram
图15:“订阅已恢复”通知树图
This notification indicates that a subscription that includes a "stop-time" has successfully finished passing event records upon reaching that time.
此通知表示包含“停止时间”的订阅在到达该时间时已成功完成传递事件记录。
Below is a tree diagram for "subscription-completed". All objects contained in this tree are described in the YANG module in Section 4.
下面是“订阅已完成”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n subscription-completed {configured}? +--ro id subscription-id
+---n subscription-completed {configured}? +--ro id subscription-id
Figure 16: "subscription-completed" Notification Tree Diagram
图16:“订阅完成”通知树图
This notification indicates that all of the event records prior to the current time have been passed to a receiver. It is sent before any notification messages containing an event record with a timestamp later than (1) the "stop-time" or (2) the subscription's start time.
此通知表示当前时间之前的所有事件记录都已传递给接收方。它在包含时间戳晚于(1)“停止时间”或(2)订阅开始时间的事件记录的任何通知消息之前发送。
If a subscription does not contain a "stop-time" or has a "stop-time" that has not been reached, then after the "replay-completed" notification has been sent, additional event records will be sent in sequence as they arise naturally on the publisher.
如果订阅不包含“停止时间”或“停止时间”尚未达到,则在发送“重播完成”通知后,将按顺序发送发布服务器上自然出现的其他事件记录。
Below is a tree diagram for "replay-completed". All objects contained in this tree are described in the YANG module in Section 4.
下面是“重播完成”的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+---n replay-completed {replay}? +--ro id subscription-id
+---n replay-completed {replay}? +--ro id subscription-id
Figure 17: "replay-completed" Notification Tree Diagram
图17:“重播完成”通知树图
In the operational state datastore, the "subscriptions" container maintains the state of all dynamic subscriptions as well as all configured subscriptions. Using datastore retrieval operations [RFC8641] or subscribing to the "subscriptions" container (Section 3.3) allows the state of subscriptions and their connectivity to receivers to be monitored.
在操作状态数据存储中,“订阅”容器维护所有动态订阅以及所有配置订阅的状态。使用数据存储检索操作[RFC8641]或订阅“订阅”容器(第3.3节)可以监视订阅状态及其与接收器的连接。
Each subscription in the operational state datastore is represented as a list element. Included in this list are event counters for each receiver, the state of each receiver, and the subscription parameters currently in effect. The appearance of the leaf "configured-subscription-state" indicates that a particular subscription came
操作状态数据存储中的每个订阅都表示为一个列表元素。此列表中包括每个接收器的事件计数器、每个接收器的状态以及当前有效的订阅参数。叶“已配置订阅状态”的出现表示出现了特定订阅
into being via configuration. This leaf also indicates whether the current state of that subscription is "valid", "invalid", or "concluded".
通过配置来实现。此页还指示订阅的当前状态是“有效”、“无效”还是“已结束”。
To understand the flow of event records in a subscription, there are two counters available for each receiver. The first counter is "sent-event-records", which shows the number of events identified for sending to a receiver. The second counter is "excluded-event-records", which shows the number of event records not sent to a receiver. "excluded-event-records" shows the combined results of both access control and per-subscription filtering. For configured subscriptions, counters are reset whenever the subscription's state is evaluated as "valid" (see (1) in Figure 8).
要了解订阅中的事件记录流,每个接收器有两个可用计数器。第一个计数器是“已发送事件记录”,它显示已识别的要发送到接收器的事件数。第二个计数器是“排除的事件记录”,它显示未发送到接收器的事件记录数。“排除的事件记录”显示访问控制和按订阅筛选的组合结果。对于已配置的订阅,每当订阅的状态被评估为“有效”时,计数器就会重置(请参见图8中的(1))。
Dynamic subscriptions are removed from the operational state datastore once they expire (reaching "stop-time") or when they are terminated. While many subscription objects are shown as configurable, dynamic subscriptions are only included in the operational state datastore and as a result are not configurable.
动态订阅一旦过期(达到“停止时间”)或终止,就会从操作状态数据存储中删除。虽然许多订阅对象显示为可配置,但动态订阅仅包含在操作状态数据存储中,因此不可配置。
Publishers supporting this document MUST indicate support of the YANG module "ietf-subscribed-notifications" in the YANG library of the publisher. In addition, if supported, the optional features "encode-xml", "encode-json", "configured", "supports-vrf", "qos", "xpath", "subtree", "interface-designation", "dscp", and "replay" MUST be indicated.
支持本文档的发布者必须表示支持发布者YANG库中的YANG模块“ietf订阅通知”。此外,如果支持,则必须指出可选功能“编码xml”、“编码json”、“已配置”、“支持vrf”、“qos”、“xpath”、“子树”、“接口指定”、“dscp”和“重播”。
This section contains tree diagrams for nodes defined in Section 4. For tree diagrams of subscription state change notifications, see Section 2.7. For the tree diagrams for the RPCs, see Section 2.4.
本节包含第4节中定义的节点的树形图。有关订阅状态更改通知的树形图,请参阅第2.7节。有关RPC的树形图,请参见第2.4节。
A publisher maintains a list of available event streams as operational data. This list contains both standardized and vendor-specific event streams. This enables subscribers to discover what streams a publisher supports.
发布者将可用事件流的列表维护为操作数据。此列表包含标准化事件流和特定于供应商的事件流。这使订阅者能够发现发布者支持的流。
Below is a tree diagram for the "streams" container. All objects contained in this tree are described in the YANG module in Section 4.
下面是“streams”容器的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+--ro streams +--ro stream* [name] +--ro name string +--ro description string +--ro replay-support? empty {replay}? +--ro replay-log-creation-time yang:date-and-time | {replay}? +--ro replay-log-aged-time? yang:date-and-time {replay}?
+--ro streams +--ro stream* [name] +--ro name string +--ro description string +--ro replay-support? empty {replay}? +--ro replay-log-creation-time yang:date-and-time | {replay}? +--ro replay-log-aged-time? yang:date-and-time {replay}?
Figure 18: "streams" Container Tree Diagram
图18:“流”容器树图
The "filters" container maintains a list of all subscription filters that persist outside the lifecycle of a single subscription. This enables predefined filters that may be referenced by more than one subscription.
“过滤器”容器维护在单个订阅生命周期之外保留的所有订阅过滤器的列表。这将启用可由多个订阅引用的预定义筛选器。
Below is a tree diagram for the "filters" container. All objects contained in this tree are described in the YANG module in Section 4.
下面是“过滤器”容器的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+--rw filters +--rw stream-filter* [name] +--rw name string +--rw (filter-spec)? +--:(stream-subtree-filter) | +--rw stream-subtree-filter? <anydata> {subtree}? +--:(stream-xpath-filter) +--rw stream-xpath-filter? yang:xpath1.0 {xpath}?
+--rw filters +--rw stream-filter* [name] +--rw name string +--rw (filter-spec)? +--:(stream-subtree-filter) | +--rw stream-subtree-filter? <anydata> {subtree}? +--:(stream-xpath-filter) +--rw stream-xpath-filter? yang:xpath1.0 {xpath}?
Figure 19: "filters" Container Tree Diagram
图19:“过滤器”容器树图
The "subscriptions" container maintains a list of all subscriptions on a publisher, both configured and dynamic. It can be used to retrieve information about the subscriptions that a publisher is serving.
“订阅”容器维护发布服务器上所有订阅的列表,包括已配置订阅和动态订阅。它可用于检索有关发布服务器正在服务的订阅的信息。
Below is a tree diagram for the "subscriptions" container. All objects contained in this tree are described in the YANG module in Section 4.
下面是“订阅”容器的树形图。此树中包含的所有对象在第4节的YANG模块中进行了描述。
+--rw subscriptions +--rw subscription* [id] +--rw id | subscription-id +--rw (target) | +--:(stream) | +--rw (stream-filter)? | | +--:(by-reference) | | | +--rw stream-filter-name | | | stream-filter-ref | | +--:(within-subscription) | | +--rw (filter-spec)? | | +--:(stream-subtree-filter) | | | +--rw stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--rw stream-xpath-filter? | | yang:xpath1.0 {xpath}? | +--rw stream stream-ref | +--ro replay-start-time? | | yang:date-and-time {replay}? | +--rw configured-replay? empty | {configured,replay}? +--rw stop-time? | yang:date-and-time +--rw dscp? inet:dscp | {dscp}? +--rw weighting? uint8 {qos}? +--rw dependency? | subscription-id {qos}? +--rw transport? transport | {configured}? +--rw encoding? encoding +--rw purpose? string | {configured}?
+--rw subscriptions +--rw subscription* [id] +--rw id | subscription-id +--rw (target) | +--:(stream) | +--rw (stream-filter)? | | +--:(by-reference) | | | +--rw stream-filter-name | | | stream-filter-ref | | +--:(within-subscription) | | +--rw (filter-spec)? | | +--:(stream-subtree-filter) | | | +--rw stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--rw stream-xpath-filter? | | yang:xpath1.0 {xpath}? | +--rw stream stream-ref | +--ro replay-start-time? | | yang:date-and-time {replay}? | +--rw configured-replay? empty | {configured,replay}? +--rw stop-time? | yang:date-and-time +--rw dscp? inet:dscp | {dscp}? +--rw weighting? uint8 {qos}? +--rw dependency? | subscription-id {qos}? +--rw transport? transport | {configured}? +--rw encoding? encoding +--rw purpose? string | {configured}?
+--rw (notification-message-origin)? {configured}? | +--:(interface-originated) | | +--rw source-interface? | | if:interface-ref {interface-designation}? | +--:(address-originated) | +--rw source-vrf? | | -> /ni:network-instances/network-instance/name | | {supports-vrf}? | +--rw source-address? | inet:ip-address-no-zone +--ro configured-subscription-state? enumeration | {configured}? +--rw receivers +--rw receiver* [name] +--rw name string +--ro sent-event-records? | yang:zero-based-counter64 +--ro excluded-event-records? | yang:zero-based-counter64 +--ro state enumeration +---x reset {configured}? +--ro output +--ro time yang:date-and-time
+--rw (notification-message-origin)? {configured}? | +--:(interface-originated) | | +--rw source-interface? | | if:interface-ref {interface-designation}? | +--:(address-originated) | +--rw source-vrf? | | -> /ni:network-instances/network-instance/name | | {supports-vrf}? | +--rw source-address? | inet:ip-address-no-zone +--ro configured-subscription-state? enumeration | {configured}? +--rw receivers +--rw receiver* [name] +--rw name string +--ro sent-event-records? | yang:zero-based-counter64 +--ro excluded-event-records? | yang:zero-based-counter64 +--ro state enumeration +---x reset {configured}? +--ro output +--ro time yang:date-and-time
Figure 20: "subscriptions" Container Tree Diagram
图20:“订阅”容器树图
This module imports typedefs from [RFC6991], [RFC8343], [RFC8341], [RFC8529], and [RFC8040]. It references [RFC6241], [XPATH] ("XML Path Language (XPath) Version 1.0"), [RFC7049], [RFC8259], [RFC7950], [RFC7951], and [RFC7540].
此模块从[RFC6991]、[RFC8343]、[RFC8341]、[RFC8529]和[RFC8040]导入typedefs。它引用了[RFC6241]、[XPATH](“XML路径语言(XPATH)1.0版”)、[RFC7049]、[RFC8259]、[RFC7950]、[RFC7951]和[RFC7540]。
<CODE BEGINS> file "ietf-subscribed-notifications@2019-09-09.yang" module ietf-subscribed-notifications { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"; prefix sn;
<CODE BEGINS> file "ietf-subscribed-notifications@2019-09-09.yang" module ietf-subscribed-notifications { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"; prefix sn;
import ietf-inet-types { prefix inet; reference "RFC 6991: Common YANG Data Types"; } import ietf-interfaces { prefix if; reference "RFC 8343: A YANG Data Model for Interface Management";
import ietf-inet-types { prefix inet; reference "RFC 6991: Common YANG Data Types"; } import ietf-interfaces { prefix if; reference "RFC 8343: A YANG Data Model for Interface Management";
} import ietf-netconf-acm { prefix nacm; reference "RFC 8341: Network Configuration Access Control Model"; } import ietf-network-instance { prefix ni; reference "RFC 8529: YANG Data Model for Network Instances"; } import ietf-restconf { prefix rc; reference "RFC 8040: RESTCONF Protocol"; } import ietf-yang-types { prefix yang; reference "RFC 6991: Common YANG Data Types"; }
} import ietf-netconf-acm { prefix nacm; reference "RFC 8341: Network Configuration Access Control Model"; } import ietf-network-instance { prefix ni; reference "RFC 8529: YANG Data Model for Network Instances"; } import ietf-restconf { prefix rc; reference "RFC 8040: RESTCONF Protocol"; } import ietf-yang-types { prefix yang; reference "RFC 6991: Common YANG Data Types"; }
organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: <https:/datatracker.ietf.org/wg/netconf/> WG List: <mailto:netconf@ietf.org>
organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: <https:/datatracker.ietf.org/wg/netconf/> WG List: <mailto:netconf@ietf.org>
Author: Alexander Clemm <mailto:ludwig@clemm.org>
Author: Alexander Clemm <mailto:ludwig@clemm.org>
Author: Eric Voit <mailto:evoit@cisco.com>
Author: Eric Voit <mailto:evoit@cisco.com>
Author: Alberto Gonzalez Prieto <mailto:alberto.gonzalez@microsoft.com>
Author: Alberto Gonzalez Prieto <mailto:alberto.gonzalez@microsoft.com>
Author: Einar Nilsen-Nygaard <mailto:einarnn@cisco.com>
Author: Einar Nilsen-Nygaard <mailto:einarnn@cisco.com>
Author: Ambika Prasad Tripathy <mailto:ambtripa@cisco.com>"; description "This module defines a YANG data model for subscribing to event records and receiving matching content in notification messages.
作者:Ambika Prasad Tripathy<mailto:ambtripa@cisco.com>“说明”此模块定义一个数据模型,用于订阅事件记录和接收通知消息中的匹配内容。
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
关键词‘必须’、‘不得’、‘必需’、‘应’、‘不得’、‘应’、‘不应’、‘建议’、‘不建议’,
'MAY', and 'OPTIONAL' in this document are to be interpreted as described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, they appear in all capitals, as shown here.
如图所示,本文件中的“可”和“可选”应在且仅在以所有大写字母出现时按照BCP 14(RFC 2119)(RFC 8174)中的说明进行解释。
Copyright (c) 2019 IETF Trust and the persons identified as authors of the code. All rights reserved.
版权(c)2019 IETF信托基金和被认定为代码作者的人员。版权所有。
Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info).
根据IETF信托有关IETF文件的法律规定第4.c节规定的简化BSD许可证中包含的许可条款,允许以源代码和二进制格式重新分发和使用,无论是否修改(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC 8639; see the RFC itself for full legal notices.";
该模块的此版本是RFC 8639的一部分;有关完整的法律通知,请参见RFC本身。“;
revision 2019-09-09 { description "Initial version."; reference "RFC 8639: A YANG Data Model for Subscriptions to Event Notifications"; }
revision 2019-09-09 { description "Initial version."; reference "RFC 8639: A YANG Data Model for Subscriptions to Event Notifications"; }
/* * FEATURES */
/* * FEATURES */
feature configured { description "This feature indicates that configuration of subscriptions is supported."; }
feature configured { description "This feature indicates that configuration of subscriptions is supported."; }
feature dscp { description "This feature indicates that a publisher supports the ability to set the Differentiated Services Code Point (DSCP) value in outgoing packets."; }
feature dscp { description "This feature indicates that a publisher supports the ability to set the Differentiated Services Code Point (DSCP) value in outgoing packets."; }
feature encode-json { description "This feature indicates that JSON encoding of notification messages is supported."; }
feature encode-json { description "This feature indicates that JSON encoding of notification messages is supported."; }
feature encode-xml { description "This feature indicates that XML encoding of notification messages is supported."; }
feature encode-xml { description "This feature indicates that XML encoding of notification messages is supported."; }
feature interface-designation { description "This feature indicates that a publisher supports sourcing all receiver interactions for a configured subscription from a single designated egress interface."; }
feature interface-designation { description "This feature indicates that a publisher supports sourcing all receiver interactions for a configured subscription from a single designated egress interface."; }
feature qos { description "This feature indicates that a publisher supports absolute dependencies of one subscription's traffic over another as well as weighted bandwidth sharing between subscriptions. Both of these are Quality of Service (QoS) features that allow differentiated treatment of notification messages between a publisher and a specific receiver."; }
feature qos { description "This feature indicates that a publisher supports absolute dependencies of one subscription's traffic over another as well as weighted bandwidth sharing between subscriptions. Both of these are Quality of Service (QoS) features that allow differentiated treatment of notification messages between a publisher and a specific receiver."; }
feature replay { description "This feature indicates that historical event record replay is supported. With replay, it is possible for past event records to be streamed in chronological order."; }
feature replay { description "This feature indicates that historical event record replay is supported. With replay, it is possible for past event records to be streamed in chronological order."; }
feature subtree { description "This feature indicates support for YANG subtree filtering."; reference "RFC 6241: Network Configuration Protocol (NETCONF), Section 6"; }
feature subtree { description "This feature indicates support for YANG subtree filtering."; reference "RFC 6241: Network Configuration Protocol (NETCONF), Section 6"; }
feature supports-vrf { description "This feature indicates that a publisher supports VRF configuration for configured subscriptions. VRF support for dynamic subscriptions does not require this feature."; reference "RFC 8529: YANG Data Model for Network Instances, Section 6"; }
feature supports-vrf { description "This feature indicates that a publisher supports VRF configuration for configured subscriptions. VRF support for dynamic subscriptions does not require this feature."; reference "RFC 8529: YANG Data Model for Network Instances, Section 6"; }
feature xpath { description "This feature indicates support for XPath filtering."; reference "XML Path Language (XPath) Version 1.0 (https://www.w3.org/TR/1999/REC-xpath-19991116)"; }
feature xpath { description "This feature indicates support for XPath filtering."; reference "XML Path Language (XPath) Version 1.0 (https://www.w3.org/TR/1999/REC-xpath-19991116)"; }
/* * EXTENSIONS */
/* * EXTENSIONS */
extension subscription-state-notification { description "This statement applies only to notifications. It indicates that the notification is a subscription state change notification. Therefore, it does not participate in a regular event stream and does not need to be specifically subscribed to in order to be received. This statement can only occur as a substatement of the YANG 'notification' statement. This statement is not for use outside of this YANG module."; }
extension subscription-state-notification { description "This statement applies only to notifications. It indicates that the notification is a subscription state change notification. Therefore, it does not participate in a regular event stream and does not need to be specifically subscribed to in order to be received. This statement can only occur as a substatement of the YANG 'notification' statement. This statement is not for use outside of this YANG module."; }
/* * IDENTITIES */ /* Identities for RPC and notification errors */
/* * IDENTITIES */ /* Identities for RPC and notification errors */
identity delete-subscription-error { description "Base identity for the problem found while attempting to fulfill either a 'delete-subscription' RPC request or a 'kill-subscription' RPC request."; }
identity delete-subscription-error { description "Base identity for the problem found while attempting to fulfill either a 'delete-subscription' RPC request or a 'kill-subscription' RPC request."; }
identity establish-subscription-error { description "Base identity for the problem found while attempting to fulfill an 'establish-subscription' RPC request."; }
identity establish-subscription-error { description "Base identity for the problem found while attempting to fulfill an 'establish-subscription' RPC request."; }
identity modify-subscription-error { description "Base identity for the problem found while attempting to fulfill a 'modify-subscription' RPC request."; }
identity modify-subscription-error { description "Base identity for the problem found while attempting to fulfill a 'modify-subscription' RPC request."; }
identity subscription-suspended-reason {
身份订阅暂停原因{
description "Base identity for the problem condition communicated to a receiver as part of a 'subscription-suspended' notification."; }
description "Base identity for the problem condition communicated to a receiver as part of a 'subscription-suspended' notification."; }
identity subscription-terminated-reason { description "Base identity for the problem condition communicated to a receiver as part of a 'subscription-terminated' notification."; }
identity subscription-terminated-reason { description "Base identity for the problem condition communicated to a receiver as part of a 'subscription-terminated' notification."; }
identity dscp-unavailable { base establish-subscription-error; if-feature "dscp"; description "The publisher is unable to mark notification messages with prioritization information in a way that will be respected during network transit."; }
identity dscp-unavailable { base establish-subscription-error; if-feature "dscp"; description "The publisher is unable to mark notification messages with prioritization information in a way that will be respected during network transit."; }
identity encoding-unsupported { base establish-subscription-error; description "Unable to encode notification messages in the desired format."; }
identity encoding-unsupported { base establish-subscription-error; description "Unable to encode notification messages in the desired format."; }
identity filter-unavailable { base subscription-terminated-reason; description "Referenced filter does not exist. This means a receiver is referencing a filter that doesn't exist or to which it does not have access permissions."; }
identity filter-unavailable { base subscription-terminated-reason; description "Referenced filter does not exist. This means a receiver is referencing a filter that doesn't exist or to which it does not have access permissions."; }
identity filter-unsupported { base establish-subscription-error; base modify-subscription-error; description "Cannot parse syntax in the filter. This failure can be from a syntax error or a syntax too complex to be processed by the publisher."; }
identity filter-unsupported { base establish-subscription-error; base modify-subscription-error; description "Cannot parse syntax in the filter. This failure can be from a syntax error or a syntax too complex to be processed by the publisher."; }
identity insufficient-resources { base establish-subscription-error;
identity insufficient-resources { base establish-subscription-error;
base modify-subscription-error; base subscription-suspended-reason; description "The publisher does not have sufficient resources to support the requested subscription. An example might be that allocated CPU is too limited to generate the desired set of notification messages."; }
base modify-subscription-error; base subscription-suspended-reason; description "The publisher does not have sufficient resources to support the requested subscription. An example might be that allocated CPU is too limited to generate the desired set of notification messages."; }
identity no-such-subscription { base modify-subscription-error; base delete-subscription-error; base subscription-terminated-reason; description "Referenced subscription doesn't exist. This may be as a result of a nonexistent subscription ID, an ID that belongs to another subscriber, or an ID for a configured subscription."; }
identity no-such-subscription { base modify-subscription-error; base delete-subscription-error; base subscription-terminated-reason; description "Referenced subscription doesn't exist. This may be as a result of a nonexistent subscription ID, an ID that belongs to another subscriber, or an ID for a configured subscription."; }
identity replay-unsupported { base establish-subscription-error; if-feature "replay"; description "Replay cannot be performed for this subscription. This means the publisher will not provide the requested historic information from the event stream via replay to this receiver."; }
identity replay-unsupported { base establish-subscription-error; if-feature "replay"; description "Replay cannot be performed for this subscription. This means the publisher will not provide the requested historic information from the event stream via replay to this receiver."; }
identity stream-unavailable { base subscription-terminated-reason; description "Not a subscribable event stream. This means the referenced event stream is not available for subscription by the receiver."; }
identity stream-unavailable { base subscription-terminated-reason; description "Not a subscribable event stream. This means the referenced event stream is not available for subscription by the receiver."; }
identity suspension-timeout { base subscription-terminated-reason; description "Termination of a previously suspended subscription. The publisher has eliminated the subscription, as it exceeded a time limit for suspension."; }
identity suspension-timeout { base subscription-terminated-reason; description "Termination of a previously suspended subscription. The publisher has eliminated the subscription, as it exceeded a time limit for suspension."; }
identity unsupportable-volume { base subscription-suspended-reason; description
identity unsupportable-volume { base subscription-suspended-reason; description
"The publisher does not have the network bandwidth needed to get the volume of generated information intended for a receiver."; }
"The publisher does not have the network bandwidth needed to get the volume of generated information intended for a receiver."; }
/* Identities for encodings */
/* Identities for encodings */
identity configurable-encoding { description "If a transport identity derives from this identity, it means that it supports configurable encodings. An example of a configurable encoding might be a new identity such as 'encode-cbor'. Such an identity could use 'configurable-encoding' as its base. This would allow a dynamic subscription encoded in JSON (RFC 8259) to request that notification messages be encoded via the Concise Binary Object Representation (CBOR) (RFC 7049). Further details for any specific configurable encoding would be explored in a transport document based on this specification."; reference "RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format RFC 7049: Concise Binary Object Representation (CBOR)"; }
identity configurable-encoding { description "If a transport identity derives from this identity, it means that it supports configurable encodings. An example of a configurable encoding might be a new identity such as 'encode-cbor'. Such an identity could use 'configurable-encoding' as its base. This would allow a dynamic subscription encoded in JSON (RFC 8259) to request that notification messages be encoded via the Concise Binary Object Representation (CBOR) (RFC 7049). Further details for any specific configurable encoding would be explored in a transport document based on this specification."; reference "RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format RFC 7049: Concise Binary Object Representation (CBOR)"; }
identity encoding { description "Base identity to represent data encodings."; }
identity encoding { description "Base identity to represent data encodings."; }
identity encode-xml { base encoding; if-feature "encode-xml"; description "Encode data using XML as described in RFC 7950."; reference "RFC 7950: The YANG 1.1 Data Modeling Language"; }
identity encode-xml { base encoding; if-feature "encode-xml"; description "Encode data using XML as described in RFC 7950."; reference "RFC 7950: The YANG 1.1 Data Modeling Language"; }
identity encode-json { base encoding; if-feature "encode-json"; description "Encode data using JSON as described in RFC 7951."; reference "RFC 7951: JSON Encoding of Data Modeled with YANG"; }
identity encode-json { base encoding; if-feature "encode-json"; description "Encode data using JSON as described in RFC 7951."; reference "RFC 7951: JSON Encoding of Data Modeled with YANG"; }
/* Identities for transports */
/* Identities for transports */
identity transport { description "An identity that represents the underlying mechanism for passing notification messages."; }
identity transport { description "An identity that represents the underlying mechanism for passing notification messages."; }
/* * TYPEDEFs */
/* * TYPEDEFs */
typedef encoding { type identityref { base encoding; } description "Specifies a data encoding, e.g., for a data subscription."; }
typedef encoding { type identityref { base encoding; } description "Specifies a data encoding, e.g., for a data subscription."; }
typedef stream-filter-ref { type leafref { path "/sn:filters/sn:stream-filter/sn:name"; } description "This type is used to reference an event stream filter."; }
typedef stream-filter-ref { type leafref { path "/sn:filters/sn:stream-filter/sn:name"; } description "This type is used to reference an event stream filter."; }
typedef stream-ref { type leafref { path "/sn:streams/sn:stream/sn:name"; } description "This type is used to reference a system-provided event stream."; }
typedef stream-ref { type leafref { path "/sn:streams/sn:stream/sn:name"; } description "This type is used to reference a system-provided event stream."; }
typedef subscription-id { type uint32; description "A type for subscription identifiers."; }
typedef subscription-id { type uint32; description "A type for subscription identifiers."; }
typedef transport { type identityref { base transport; } description
typedef transport { type identityref { base transport; } description
"Specifies the transport used to send notification messages to a receiver."; }
"Specifies the transport used to send notification messages to a receiver."; }
/* * GROUPINGS */
/* * GROUPINGS */
grouping stream-filter-elements { description "This grouping defines the base for filters applied to event streams."; choice filter-spec { description "The content filter specification for this request."; anydata stream-subtree-filter { if-feature "subtree"; description "Event stream evaluation criteria encoded in the syntax of a subtree filter as defined in RFC 6241, Section 6.
grouping stream-filter-elements { description "This grouping defines the base for filters applied to event streams."; choice filter-spec { description "The content filter specification for this request."; anydata stream-subtree-filter { if-feature "subtree"; description "Event stream evaluation criteria encoded in the syntax of a subtree filter as defined in RFC 6241, Section 6.
The subtree filter is applied to the representation of individual, delineated event records as contained in the event stream.
子树过滤器应用于事件流中包含的单个、描绘的事件记录的表示。
If the subtree filter returns a non-empty node set, the filter matches the event record, and the event record is included in the notification message sent to the receivers."; reference "RFC 6241: Network Configuration Protocol (NETCONF), Section 6"; } leaf stream-xpath-filter { if-feature "xpath"; type yang:xpath1.0; description "Event stream evaluation criteria encoded in the syntax of an XPath 1.0 expression.
If the subtree filter returns a non-empty node set, the filter matches the event record, and the event record is included in the notification message sent to the receivers."; reference "RFC 6241: Network Configuration Protocol (NETCONF), Section 6"; } leaf stream-xpath-filter { if-feature "xpath"; type yang:xpath1.0; description "Event stream evaluation criteria encoded in the syntax of an XPath 1.0 expression.
The XPath expression is evaluated on the representation of individual, delineated event records as contained in the event stream.
XPath表达式根据事件流中包含的单个、描述的事件记录的表示进行计算。
The result of the XPath expression is converted to a boolean value using the standard XPath 1.0 rules. If the boolean value is 'true', the filter matches the event record, and the event record is included in the
XPath表达式的结果使用标准XPath 1.0规则转换为布尔值。如果布尔值为“true”,则筛选器与事件记录匹配,并且事件记录包含在
notification message sent to the receivers.
发送给接收者的通知消息。
The expression is evaluated in the following XPath context:
表达式在以下XPath上下文中求值:
o The set of namespace declarations is the set of prefix and namespace pairs for all YANG modules implemented by the server, where the prefix is the YANG module name and the namespace is as defined by the 'namespace' statement in the YANG module.
o 命名空间声明集是服务器实现的所有YANG模块的前缀和命名空间对集,其中前缀是YANG模块名称,命名空间由YANG模块中的“namespace”语句定义。
If the leaf is encoded in XML, all namespace declarations in scope on the 'stream-xpath-filter' leaf element are added to the set of namespace declarations. If a prefix found in the XML is already present in the set of namespace declarations, the namespace in the XML is used.
如果叶用XML编码,“stream xpath filter”叶元素上作用域中的所有命名空间声明都将添加到命名空间声明集中。如果在XML中找到的前缀已存在于名称空间声明集中,则使用XML中的名称空间。
o The set of variable bindings is empty.
o 变量绑定集为空。
o The function library is comprised of the core function library and the XPath functions defined in Section 10 in RFC 7950.
o 函数库由核心函数库和RFC 7950第10节中定义的XPath函数组成。
o The context node is the root node."; reference "XML Path Language (XPath) Version 1.0 (https://www.w3.org/TR/1999/REC-xpath-19991116) RFC 7950: The YANG 1.1 Data Modeling Language, Section 10"; } } }
o The context node is the root node."; reference "XML Path Language (XPath) Version 1.0 (https://www.w3.org/TR/1999/REC-xpath-19991116) RFC 7950: The YANG 1.1 Data Modeling Language, Section 10"; } } }
grouping update-qos { description "This grouping describes QoS information concerning a subscription. This information is passed to lower layers for transport prioritization and treatment."; leaf dscp { if-feature "dscp"; type inet:dscp; default "0"; description "The desired network transport priority level. This is the priority set on notification messages encapsulating the results of the subscription. This transport priority is shared for all receivers of a given subscription.";
grouping update-qos { description "This grouping describes QoS information concerning a subscription. This information is passed to lower layers for transport prioritization and treatment."; leaf dscp { if-feature "dscp"; type inet:dscp; default "0"; description "The desired network transport priority level. This is the priority set on notification messages encapsulating the results of the subscription. This transport priority is shared for all receivers of a given subscription.";
} leaf weighting { if-feature "qos"; type uint8 { range "0 .. 255"; } description "Relative weighting for a subscription. Larger weights get more resources. Allows an underlying transport layer to perform informed load-balance allocations between various subscriptions."; reference "RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2), Section 5.3.2"; } leaf dependency { if-feature "qos"; type subscription-id; description "Provides the 'subscription-id' of a parent subscription. The parent subscription has absolute precedence should that parent have push updates ready to egress the publisher. In other words, there should be no streaming of objects from the current subscription if the parent has something ready to push.
} leaf weighting { if-feature "qos"; type uint8 { range "0 .. 255"; } description "Relative weighting for a subscription. Larger weights get more resources. Allows an underlying transport layer to perform informed load-balance allocations between various subscriptions."; reference "RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2), Section 5.3.2"; } leaf dependency { if-feature "qos"; type subscription-id; description "Provides the 'subscription-id' of a parent subscription. The parent subscription has absolute precedence should that parent have push updates ready to egress the publisher. In other words, there should be no streaming of objects from the current subscription if the parent has something ready to push.
If a dependency is asserted via configuration or via an RPC but the referenced 'subscription-id' does not exist, the dependency is silently discarded. If a referenced subscription is deleted, this dependency is removed."; reference "RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2), Section 5.3.1"; } }
If a dependency is asserted via configuration or via an RPC but the referenced 'subscription-id' does not exist, the dependency is silently discarded. If a referenced subscription is deleted, this dependency is removed."; reference "RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2), Section 5.3.1"; } }
grouping subscription-policy-modifiable { description "This grouping describes all objects that may be changed in a subscription."; choice target { mandatory true; description "Identifies the source of information against which a subscription is being applied as well as specifics on the subset of information desired from that source."; case stream { choice stream-filter {
grouping subscription-policy-modifiable { description "This grouping describes all objects that may be changed in a subscription."; choice target { mandatory true; description "Identifies the source of information against which a subscription is being applied as well as specifics on the subset of information desired from that source."; case stream { choice stream-filter {
description "An event stream filter can be applied to a subscription. That filter will either come referenced from a global list or be provided in the subscription itself."; case by-reference { description "Apply a filter that has been configured separately."; leaf stream-filter-name { type stream-filter-ref; mandatory true; description "References an existing event stream filter that is to be applied to an event stream for the subscription."; } } case within-subscription { description "A local definition allows a filter to have the same lifecycle as the subscription."; uses stream-filter-elements; } } } } leaf stop-time { type yang:date-and-time; description "Identifies a time after which notification messages for a subscription should not be sent. If 'stop-time' is not present, the notification messages will continue until the subscription is terminated. If 'replay-start-time' exists, 'stop-time' must be for a subsequent time. If 'replay-start-time' doesn't exist, 'stop-time', when established, must be for a future time."; } }
description "An event stream filter can be applied to a subscription. That filter will either come referenced from a global list or be provided in the subscription itself."; case by-reference { description "Apply a filter that has been configured separately."; leaf stream-filter-name { type stream-filter-ref; mandatory true; description "References an existing event stream filter that is to be applied to an event stream for the subscription."; } } case within-subscription { description "A local definition allows a filter to have the same lifecycle as the subscription."; uses stream-filter-elements; } } } } leaf stop-time { type yang:date-and-time; description "Identifies a time after which notification messages for a subscription should not be sent. If 'stop-time' is not present, the notification messages will continue until the subscription is terminated. If 'replay-start-time' exists, 'stop-time' must be for a subsequent time. If 'replay-start-time' doesn't exist, 'stop-time', when established, must be for a future time."; } }
grouping subscription-policy-dynamic { description "This grouping describes the only information concerning a subscription that can be passed over the RPCs defined in this data model."; uses subscription-policy-modifiable { augment "target/stream" { description "Adds additional objects that can be modified by an RPC."; leaf stream {
grouping subscription-policy-dynamic { description "This grouping describes the only information concerning a subscription that can be passed over the RPCs defined in this data model."; uses subscription-policy-modifiable { augment "target/stream" { description "Adds additional objects that can be modified by an RPC."; leaf stream {
type stream-ref { require-instance false; } mandatory true; description "Indicates the event stream to be considered for this subscription."; } leaf replay-start-time { if-feature "replay"; type yang:date-and-time; config false; description "Used to trigger the 'replay' feature for a dynamic subscription, where event records that are selected need to be at or after the specified starting time. If 'replay-start-time' is not present, this is not a replay subscription and event record push should start immediately. It is never valid to specify start times that are later than or equal to the current time."; } } } uses update-qos; }
type stream-ref { require-instance false; } mandatory true; description "Indicates the event stream to be considered for this subscription."; } leaf replay-start-time { if-feature "replay"; type yang:date-and-time; config false; description "Used to trigger the 'replay' feature for a dynamic subscription, where event records that are selected need to be at or after the specified starting time. If 'replay-start-time' is not present, this is not a replay subscription and event record push should start immediately. It is never valid to specify start times that are later than or equal to the current time."; } } } uses update-qos; }
grouping subscription-policy { description "This grouping describes the full set of policy information concerning both dynamic and configured subscriptions, with the exclusion of both receivers and networking information specific to the publisher, such as what interface should be used to transmit notification messages."; uses subscription-policy-dynamic; leaf transport { if-feature "configured"; type transport; description "For a configured subscription, this leaf specifies the transport used to deliver messages destined for all receivers of that subscription."; } leaf encoding { when 'not(../transport) or derived-from(../transport, "sn:configurable-encoding")'; type encoding; description "The type of encoding for notification messages. For a
grouping subscription-policy { description "This grouping describes the full set of policy information concerning both dynamic and configured subscriptions, with the exclusion of both receivers and networking information specific to the publisher, such as what interface should be used to transmit notification messages."; uses subscription-policy-dynamic; leaf transport { if-feature "configured"; type transport; description "For a configured subscription, this leaf specifies the transport used to deliver messages destined for all receivers of that subscription."; } leaf encoding { when 'not(../transport) or derived-from(../transport, "sn:configurable-encoding")'; type encoding; description "The type of encoding for notification messages. For a
dynamic subscription, if not included as part of an 'establish-subscription' RPC, the encoding will be populated with the encoding used by that RPC. For a configured subscription, if not explicitly configured, the encoding will be the default encoding for an underlying transport."; } leaf purpose { if-feature "configured"; type string; description "Open text allowing a configuring entity to embed the originator or other specifics of this subscription."; } }
dynamic subscription, if not included as part of an 'establish-subscription' RPC, the encoding will be populated with the encoding used by that RPC. For a configured subscription, if not explicitly configured, the encoding will be the default encoding for an underlying transport."; } leaf purpose { if-feature "configured"; type string; description "Open text allowing a configuring entity to embed the originator or other specifics of this subscription."; } }
/* * RPCs */
/* * RPCs */
rpc establish-subscription { description "This RPC allows a subscriber to create (and possibly negotiate) a subscription on its own behalf. If successful, the subscription remains in effect for the duration of the subscriber's association with the publisher or until the subscription is terminated. If an error occurs or the publisher cannot meet the terms of a subscription, an RPC error is returned, and the subscription is not created. In that case, the RPC reply's 'error-info' MAY include suggested parameter settings that would have a higher likelihood of succeeding in a subsequent 'establish-subscription' request."; input { uses subscription-policy-dynamic; leaf encoding { type encoding; description "The type of encoding for the subscribed data. If not included as part of the RPC, the encoding MUST be set by the publisher to be the encoding used by this RPC."; } } output { leaf id { type subscription-id; mandatory true; description "Identifier used for this subscription.";
rpc establish-subscription { description "This RPC allows a subscriber to create (and possibly negotiate) a subscription on its own behalf. If successful, the subscription remains in effect for the duration of the subscriber's association with the publisher or until the subscription is terminated. If an error occurs or the publisher cannot meet the terms of a subscription, an RPC error is returned, and the subscription is not created. In that case, the RPC reply's 'error-info' MAY include suggested parameter settings that would have a higher likelihood of succeeding in a subsequent 'establish-subscription' request."; input { uses subscription-policy-dynamic; leaf encoding { type encoding; description "The type of encoding for the subscribed data. If not included as part of the RPC, the encoding MUST be set by the publisher to be the encoding used by this RPC."; } } output { leaf id { type subscription-id; mandatory true; description "Identifier used for this subscription.";
} leaf replay-start-time-revision { if-feature "replay"; type yang:date-and-time; description "If a replay has been requested, this object represents the earliest time covered by the event buffer for the requested event stream. The value of this object is the 'replay-log-aged-time' if it exists. Otherwise, it is the 'replay-log-creation-time'. All buffered event records after this time will be replayed to a receiver. This object will only be sent if the starting time has been revised to be later than the time requested by the subscriber."; } } }
} leaf replay-start-time-revision { if-feature "replay"; type yang:date-and-time; description "If a replay has been requested, this object represents the earliest time covered by the event buffer for the requested event stream. The value of this object is the 'replay-log-aged-time' if it exists. Otherwise, it is the 'replay-log-creation-time'. All buffered event records after this time will be replayed to a receiver. This object will only be sent if the starting time has been revised to be later than the time requested by the subscriber."; } } }
rc:yang-data establish-subscription-stream-error-info { container establish-subscription-stream-error-info { description "If any 'establish-subscription' RPC parameters are unsupportable against the event stream, a subscription is not created and the RPC error response MUST indicate the reason why the subscription failed to be created. This yang-data MAY be inserted as structured data in a subscription's RPC error response to indicate the reason for the failure. This yang-data MUST be inserted if hints are to be provided back to the subscriber."; leaf reason { type identityref { base establish-subscription-error; } description "Indicates the reason why the subscription has failed to be created to a targeted event stream."; } leaf filter-failure-hint { type string; description "Information describing where and/or why a provided filter was unsupportable for a subscription. The syntax and semantics of this hint are implementation specific."; } } }
rc:yang-data establish-subscription-stream-error-info { container establish-subscription-stream-error-info { description "If any 'establish-subscription' RPC parameters are unsupportable against the event stream, a subscription is not created and the RPC error response MUST indicate the reason why the subscription failed to be created. This yang-data MAY be inserted as structured data in a subscription's RPC error response to indicate the reason for the failure. This yang-data MUST be inserted if hints are to be provided back to the subscriber."; leaf reason { type identityref { base establish-subscription-error; } description "Indicates the reason why the subscription has failed to be created to a targeted event stream."; } leaf filter-failure-hint { type string; description "Information describing where and/or why a provided filter was unsupportable for a subscription. The syntax and semantics of this hint are implementation specific."; } } }
rpc modify-subscription { description "This RPC allows a subscriber to modify a dynamic subscription's parameters. If successful, the changed subscription parameters remain in effect for the duration of the subscription, until the subscription is again modified, or until the subscription is terminated. In the case of an error or an inability to meet the modified parameters, the subscription is not modified and the original subscription parameters remain in effect. In that case, the RPC error MAY include 'error-info' suggested parameter hints that would have a high likelihood of succeeding in a subsequent 'modify-subscription' request. A successful 'modify-subscription' will return a suspended subscription to the 'active' state."; input { leaf id { type subscription-id; mandatory true; description "Identifier to use for this subscription."; } uses subscription-policy-modifiable; } }
rpc modify-subscription { description "This RPC allows a subscriber to modify a dynamic subscription's parameters. If successful, the changed subscription parameters remain in effect for the duration of the subscription, until the subscription is again modified, or until the subscription is terminated. In the case of an error or an inability to meet the modified parameters, the subscription is not modified and the original subscription parameters remain in effect. In that case, the RPC error MAY include 'error-info' suggested parameter hints that would have a high likelihood of succeeding in a subsequent 'modify-subscription' request. A successful 'modify-subscription' will return a suspended subscription to the 'active' state."; input { leaf id { type subscription-id; mandatory true; description "Identifier to use for this subscription."; } uses subscription-policy-modifiable; } }
rc:yang-data modify-subscription-stream-error-info { container modify-subscription-stream-error-info { description "This yang-data MAY be provided as part of a subscription's RPC error response when there is a failure of a 'modify-subscription' RPC that has been made against an event stream. This yang-data MUST be used if hints are to be provided back to the subscriber."; leaf reason { type identityref { base modify-subscription-error; } description "Information in a 'modify-subscription' RPC error response that indicates the reason why the subscription to an event stream has failed to be modified."; } leaf filter-failure-hint { type string; description "Information describing where and/or why a provided filter was unsupportable for a subscription. The syntax
rc:yang-data modify-subscription-stream-error-info { container modify-subscription-stream-error-info { description "This yang-data MAY be provided as part of a subscription's RPC error response when there is a failure of a 'modify-subscription' RPC that has been made against an event stream. This yang-data MUST be used if hints are to be provided back to the subscriber."; leaf reason { type identityref { base modify-subscription-error; } description "Information in a 'modify-subscription' RPC error response that indicates the reason why the subscription to an event stream has failed to be modified."; } leaf filter-failure-hint { type string; description "Information describing where and/or why a provided filter was unsupportable for a subscription. The syntax
and semantics of this hint are implementation specific."; } } }
and semantics of this hint are implementation specific."; } } }
rpc delete-subscription { description "This RPC allows a subscriber to delete a subscription that was previously created by that same subscriber using the 'establish-subscription' RPC.
rpc delete subscription{description“此rpc允许订阅服务器删除以前由同一订阅服务器使用“建立订阅”rpc创建的订阅。
If an error occurs, the server replies with an 'rpc-error' where the 'error-info' field MAY contain a 'delete-subscription-error-info' structure."; input { leaf id { type subscription-id; mandatory true; description "Identifier of the subscription that is to be deleted. Only subscriptions that were created using 'establish-subscription' from the same origin as this RPC can be deleted via this RPC."; } } }
If an error occurs, the server replies with an 'rpc-error' where the 'error-info' field MAY contain a 'delete-subscription-error-info' structure."; input { leaf id { type subscription-id; mandatory true; description "Identifier of the subscription that is to be deleted. Only subscriptions that were created using 'establish-subscription' from the same origin as this RPC can be deleted via this RPC."; } } }
rpc kill-subscription { nacm:default-deny-all; description "This RPC allows an operator to delete a dynamic subscription without restrictions on the originating subscriber or underlying transport session.
rpc kill-subscription { nacm:default-deny-all; description "This RPC allows an operator to delete a dynamic subscription without restrictions on the originating subscriber or underlying transport session.
If an error occurs, the server replies with an 'rpc-error' where the 'error-info' field MAY contain a 'delete-subscription-error-info' structure."; input { leaf id { type subscription-id; mandatory true; description "Identifier of the subscription that is to be deleted. Only subscriptions that were created using 'establish-subscription' can be deleted via this RPC."; } }
If an error occurs, the server replies with an 'rpc-error' where the 'error-info' field MAY contain a 'delete-subscription-error-info' structure."; input { leaf id { type subscription-id; mandatory true; description "Identifier of the subscription that is to be deleted. Only subscriptions that were created using 'establish-subscription' can be deleted via this RPC."; } }
}
}
rc:yang-data delete-subscription-error-info { container delete-subscription-error-info { description "If a 'delete-subscription' RPC or a 'kill-subscription' RPC fails, the subscription is not deleted and the RPC error response MUST indicate the reason for this failure. This yang-data MAY be inserted as structured data in a subscription's RPC error response to indicate the reason for the failure."; leaf reason { type identityref { base delete-subscription-error; } mandatory true; description "Indicates the reason why the subscription has failed to be deleted."; } } }
rc:yang-data delete-subscription-error-info { container delete-subscription-error-info { description "If a 'delete-subscription' RPC or a 'kill-subscription' RPC fails, the subscription is not deleted and the RPC error response MUST indicate the reason for this failure. This yang-data MAY be inserted as structured data in a subscription's RPC error response to indicate the reason for the failure."; leaf reason { type identityref { base delete-subscription-error; } mandatory true; description "Indicates the reason why the subscription has failed to be deleted."; } } }
/* * NOTIFICATIONS */
/* * NOTIFICATIONS */
notification replay-completed { sn:subscription-state-notification; if-feature "replay"; description "This notification is sent to indicate that all of the replay notifications have been sent."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } }
notification replay-completed { sn:subscription-state-notification; if-feature "replay"; description "This notification is sent to indicate that all of the replay notifications have been sent."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } }
notification subscription-completed { sn:subscription-state-notification; if-feature "configured"; description "This notification is sent to indicate that a subscription has finished passing event records, as the 'stop-time' has been reached.";
notification subscription-completed { sn:subscription-state-notification; if-feature "configured"; description "This notification is sent to indicate that a subscription has finished passing event records, as the 'stop-time' has been reached.";
leaf id { type subscription-id; mandatory true; description "This references the gracefully completed subscription."; } }
leaf id { type subscription-id; mandatory true; description "This references the gracefully completed subscription."; } }
notification subscription-modified { sn:subscription-state-notification; description "This notification indicates that a subscription has been modified. Notification messages sent from this point on will conform to the modified terms of the subscription. For completeness, this subscription state change notification includes both modified and unmodified aspects of a subscription."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } uses subscription-policy { refine "target/stream/stream-filter/within-subscription" { description "Filter applied to the subscription. If the 'stream-filter-name' is populated, the filter in the subscription came from the 'filters' container. Otherwise, it is populated in-line as part of the subscription."; } } }
notification subscription-modified { sn:subscription-state-notification; description "This notification indicates that a subscription has been modified. Notification messages sent from this point on will conform to the modified terms of the subscription. For completeness, this subscription state change notification includes both modified and unmodified aspects of a subscription."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } uses subscription-policy { refine "target/stream/stream-filter/within-subscription" { description "Filter applied to the subscription. If the 'stream-filter-name' is populated, the filter in the subscription came from the 'filters' container. Otherwise, it is populated in-line as part of the subscription."; } } }
notification subscription-resumed { sn:subscription-state-notification; description "This notification indicates that a subscription that had previously been suspended has resumed. Notifications will once again be sent. In addition, a 'subscription-resumed' indicates that no modification of parameters has occurred since the last time event records have been sent."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription.";
notification subscription-resumed { sn:subscription-state-notification; description "This notification indicates that a subscription that had previously been suspended has resumed. Notifications will once again be sent. In addition, a 'subscription-resumed' indicates that no modification of parameters has occurred since the last time event records have been sent."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription.";
} }
} }
notification subscription-started { sn:subscription-state-notification; if-feature "configured"; description "This notification indicates that a subscription has started and notifications will now be sent."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } uses subscription-policy { refine "target/stream/replay-start-time" { description "Indicates the time that a replay is using for the streaming of buffered event records. This will be populated with the most recent of the following: the event time of the previous event record sent to a receiver, the 'replay-log-creation-time', the 'replay-log-aged-time', or the most recent publisher boot time."; } refine "target/stream/stream-filter/within-subscription" { description "Filter applied to the subscription. If the 'stream-filter-name' is populated, the filter in the subscription came from the 'filters' container. Otherwise, it is populated in-line as part of the subscription."; } augment "target/stream" { description "This augmentation adds additional parameters specific to a 'subscription-started' notification."; leaf replay-previous-event-time { when '../replay-start-time'; if-feature "replay"; type yang:date-and-time; description "If there is at least one event in the replay buffer prior to 'replay-start-time', this gives the time of the event generated immediately prior to the 'replay-start-time'.
notification subscription-started { sn:subscription-state-notification; if-feature "configured"; description "This notification indicates that a subscription has started and notifications will now be sent."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } uses subscription-policy { refine "target/stream/replay-start-time" { description "Indicates the time that a replay is using for the streaming of buffered event records. This will be populated with the most recent of the following: the event time of the previous event record sent to a receiver, the 'replay-log-creation-time', the 'replay-log-aged-time', or the most recent publisher boot time."; } refine "target/stream/stream-filter/within-subscription" { description "Filter applied to the subscription. If the 'stream-filter-name' is populated, the filter in the subscription came from the 'filters' container. Otherwise, it is populated in-line as part of the subscription."; } augment "target/stream" { description "This augmentation adds additional parameters specific to a 'subscription-started' notification."; leaf replay-previous-event-time { when '../replay-start-time'; if-feature "replay"; type yang:date-and-time; description "If there is at least one event in the replay buffer prior to 'replay-start-time', this gives the time of the event generated immediately prior to the 'replay-start-time'.
If a receiver previously received event records for this configured subscription, it can compare this time to the last event record previously received. If the two are not the same (perhaps due to a reboot), then a dynamic replay can be initiated to acquire any missing event records."; } } } }
If a receiver previously received event records for this configured subscription, it can compare this time to the last event record previously received. If the two are not the same (perhaps due to a reboot), then a dynamic replay can be initiated to acquire any missing event records."; } } } }
notification subscription-suspended { sn:subscription-state-notification; description "This notification indicates that a suspension of the subscription by the publisher has occurred. No further notifications will be sent until the subscription resumes. This notification shall only be sent to receivers of a subscription; it does not constitute a general-purpose notification."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } leaf reason { type identityref { base subscription-suspended-reason; } mandatory true; description "Identifies the condition that resulted in the suspension."; } }
notification subscription-suspended { sn:subscription-state-notification; description "This notification indicates that a suspension of the subscription by the publisher has occurred. No further notifications will be sent until the subscription resumes. This notification shall only be sent to receivers of a subscription; it does not constitute a general-purpose notification."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } leaf reason { type identityref { base subscription-suspended-reason; } mandatory true; description "Identifies the condition that resulted in the suspension."; } }
notification subscription-terminated { sn:subscription-state-notification; description "This notification indicates that a subscription has been terminated."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } leaf reason {
notification subscription-terminated { sn:subscription-state-notification; description "This notification indicates that a subscription has been terminated."; leaf id { type subscription-id; mandatory true; description "This references the affected subscription."; } leaf reason {
type identityref { base subscription-terminated-reason; } mandatory true; description "Identifies the condition that resulted in the termination."; } }
type identityref { base subscription-terminated-reason; } mandatory true; description "Identifies the condition that resulted in the termination."; } }
/* * DATA NODES */
/* * DATA NODES */
container streams { config false; description "Contains information on the built-in event streams provided by the publisher."; list stream { key "name"; description "Identifies the built-in event streams that are supported by the publisher."; leaf name { type string; description "A handle for a system-provided event stream made up of a sequential set of event records, each of which is characterized by its own domain and semantics."; } leaf description { type string; description "A description of the event stream, including such information as the type of event records that are available in this event stream."; } leaf replay-support { if-feature "replay"; type empty; description "Indicates that event record replay is available on this event stream."; } leaf replay-log-creation-time { when '../replay-support'; if-feature "replay"; type yang:date-and-time;
container streams { config false; description "Contains information on the built-in event streams provided by the publisher."; list stream { key "name"; description "Identifies the built-in event streams that are supported by the publisher."; leaf name { type string; description "A handle for a system-provided event stream made up of a sequential set of event records, each of which is characterized by its own domain and semantics."; } leaf description { type string; description "A description of the event stream, including such information as the type of event records that are available in this event stream."; } leaf replay-support { if-feature "replay"; type empty; description "Indicates that event record replay is available on this event stream."; } leaf replay-log-creation-time { when '../replay-support'; if-feature "replay"; type yang:date-and-time;
mandatory true; description "The timestamp of the creation of the log used to support the replay function on this event stream. This time might be earlier than the earliest available information contained in the log. This object is updated if the log resets for some reason."; } leaf replay-log-aged-time { when '../replay-support'; if-feature "replay"; type yang:date-and-time; description "The timestamp associated with the last event record that has been aged out of the log. This timestamp identifies how far back in history this replay log extends, if it doesn't extend back to the 'replay-log-creation-time'. This object MUST be present if replay is supported and any event records have been aged out of the log."; } } } container filters { description "Contains a list of configurable filters that can be applied to subscriptions. This facilitates the reuse of complex filters once defined."; list stream-filter { key "name"; description "A list of preconfigured filters that can be applied to subscriptions."; leaf name { type string; description "A name to differentiate between filters."; } uses stream-filter-elements; } } container subscriptions { description "Contains the list of currently active subscriptions, i.e., subscriptions that are currently in effect, used for subscription management and monitoring purposes. This includes subscriptions that have been set up via RPC primitives as well as subscriptions that have been established via configuration.";
mandatory true; description "The timestamp of the creation of the log used to support the replay function on this event stream. This time might be earlier than the earliest available information contained in the log. This object is updated if the log resets for some reason."; } leaf replay-log-aged-time { when '../replay-support'; if-feature "replay"; type yang:date-and-time; description "The timestamp associated with the last event record that has been aged out of the log. This timestamp identifies how far back in history this replay log extends, if it doesn't extend back to the 'replay-log-creation-time'. This object MUST be present if replay is supported and any event records have been aged out of the log."; } } } container filters { description "Contains a list of configurable filters that can be applied to subscriptions. This facilitates the reuse of complex filters once defined."; list stream-filter { key "name"; description "A list of preconfigured filters that can be applied to subscriptions."; leaf name { type string; description "A name to differentiate between filters."; } uses stream-filter-elements; } } container subscriptions { description "Contains the list of currently active subscriptions, i.e., subscriptions that are currently in effect, used for subscription management and monitoring purposes. This includes subscriptions that have been set up via RPC primitives as well as subscriptions that have been established via configuration.";
list subscription { key "id"; description "The identity and specific parameters of a subscription. Subscriptions in this list can be created using a control channel or RPC or can be established through configuration.
list subscription { key "id"; description "The identity and specific parameters of a subscription. Subscriptions in this list can be created using a control channel or RPC or can be established through configuration.
If the 'kill-subscription' RPC or configuration operations are used to delete a subscription, a 'subscription-terminated' message is sent to any active or suspended receivers."; leaf id { type subscription-id; description "Identifier of a subscription; unique in a given publisher."; } uses subscription-policy { refine "target/stream/stream" { description "Indicates the event stream to be considered for this subscription. If an event stream has been removed and can no longer be referenced by an active subscription, send a 'subscription-terminated' notification with 'stream-unavailable' as the reason. If a configured subscription refers to a nonexistent event stream, move that subscription to the 'invalid' state."; } refine "transport" { description "For a configured subscription, this leaf specifies the transport used to deliver messages destined for all receivers of that subscription. This object is mandatory for subscriptions in the configuration datastore. This object (1) is not mandatory for dynamic subscriptions in the operational state datastore and (2) should not be present for other types of dynamic subscriptions."; } augment "target/stream" { description "Enables objects to be added to a configured stream subscription."; leaf configured-replay { if-feature "configured"; if-feature "replay"; type empty;
If the 'kill-subscription' RPC or configuration operations are used to delete a subscription, a 'subscription-terminated' message is sent to any active or suspended receivers."; leaf id { type subscription-id; description "Identifier of a subscription; unique in a given publisher."; } uses subscription-policy { refine "target/stream/stream" { description "Indicates the event stream to be considered for this subscription. If an event stream has been removed and can no longer be referenced by an active subscription, send a 'subscription-terminated' notification with 'stream-unavailable' as the reason. If a configured subscription refers to a nonexistent event stream, move that subscription to the 'invalid' state."; } refine "transport" { description "For a configured subscription, this leaf specifies the transport used to deliver messages destined for all receivers of that subscription. This object is mandatory for subscriptions in the configuration datastore. This object (1) is not mandatory for dynamic subscriptions in the operational state datastore and (2) should not be present for other types of dynamic subscriptions."; } augment "target/stream" { description "Enables objects to be added to a configured stream subscription."; leaf configured-replay { if-feature "configured"; if-feature "replay"; type empty;
description "The presence of this leaf indicates that replay for the configured subscription should start at the earliest time in the event log or at the publisher boot time, whichever is later."; } } } choice notification-message-origin { if-feature "configured"; description "Identifies the egress interface on the publisher from which notification messages are to be sent."; case interface-originated { description "When notification messages are to egress a specific, designated interface on the publisher."; leaf source-interface { if-feature "interface-designation"; type if:interface-ref; description "References the interface for notification messages."; } } case address-originated { description "When notification messages are to depart from a publisher using a specific originating address and/or routing context information."; leaf source-vrf { if-feature "supports-vrf"; type leafref { path "/ni:network-instances/ni:network-instance/ni:name"; } description "VRF from which notification messages should egress a publisher."; } leaf source-address { type inet:ip-address-no-zone; description "The source address for the notification messages. If a source VRF exists but this object doesn't, a publisher's default address for that VRF must be used."; } } }
description "The presence of this leaf indicates that replay for the configured subscription should start at the earliest time in the event log or at the publisher boot time, whichever is later."; } } } choice notification-message-origin { if-feature "configured"; description "Identifies the egress interface on the publisher from which notification messages are to be sent."; case interface-originated { description "When notification messages are to egress a specific, designated interface on the publisher."; leaf source-interface { if-feature "interface-designation"; type if:interface-ref; description "References the interface for notification messages."; } } case address-originated { description "When notification messages are to depart from a publisher using a specific originating address and/or routing context information."; leaf source-vrf { if-feature "supports-vrf"; type leafref { path "/ni:network-instances/ni:network-instance/ni:name"; } description "VRF from which notification messages should egress a publisher."; } leaf source-address { type inet:ip-address-no-zone; description "The source address for the notification messages. If a source VRF exists but this object doesn't, a publisher's default address for that VRF must be used."; } } }
leaf configured-subscription-state { if-feature "configured"; type enumeration { enum valid { value 1; description "The subscription is supportable with its current parameters."; } enum invalid { value 2; description "The subscription as a whole is unsupportable with its current parameters."; } enum concluded { value 3; description "A subscription is inactive, as it has hit a stop time. It no longer has receivers in the 'active' or 'suspended' state, but the subscription has not yet been removed from configuration."; } } config false; description "The presence of this leaf indicates that the subscription originated from configuration, not through a control channel or RPC. The value indicates the state of the subscription as established by the publisher."; } container receivers { description "Set of receivers in a subscription."; list receiver { key "name"; min-elements 1; description "A host intended as a recipient for the notification messages of a subscription. For configured subscriptions, transport-specific network parameters (or a leafref to those parameters) may be augmented to a specific receiver in this list."; leaf name { type string; description "Identifies a unique receiver for a subscription."; }
leaf configured-subscription-state { if-feature "configured"; type enumeration { enum valid { value 1; description "The subscription is supportable with its current parameters."; } enum invalid { value 2; description "The subscription as a whole is unsupportable with its current parameters."; } enum concluded { value 3; description "A subscription is inactive, as it has hit a stop time. It no longer has receivers in the 'active' or 'suspended' state, but the subscription has not yet been removed from configuration."; } } config false; description "The presence of this leaf indicates that the subscription originated from configuration, not through a control channel or RPC. The value indicates the state of the subscription as established by the publisher."; } container receivers { description "Set of receivers in a subscription."; list receiver { key "name"; min-elements 1; description "A host intended as a recipient for the notification messages of a subscription. For configured subscriptions, transport-specific network parameters (or a leafref to those parameters) may be augmented to a specific receiver in this list."; leaf name { type string; description "Identifies a unique receiver for a subscription."; }
leaf sent-event-records { type yang:zero-based-counter64; config false; description "The number of event records sent to the receiver. The count is initialized when a dynamic subscription is established or when a configured receiver transitions to the 'valid' state."; } leaf excluded-event-records { type yang:zero-based-counter64; config false; description "The number of event records explicitly removed via either an event stream filter or an access control filter so that they are not passed to a receiver. This count is set to zero each time 'sent-event-records' is initialized."; } leaf state { type enumeration { enum active { value 1; description "The receiver is currently being sent any applicable notification messages for the subscription."; } enum suspended { value 2; description "The receiver state is 'suspended', so the publisher is currently unable to provide notification messages for the subscription."; } enum connecting { value 3; if-feature "configured"; description "A subscription has been configured, but a 'subscription-started' subscription state change notification needs to be successfully received before notification messages are sent.
leaf sent-event-records { type yang:zero-based-counter64; config false; description "The number of event records sent to the receiver. The count is initialized when a dynamic subscription is established or when a configured receiver transitions to the 'valid' state."; } leaf excluded-event-records { type yang:zero-based-counter64; config false; description "The number of event records explicitly removed via either an event stream filter or an access control filter so that they are not passed to a receiver. This count is set to zero each time 'sent-event-records' is initialized."; } leaf state { type enumeration { enum active { value 1; description "The receiver is currently being sent any applicable notification messages for the subscription."; } enum suspended { value 2; description "The receiver state is 'suspended', so the publisher is currently unable to provide notification messages for the subscription."; } enum connecting { value 3; if-feature "configured"; description "A subscription has been configured, but a 'subscription-started' subscription state change notification needs to be successfully received before notification messages are sent.
If the 'reset' action is invoked for a receiver of an active configured subscription, the state must be moved to 'connecting'."; }
If the 'reset' action is invoked for a receiver of an active configured subscription, the state must be moved to 'connecting'."; }
enum disconnected { value 4; if-feature "configured"; description "A subscription has failed to send a 'subscription-started' state change to the receiver. Additional connection attempts are not currently being made."; } } config false; mandatory true; description "Specifies the state of a subscription from the perspective of a particular receiver. With this information, it is possible to determine whether a publisher is currently generating notification messages intended for that receiver."; } action reset { if-feature "configured"; description "Allows the reset of this configured subscription's receiver to the 'connecting' state. This enables the connection process to be reinitiated."; output { leaf time { type yang:date-and-time; mandatory true; description "Time at which a publisher returned the receiver to the 'connecting' state."; } } } } } } } } <CODE ENDS>
enum disconnected { value 4; if-feature "configured"; description "A subscription has failed to send a 'subscription-started' state change to the receiver. Additional connection attempts are not currently being made."; } } config false; mandatory true; description "Specifies the state of a subscription from the perspective of a particular receiver. With this information, it is possible to determine whether a publisher is currently generating notification messages intended for that receiver."; } action reset { if-feature "configured"; description "Allows the reset of this configured subscription's receiver to the 'connecting' state. This enables the connection process to be reinitiated."; output { leaf time { type yang:date-and-time; mandatory true; description "Time at which a publisher returned the receiver to the 'connecting' state."; } } } } } } } } <CODE ENDS>
IANA has registered one URI in the "ns" subregistry of the "IETF XML Registry" [RFC3688] maintained at <https://www.iana.org/assignments/ xml-registry>. The following registration has been made per the format in [RFC3688]:
IANA已在“IETF XML注册表”[RFC3688]的“ns”子区注册了一个URI,该子区位于<https://www.iana.org/assignments/ xml注册表>。已按照[RFC3688]中的格式进行了以下注册:
URI: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications Registrant Contact: The NETCONF WG of the IETF. XML: N/A; the requested URI is an XML namespace.
URI:urn:ietf:params:xml:ns:yang:ietf订阅通知注册人联系人:ietf的NETCONF工作组。XML:不适用;请求的URI是一个XML命名空间。
IANA has registered one YANG module in the "YANG Module Names" registry [RFC6020] maintained at <https://www.iana.org/assignments/ yang-parameters>. The following registration has been made per the format in [RFC6020]:
IANA已在位于的“YANG模块名称”注册表[RFC6020]中注册了一个YANG模块<https://www.iana.org/assignments/ 杨参数>。已按照[RFC6020]中的格式进行了以下注册:
Name: ietf-subscribed-notifications Namespace: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications Prefix: sn Reference: RFC 8639
Name: ietf-subscribed-notifications Namespace: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications Prefix: sn Reference: RFC 8639
To support deployments that include both configured and dynamic subscriptions, it is recommended that the subscription "id" domain be split into static and dynamic halves. This will eliminate the possibility of collisions if the configured subscriptions attempt to set a "subscription-id" that might have already been dynamically allocated. A best practice is to use the lower half of the "id" object's integer space when that "id" is assigned by an external entity (such as with a configured subscription). This leaves the upper half of the subscription integer space available to be dynamically assigned by the publisher.
要支持同时包含已配置订阅和动态订阅的部署,建议将订阅“id”域拆分为静态和动态两部分。如果配置的订阅试图设置可能已动态分配的“订阅id”,这将消除冲突的可能性。最佳实践是,当外部实体(如配置的订阅)分配“id”时,使用“id”对象整数空间的下半部分。这样,发布服务器就可以动态分配订阅整数空间的上半部分。
If a subscription is unable to marshal a series of filtered event records into transmittable notification messages, the receiver should be suspended with the reason "unsupportable-volume".
如果订阅无法将一系列经过筛选的事件记录封送到可传输的通知消息中,则应以“不支持卷”为理由暂停接收器。
For configured subscriptions, operations are performed against the set of receivers using the subscription "id" as a handle for that set. But for streaming updates, subscription state change notifications are local to a receiver. In the case of this specification, receivers do not get any information from the publisher about the existence of other receivers. But if a network operator wants to let the receivers correlate results, it is useful to use the subscription "id" across the receivers to allow that
对于已配置的订阅,将使用订阅“id”作为该集的句柄,对接收器集执行操作。但对于流式更新,订阅状态更改通知对于接收方来说是本地的。在本规范的情况下,接收者不会从发布者那里获得关于其他接收者存在的任何信息。但是,如果网络运营商希望让接收器关联结果,那么在接收器之间使用订阅“id”是很有用的
correlation. Note that due to the possibility of different access control permissions per receiver, each receiver may actually get a different set of event records.
相关性请注意,由于每个接收器可能具有不同的访问控制权限,因此每个接收器实际上可能会获得不同的事件记录集。
For configured replay subscriptions, the receiver is protected from duplicated events being pushed after a publisher is rebooted. However, it is possible that a receiver might want to acquire event records that failed to be delivered just prior to the reboot. Delivering these event records can be accomplished by leveraging the <eventTime> [RFC5277] from the last event record received prior to the receipt of a "subscription-started" subscription state change notification. With this <eventTime> and the "replay-start-time" from the "subscription-started" notification, an independent dynamic subscription can be established that retrieves any event records that may have been generated but not sent to the receiver.
对于已配置的重播订阅,在重新启动发布服务器后,将保护接收器不受重复事件的影响。但是,接收器可能希望获取在重新启动之前未能传递的事件记录。通过利用在收到“订阅已启动”订阅状态更改通知之前收到的最后一条事件记录中的<eventTime>[RFC5277],可以完成这些事件记录的交付。使用此<eventTime>和“订阅已启动”通知中的“重播开始时间”,可以建立一个独立的动态订阅,以检索可能已生成但未发送给接收方的任何事件记录。
This section provides requirements for any subscribed notification transport supporting the solution presented in this document.
本节提供了支持本文档中介绍的解决方案的任何订阅通知传输的要求。
The transport selected by the subscriber to reach the publisher MUST be able to support multiple "establish-subscription" requests made in the same transport session.
订阅服务器选择的到达发布服务器的传输必须能够支持在同一传输会话中发出的多个“建立订阅”请求。
For both configured and dynamic subscriptions, the publisher MUST authenticate a receiver via some transport-level mechanism before sending any event records that the receiver is authorized to see. In addition, the receiver MUST authenticate the publisher at the transport level. The result is mutual authentication between the two.
对于已配置订阅和动态订阅,发布者必须通过某种传输级别机制对接收方进行身份验证,然后才能发送接收方有权查看的任何事件记录。此外,接收方必须在传输级别对发布服务器进行身份验证。结果是两者之间的相互认证。
A secure transport is highly recommended. Beyond this, the publisher MUST ensure that the receiver has sufficient authorization to perform the function it is requesting against the specific subset of content involved.
强烈建议使用安全的传输方式。除此之外,发布者还必须确保接收者有足够的权限针对所涉及的特定内容子集执行其请求的功能。
A specification for a transport built upon this document may or may not choose to require the use of the same logical channel for the RPCs and the event records. However, the event records and the subscription state change notifications MUST be sent on the same transport session to ensure properly ordered delivery.
基于本文档构建的传输规范可能会或可能不会选择要求对RPC和事件记录使用相同的逻辑通道。但是,事件记录和订阅状态更改通知必须在同一传输会话上发送,以确保正确有序的传递。
A specification for a transport MUST identify any encodings that are supported. If a configured subscription's transport allows different encodings, the specification MUST identify the default encoding.
传输规范必须标识支持的任何编码。如果已配置订阅的传输允许不同的编码,则规范必须标识默认编码。
A subscriber that includes a "dscp" leaf in an "establish-subscription" request will need to understand and consider what the corresponding DSCP value represents in the domain of the publisher.
在“建立订阅”请求中包含“DSCP”页的订阅服务器将需要了解和考虑发布服务器域中相应的DSCP值所代表的内容。
Additional transport requirements will be dictated by the choice of transport used with a subscription. For an example of such requirements, see [RFC8640].
额外的传输要求将由订阅使用的传输选择决定。有关此类要求的示例,请参见[RFC8640]。
The YANG module specified in this document defines a schema for data that is designed to be accessed via network management protocols such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC5246].
本文档中指定的模块为数据定义了一个模式,该模式旨在通过网络管理协议(如NETCONF[RFC6241]或restcconf[RFC8040])进行访问。最低的NETCONF层是安全传输层,实现安全传输的强制要求是安全Shell(SSH)[RFC6242]。最低的RESTCONF层是HTTPS,实现安全传输的强制层是TLS[RFC5246]。
The Network Configuration Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.
网络配置访问控制模型(NACM)[RFC8341]提供了将特定NETCONF或RESTCONF用户的访问限制为所有可用NETCONF或RESTCONF协议操作和内容的预配置子集的方法。
With configured subscriptions, one or more publishers could be used to overwhelm a receiver. To counter this, notification messages SHOULD NOT be sent to any receiver that does not support this specification. Receivers that do not want notification messages need only terminate or refuse any transport sessions from the publisher.
通过配置订阅,可以使用一个或多个发布服务器来压倒接收者。为了应对这种情况,不应将通知消息发送给任何不支持此规范的接收器。不需要通知消息的接收者只需终止或拒绝来自发布者的任何传输会话。
When a receiver of a configured subscription gets a new "subscription-started" message for a known subscription where it is already consuming events, it may indicate that an attacker has done something that has momentarily disrupted receiver connectivity. To acquire events lost during this interval, the receiver SHOULD retrieve any event records generated since the last event record was received. This can be accomplished by establishing a separate dynamic replay subscription with the same filtering criteria with the publisher, assuming that the publisher supports the "replay" feature.
当已配置订阅的接收者收到已知订阅的新“subscription started”(订阅已启动)消息时,它可能表示攻击者做了一些暂时中断了接收者连接的事情。若要获取在此间隔期间丢失的事件,接收器应检索自收到最后一条事件记录以来生成的任何事件记录。假设发布服务器支持“重播”功能,则可以通过与发布服务器建立具有相同筛选条件的单独动态重播订阅来实现这一点。
For dynamic subscriptions, implementations need to protect against malicious or buggy subscribers that may send a large number of "establish-subscription" requests and thereby use up system resources. To cover this possibility, operators SHOULD monitor for such cases and, if discovered, take remedial action to limit the resources used, such as suspending or terminating a subset of the subscriptions or, if the underlying transport is session based, terminating the underlying transport session.
对于动态订阅,实现需要防止恶意或有缺陷的订阅服务器发送大量“建立订阅”请求,从而耗尽系统资源。为了解决这种可能性,运营商应监控此类情况,如果发现,应采取补救措施限制使用的资源,例如暂停或终止订阅子集,或者,如果基础传输基于会话,则终止基础传输会话。
The replay mechanisms described in Sections 2.4.2.1 and 2.5.6 provide access to historical event records. By design, the access control model that protects these records could enable subscribers to view data to which they were not authorized at the time of collection.
第2.4.2.1节和第2.5.6节中描述的重播机制提供了对历史事件记录的访问。根据设计,保护这些记录的访问控制模型可以使订阅者查看收集时未经授权的数据。
Using DNS names for configured subscription's receiver "name" lookups can cause situations where the name resolves differently than expected on the publisher, so the recipient would be different than expected.
将DNS名称用于已配置订阅的接收器“名称”查找可能会导致名称解析与发布服务器上的预期不同的情况,因此收件人可能与预期不同。
An attacker that can cause the publisher to use an incorrect time can induce message replay by setting the time in the past and can introduce a risk of message loss by setting the time in the future.
攻击者可导致发布者使用不正确的时间,可通过在过去设置时间来诱导消息重播,并通过在将来设置时间来引入消息丢失的风险。
There are a number of data nodes defined in this YANG module that are writable/creatable/deletable (i.e., config true, which is the default). These data nodes may be considered sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) to these data nodes without proper protection can have a negative effect on network operations. These are the subtrees and data nodes and their sensitivity/vulnerability:
此模块中定义了许多可写/可创建/可删除的数据节点(即,默认为config true)。在某些网络环境中,这些数据节点可能被视为敏感或易受攻击。对这些数据节点的写入操作(如编辑配置)如果没有适当的保护,可能会对网络操作产生负面影响。这些是子树和数据节点及其敏感性/漏洞:
Container: "/filters"
容器:“/filters”
o "stream-subtree-filter": Updating a filter could increase the computational complexity of all referencing subscriptions.
o “流子树过滤器”:更新过滤器可能会增加所有引用订阅的计算复杂性。
o "stream-xpath-filter": Updating a filter could increase the computational complexity of all referencing subscriptions.
o “流xpath筛选器”:更新筛选器可能会增加所有引用订阅的计算复杂性。
Container: "/subscriptions"
容器:“/subscriptions”
The following considerations are only relevant for configuration operations made upon configured subscriptions:
以下注意事项仅与配置订阅时进行的配置操作相关:
o "configured-replay": Can be used to send a large number of event records to a receiver.
o “配置重播”:可用于向接收器发送大量事件记录。
o "dependency": Can be used to force important traffic to be queued behind updates that are not as important.
o “依赖性”:可用于强制重要流量在不重要的更新后排队。
o "dscp": If unvalidated, can result in the sending of traffic with a higher-priority marking than warranted.
o “dscp”:如果未验证,可能导致发送优先级标记高于保证的流量。
o "id": Can overwrite an existing subscription, perhaps one configured by another entity.
o “id”:可以覆盖现有订阅,可能是由另一个实体配置的订阅。
o "name": Adding a new key entry can be used to attempt to send traffic to an unwilling receiver.
o “名称”:添加一个新的密钥条目可用于尝试向不愿意的接收者发送通信量。
o "replay-start-time": Can be used to push very large logs, wasting resources.
o “重播开始时间”:可用于推送非常大的日志,浪费资源。
o "source-address": The configured address might not be able to reach a desired receiver.
o “源地址”:配置的地址可能无法到达所需的接收器。
o "source-interface": The configured interface might not be able to reach a desired receiver.
o “源接口”:配置的接口可能无法到达所需的接收器。
o "source-vrf": Can place a subscription in a virtual network where receivers are not entitled to view the subscribed content.
o “源vrf”:可以将订阅放在虚拟网络中,在该虚拟网络中,接收者无权查看订阅的内容。
o "stop-time": Could be used to terminate content at an inopportune time.
o “停止时间”:可用于在不合适的时间终止内容。
o "stream": Could set a subscription to an event stream that does not contain content permitted for the targeted receivers.
o “流”:可以设置对不包含目标接收者允许的内容的事件流的订阅。
o "stream-filter-name": Could be set to a filter that is not relevant to the event stream.
o “流筛选器名称”:可以设置为与事件流无关的筛选器。
o "stream-subtree-filter": A complex filter can increase the computational resources for this subscription.
o “流子树过滤器”:复杂过滤器可以增加此订阅的计算资源。
o "stream-xpath-filter": A complex filter can increase the computational resources for this subscription.
o “流xpath筛选器”:复杂筛选器可以增加此订阅的计算资源。
o "weighting": Allocating a large weight can overwhelm the dequeuing of other subscriptions.
o “权重”:分配较大的权重可能会压倒其他订阅的排队。
Some of the readable data nodes in this YANG module may be considered sensitive or vulnerable in some network environments. It is thus important to control read access (e.g., via get, get-config, or notification) to these data nodes. These are the subtrees and data nodes and their sensitivity/vulnerability:
在某些网络环境中,此模块中的某些可读数据节点可能被视为敏感或易受攻击。因此,控制对这些数据节点的读取访问(例如,通过get、get config或通知)非常重要。这些是子树和数据节点及其敏感性/漏洞:
Container: "/streams"
容器:“/streams”
o "name": If access control is not properly configured, can expose system internals to those who should not have access to this information.
o “名称”:如果未正确配置访问控制,则可能会将系统内部构件暴露给不应访问此信息的人。
o "replay-support": If access control is not properly configured, can expose logs to those who should not have access.
o “重播支持”:如果未正确配置访问控制,则可能会将日志暴露给不应有访问权限的人。
Container: "/subscriptions"
容器:“/subscriptions”
o "excluded-event-records": This leaf can provide information about filtered event records. A network operator should have the proper permissions to know about such filtering. However, exposing the count of excluded events to a receiver could leak information about the presence of access control filters that might be in place for that receiver.
o “排除的事件记录”:此叶可以提供有关已过滤事件记录的信息。网络运营商应具有了解此类过滤的适当权限。但是,将排除事件的计数公开给接收器可能会泄漏有关该接收器可能存在的访问控制筛选器的信息。
o "subscription": Different operational teams might have a desire to set varying subsets of subscriptions. Access control should be designed to permit read access to just the allowed set.
o “订阅”:不同的运营团队可能希望设置不同的订阅子集。访问控制的设计应允许仅对允许的集合进行读取访问。
Some of the RPC operations in this YANG module may be considered sensitive or vulnerable in some network environments. It is thus important to control access to these operations. These are the operations and their sensitivity/vulnerability:
在某些网络环境中,此模块中的某些RPC操作可能被视为敏感或易受攻击。因此,控制对这些操作的访问非常重要。这些是操作及其敏感性/脆弱性:
RPC: all
RPC:全部
o If a malicious or buggy subscriber sends an unexpectedly large number of RPCs, the result might be an excessive use of system resources on the publisher just to determine that these subscriptions should be declined. In such a situation, subscription interactions MAY be terminated by terminating the transport session.
o 如果恶意订阅服务器或有缺陷的订阅服务器发送了意外的大量RPC,则结果可能是过度使用发布服务器上的系统资源来确定应拒绝这些订阅。在这种情况下,可以通过终止传输会话来终止订阅交互。
RPC: "delete-subscription"
RPC:“删除订阅”
o No special considerations.
o 没有特别考虑。
RPC: "establish-subscription"
RPC:“建立订阅”
o Subscriptions could overload a publisher's resources. For this reason, publishers MUST ensure that they have sufficient resources to fulfill this request; otherwise, they MUST reject the request.
o 订阅可能会使发布者的资源过载。因此,出版商必须确保他们有足够的资源来满足这一要求;否则,他们必须拒绝该请求。
RPC: "kill-subscription"
RPC:“终止订阅”
o The "kill-subscription" RPC MUST be secured so that only connections with administrative rights are able to invoke this RPC.
o 必须保护“kill subscription”RPC,以便只有具有管理权限的连接才能调用此RPC。
RPC: "modify-subscription"
RPC:“修改订阅”
o Subscriptions could overload a publisher's resources. For this reason, publishers MUST ensure that they have sufficient resources to fulfill this request; otherwise, they MUST reject the request.
o 订阅可能会使发布者的资源过载。因此,出版商必须确保他们有足够的资源来满足这一要求;否则,他们必须拒绝该请求。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<https://www.rfc-editor.org/info/rfc2119>.
[RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, "Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers", RFC 2474, DOI 10.17487/RFC2474, December 1998, <https://www.rfc-editor.org/info/rfc2474>.
[RFC2474]Nichols,K.,Blake,S.,Baker,F.,和D.Black,“IPv4和IPv6报头中区分服务字段(DS字段)的定义”,RFC 2474,DOI 10.17487/RFC2474,1998年12月<https://www.rfc-editor.org/info/rfc2474>.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, <https://www.rfc-editor.org/info/rfc3688>.
[RFC3688]Mealling,M.,“IETF XML注册表”,BCP 81,RFC 3688,DOI 10.17487/RFC3688,2004年1月<https://www.rfc-editor.org/info/rfc3688>.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/RFC5246, August 2008, <https://www.rfc-editor.org/info/rfc5246>.
[RFC5246]Dierks,T.和E.Rescorla,“传输层安全(TLS)协议版本1.2”,RFC 5246,DOI 10.17487/RFC5246,2008年8月<https://www.rfc-editor.org/info/rfc5246>.
[RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008, <https://www.rfc-editor.org/info/rfc5277>.
[RFC5277]Chisholm,S.和H.Trevino,“NETCONF事件通知”,RFC 5277,DOI 10.17487/RFC5277,2008年7月<https://www.rfc-editor.org/info/rfc5277>.
[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, October 2010, <https://www.rfc-editor.org/info/rfc6020>.
[RFC6020]Bjorklund,M.,Ed.“YANG-网络配置协议的数据建模语言(NETCONF)”,RFC 6020,DOI 10.17487/RFC6020,2010年10月<https://www.rfc-editor.org/info/rfc6020>.
[RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, <https://www.rfc-editor.org/info/rfc6241>.
[RFC6241]Enns,R.,Ed.,Bjorklund,M.,Ed.,Schoenwaeld,J.,Ed.,和A.Bierman,Ed.,“网络配置协议(NETCONF)”,RFC 6241,DOI 10.17487/RFC6241,2011年6月<https://www.rfc-editor.org/info/rfc6241>.
[RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, <https://www.rfc-editor.org/info/rfc6242>.
[RFC6242]Wasserman,M.“在安全外壳上使用NETCONF协议(SSH)”,RFC 6242,DOI 10.17487/RFC6242,2011年6月<https://www.rfc-editor.org/info/rfc6242>.
[RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", RFC 6991, DOI 10.17487/RFC6991, July 2013, <https://www.rfc-editor.org/info/rfc6991>.
[RFC6991]Schoenwaeld,J.,Ed.,“常见杨数据类型”,RFC 6991,DOI 10.17487/RFC69911913年7月<https://www.rfc-editor.org/info/rfc6991>.
[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, August 2016, <https://www.rfc-editor.org/info/rfc7950>.
[RFC7950]Bjorklund,M.,Ed.“YANG 1.1数据建模语言”,RFC 7950,DOI 10.17487/RFC7950,2016年8月<https://www.rfc-editor.org/info/rfc7950>.
[RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", RFC 7951, DOI 10.17487/RFC7951, August 2016, <https://www.rfc-editor.org/info/rfc7951>.
[RFC7951]Lhotka,L.,“用YANG建模的数据的JSON编码”,RFC 7951,DOI 10.17487/RFC7951,2016年8月<https://www.rfc-editor.org/info/rfc7951>.
[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, <https://www.rfc-editor.org/info/rfc8040>.
[RFC8040]Bierman,A.,Bjorklund,M.,和K.Watsen,“RESTCONF协议”,RFC 8040,DOI 10.17487/RFC8040,2017年1月<https://www.rfc-editor.org/info/rfc8040>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8174]Leiba,B.,“RFC 2119关键词中大写与小写的歧义”,BCP 14,RFC 8174,DOI 10.17487/RFC8174,2017年5月<https://www.rfc-editor.org/info/rfc8174>.
[RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration Access Control Model", STD 91, RFC 8341, DOI 10.17487/RFC8341, March 2018, <https://www.rfc-editor.org/info/rfc8341>.
[RFC8341]Bierman,A.和M.Bjorklund,“网络配置访问控制模型”,STD 91,RFC 8341,DOI 10.17487/RFC8341,2018年3月<https://www.rfc-editor.org/info/rfc8341>.
[RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., and R. Wilton, "Network Management Datastore Architecture (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, <https://www.rfc-editor.org/info/rfc8342>.
[RFC8342]Bjorklund,M.,Schoenwaeld,J.,Shafer,P.,Watsen,K.,和R.Wilton,“网络管理数据存储体系结构(NMDA)”,RFC 8342,DOI 10.17487/RFC8342,2018年3月<https://www.rfc-editor.org/info/rfc8342>.
[RFC8343] Bjorklund, M., "A YANG Data Model for Interface Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, <https://www.rfc-editor.org/info/rfc8343>.
[RFC8343]Bjorklund,M.,“用于接口管理的YANG数据模型”,RFC 8343,DOI 10.17487/RFC8343,2018年3月<https://www.rfc-editor.org/info/rfc8343>.
[RFC8529] Berger, L., Hopps, C., Lindem, A., Bogdanovic, D., and X. Liu, "YANG Data Model for Network Instances", RFC 8529, DOI 10.17487/RFC8529, March 2019, <https://www.rfc-editor.org/info/rfc8529>.
[RFC8529]Berger,L.,Hopps,C.,Lindem,A.,Bogdanovic,D.,和X.Liu,“网络实例的杨数据模型”,RFC 8529,DOI 10.17487/RFC85292019年3月<https://www.rfc-editor.org/info/rfc8529>.
[W3C.REC-xml-20081126] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", World Wide Web Consortium Recommendation REC-xml-20081126, November 2008, <https://www.w3.org/TR/2008/REC-xml-20081126>.
[W3C.REC-xml-20081126]Bray,T.,Paoli,J.,Sperberg McQueen,M.,Maler,E.,和F.Yergeau,“可扩展标记语言(xml)1.0(第五版)”,万维网联盟建议REC-xml-20081126,2008年11月<https://www.w3.org/TR/2008/REC-xml-20081126>.
[XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", November 1999, <https://www.w3.org/TR/1999/REC-xpath-19991116>.
[XPATH]Clark,J.和S.DeRose,“XML路径语言(XPATH)1.0版”,1999年11月<https://www.w3.org/TR/1999/REC-xpath-19991116>.
[RESTCONF-Notif] Voit, E., Rahman, R., Nilsen-Nygaard, E., Clemm, A., and A. Bierman, "Dynamic subscription to YANG Events and Datastores over RESTCONF", Work in Progress, draft-ietf-netconf-restconf-notif-15, June 2019.
[RESTCONF Notif]Voit,E.,Rahman,R.,Nilsen Nygaard,E.,Clemm,A.,和A.Bierman,“通过RESTCONF动态订阅YANG事件和数据存储”,正在进行的工作,草稿-ietf-netconf-RESTCONF-Notif-15,2019年6月。
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7049]Bormann,C.和P.Hoffman,“简明二进制对象表示法(CBOR)”,RFC 7049,DOI 10.17487/RFC7049,2013年10月<https://www.rfc-editor.org/info/rfc7049>.
[RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>.
[RFC7540]Belshe,M.,Paon,R.,和M.Thomson,编辑,“超文本传输协议版本2(HTTP/2)”,RFC 7540,DOI 10.17487/RFC7540,2015年5月<https://www.rfc-editor.org/info/rfc7540>.
[RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements for Subscription to YANG Datastores", RFC 7923, DOI 10.17487/RFC7923, June 2016, <https://www.rfc-editor.org/info/rfc7923>.
[RFC7923]Voit,E.,Clemm,A.和A.Gonzalez Prieto,“YANG数据存储订阅要求”,RFC 7923,DOI 10.17487/RFC79232016年6月<https://www.rfc-editor.org/info/rfc7923>.
[RFC8071] Watsen, K., "NETCONF Call Home and RESTCONF Call Home", RFC 8071, DOI 10.17487/RFC8071, February 2017, <https://www.rfc-editor.org/info/rfc8071>.
[RFC8071]Watsen,K.,“NETCONF呼叫总部和RESTCONF呼叫总部”,RFC 8071,DOI 10.17487/RFC8071,2017年2月<https://www.rfc-editor.org/info/rfc8071>.
[RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, <https://www.rfc-editor.org/info/rfc8259>.
[RFC8259]Bray,T.,Ed.“JavaScript对象表示法(JSON)数据交换格式”,STD 90,RFC 8259,DOI 10.17487/RFC8259,2017年12月<https://www.rfc-editor.org/info/rfc8259>.
[RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, <https://www.rfc-editor.org/info/rfc8340>.
[RFC8340]Bjorklund,M.和L.Berger,编辑,“杨树图”,BCP 215,RFC 8340,DOI 10.17487/RFC8340,2018年3月<https://www.rfc-editor.org/info/rfc8340>.
[RFC8640] Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard, E., and A. Tripathy, "Dynamic Subscription to YANG Events and Datastores over NETCONF", RFC 8640, DOI 10.17487/RFC8640, September 2019, <https://www.rfc-editor.org/info/rfc8640>.
[RFC8640]Voit,E.,Clemm,A.,Gonzalez-Prieto,A.,Nilsen-Nygaard,E.,和A.Tripathy,“通过NETCONF动态订阅YANG事件和数据存储”,RFC 8640,DOI 10.17487/RFC8640,2019年9月<https://www.rfc-editor.org/info/rfc8640>.
[RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, September 2019, <https://www.rfc-editor.org/info/rfc8641>.
[RFC8641]Clemm,A.和E.Voit,“数据存储更新的YANG通知订阅”,RFC 8641,DOI 10.17487/RFC8641,2019年9月<https://www.rfc-editor.org/info/rfc8641>.
This appendix provides a non-normative example of how the YANG module defined in Section 4 may be enhanced to incorporate the configuration parameters needed to support the transport connectivity process. This example is not intended to be a complete transport model. In this example, connectivity via an imaginary transport type of "foo" is explored. For more on the overall objectives behind configuring transport connectivity for a configured subscription, see Section 2.5.7.
本附录提供了一个非规范性示例,说明如何增强第4节中定义的YANG模块,以纳入支持传输连接过程所需的配置参数。本示例并不打算成为一个完整的传输模型。在本例中,探讨了通过虚拟传输类型“foo”的连接。有关为已配置订阅配置传输连接的总体目标的更多信息,请参阅第2.5.7节。
The YANG module example defined in this appendix contains two main elements. First is a transport identity "foo". This transport identity allows a configuration agent to define "foo" as the selected type of transport for a subscription. Second is a YANG case augmentation "foo", which is made to the "/subscriptions/subscription/receivers/receiver" node of Section 4. In this augmentation are the transport configuration parameters "address" and "port", which are necessary to make the connection to the receiver.
本附录中定义的YANG模块示例包含两个主要元素。首先是运输标识“foo”。此传输标识允许配置代理将“foo”定义为订阅的选定传输类型。第二个是对第4节的“/subscriptions/subscription/receivers/receivers”节点进行的杨格扩充“foo”。在此扩展中,传输配置参数“地址”和“端口”是连接到接收器所必需的。
module example-foo-subscribed-notifications { yang-version 1.1; namespace "urn:example:foo-subscribed-notifications";
module example-foo-subscribed-notifications { yang-version 1.1; namespace "urn:example:foo-subscribed-notifications";
prefix fsn;
前缀fsn;
import ietf-subscribed-notifications { prefix sn; } import ietf-inet-types { prefix inet; }
import ietf-subscribed-notifications { prefix sn; } import ietf-inet-types { prefix inet; }
description "Defines 'foo' as a supported type of configured transport for subscribed event notifications.";
description“将'foo'定义为订阅事件通知的受支持的配置传输类型。”;
identity foo { base sn:transport; description "Transport type 'foo' is available for use as a configured subscription's transport protocol for subscribed notifications."; }
identity foo { base sn:transport; description "Transport type 'foo' is available for use as a configured subscription's transport protocol for subscribed notifications."; }
augment "/sn:subscriptions/sn:subscription/sn:receivers/sn:receiver" { when 'derived-from(../../../transport, "fsn:foo")'; description "This augmentation makes transport parameters specific to 'foo' available for a receiver."; leaf address { type inet:host; mandatory true; description "Specifies the address to use for messages destined for a receiver."; } leaf port { type inet:port-number; mandatory true; description "Specifies the port number to use for messages destined for a receiver."; } } }
augment "/sn:subscriptions/sn:subscription/sn:receivers/sn:receiver" { when 'derived-from(../../../transport, "fsn:foo")'; description "This augmentation makes transport parameters specific to 'foo' available for a receiver."; leaf address { type inet:host; mandatory true; description "Specifies the address to use for messages destined for a receiver."; } leaf port { type inet:port-number; mandatory true; description "Specifies the port number to use for messages destined for a receiver."; } } }
Figure 21: Example Transport Augmentation for the Fictitious Protocol "foo"
图21:虚拟协议“foo”的传输增强示例
This example YANG module for transport "foo" will not be seen in a real-world deployment. For a real-world deployment supporting an actual transport technology, a similar YANG module must be defined.
在实际部署中不会看到此传输模块“foo”的示例。对于支持实际传输技术的实际部署,必须定义类似的模块。
Acknowledgments
致谢
For their valuable comments, discussions, and feedback, we wish to acknowledge Andy Bierman, Tim Jenkins, Martin Bjorklund, Kent Watsen, Balazs Lengyel, Robert Wilton, Sharon Chisholm, Hector Trevino, Susan Hares, Michael Scharf, and Guangying Zheng.
对于他们的宝贵意见、讨论和反馈,我们要感谢Andy Bierman、Tim Jenkins、Martin Bjorklund、Kent Watsen、Balazs Lengyel、Robert Wilton、Sharon Chisholm、Hector Trevino、Susan Hares、Michael Scharf和郑光英。
Authors' Addresses
作者地址
Eric Voit Cisco Systems
Eric Voit思科系统公司
Email: evoit@cisco.com
Email: evoit@cisco.com
Alexander Clemm Futurewei
亚历山大·克莱姆未来
Email: ludwig@clemm.org
Email: ludwig@clemm.org
Alberto Gonzalez Prieto Microsoft
Alberto Gonzalez Prieto微软
Email: alberto.gonzalez@microsoft.com
Email: alberto.gonzalez@microsoft.com
Einar Nilsen-Nygaard Cisco Systems
艾纳·尼尔森·尼加德思科系统公司
Email: einarnn@cisco.com
Email: einarnn@cisco.com
Ambika Prasad Tripathy Cisco Systems
Ambika Prasad Tripathy思科系统公司
Email: ambtripa@cisco.com
Email: ambtripa@cisco.com