1 module ietf-yang-push {
3 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-push";
6 import ietf-yang-types {
9 "RFC 6991: Common YANG Data Types";
11 import ietf-subscribed-notifications {
14 "RFC 8639: Subscription to YANG Notifications";
16 import ietf-datastores {
19 "RFC 8342: Network Management Datastore Architecture (NMDA)";
21 import ietf-restconf {
24 "RFC 8040: RESTCONF Protocol";
26 import ietf-yang-patch {
29 "RFC 8072: YANG Patch Media Type";
33 "IETF NETCONF (Network Configuration) Working Group";
35 "WG Web: <https:/datatracker.ietf.org/wg/netconf/>
36 WG List: <mailto:netconf@ietf.org>
38 Author: Alexander Clemm
39 <mailto:ludwig@clemm.org>
42 <mailto:evoit@cisco.com>";
45 "This module contains YANG specifications for YANG-Push.
47 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
48 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
49 'MAY', and 'OPTIONAL' in this document are to be interpreted as
50 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
51 they appear in all capitals, as shown here.
53 Copyright (c) 2019 IETF Trust and the persons identified as
54 authors of the code. All rights reserved.
56 Redistribution and use in source and binary forms, with or
57 without modification, is permitted pursuant to, and subject to
58 the license terms contained in, the Simplified BSD License set
59 forth in Section 4.c of the IETF Trust's Legal Provisions
60 Relating to IETF Documents
61 (https://trustee.ietf.org/license-info).
63 This version of this YANG module is part of RFC 8641; see the
64 RFC itself for full legal notices.";
70 "RFC 8641: Subscriptions to YANG Datastores";
79 "This feature indicates that on-change triggered subscriptions
87 /* Error type identities for datastore subscription */
89 identity resync-subscription-error {
91 "Problem found while attempting to fulfill a
92 'resync-subscription' RPC request.";
95 identity cant-exclude {
96 base sn:establish-subscription-error;
98 "Unable to remove the set of 'excluded-change' parameters.
99 This means that the publisher is unable to restrict
100 'push-change-update' notifications to just the change types
101 requested for this subscription.";
104 identity datastore-not-subscribable {
105 base sn:establish-subscription-error;
106 base sn:subscription-terminated-reason;
108 "This is not a subscribable datastore.";
111 identity no-such-subscription-resync {
112 base resync-subscription-error;
114 "The referenced subscription doesn't exist. This may be as a
115 result of a nonexistent subscription ID, an ID that belongs to
116 another subscriber, or an ID for a configured subscription.";
119 identity on-change-unsupported {
120 base sn:establish-subscription-error;
122 "On-change is not supported for any objects that are
123 selectable by this filter.";
126 identity on-change-sync-unsupported {
127 base sn:establish-subscription-error;
129 "Neither 'sync-on-start' nor resynchronization is supported for
130 this subscription. This error will be used for two reasons:
131 (1) if an 'establish-subscription' RPC includes
132 'sync-on-start' but the publisher can't support sending a
133 'push-update' for this subscription for reasons other than
134 'on-change-unsupported' or 'sync-too-big'
135 (2) if the 'resync-subscription' RPC is invoked for either an
136 existing periodic subscription or an on-change subscription
137 that can't support resynchronization.";
140 identity period-unsupported {
141 base sn:establish-subscription-error;
142 base sn:modify-subscription-error;
143 base sn:subscription-suspended-reason;
145 "The requested time period or 'dampening-period' is too short.
146 This can be for both periodic and on-change subscriptions
147 (with or without dampening). Hints suggesting alternative
148 periods may be returned as supplemental information.";
151 identity update-too-big {
152 base sn:establish-subscription-error;
153 base sn:modify-subscription-error;
154 base sn:subscription-suspended-reason;
156 "Periodic or on-change push update data trees exceed a maximum
157 size limit. Hints on the estimated size of what was too big
158 may be returned as supplemental information.";
161 identity sync-too-big {
162 base sn:establish-subscription-error;
163 base sn:modify-subscription-error;
164 base resync-subscription-error;
165 base sn:subscription-suspended-reason;
167 "The 'sync-on-start' or resynchronization data tree exceeds a
168 maximum size limit. Hints on the estimated size of what was
169 too big may be returned as supplemental information.";
172 identity unchanging-selection {
173 base sn:establish-subscription-error;
174 base sn:modify-subscription-error;
175 base sn:subscription-terminated-reason;
177 "The selection filter is unlikely to ever select data tree
178 nodes. This means that based on the subscriber's current
179 access rights, the publisher recognizes that the selection
180 filter is unlikely to ever select data tree nodes that change.
181 Examples for this might be that the node or subtree doesn't
182 exist, read access is not permitted for a receiver, or static
183 objects that only change at reboot have been chosen.";
190 typedef change-type {
194 "A change that refers to the creation of a new
199 "A change that refers to the deletion of a
204 "A change that refers to the insertion of a new
205 user-ordered datastore node.";
209 "A change that refers to a reordering of the target
214 "A change that refers to a replacement of the target
215 datastore node's value.";
219 "Specifies different types of datastore changes.
221 This type is based on the edit operations defined for
222 YANG Patch, with the difference that it is valid for a
223 receiver to process an update record that performs a
224 'create' operation on a datastore node the receiver believes
225 exists or to process a delete on a datastore node the
226 receiver believes is missing.";
228 "RFC 8072: YANG Patch Media Type, Section 2.5";
231 typedef selection-filter-ref {
233 path "/sn:filters/yp:selection-filter/yp:filter-id";
236 "This type is used to reference a selection filter.";
239 typedef centiseconds {
242 "A period of time, measured in units of 0.01 seconds.";
249 grouping datastore-criteria {
251 "A grouping to define criteria for which selected objects from
252 a targeted datastore should be included in push updates.";
259 "Datastore from which to retrieve data.";
261 uses selection-filter-objects;
264 grouping selection-filter-types {
266 "This grouping defines the types of selectors for objects
270 "The content filter specification for this request.";
271 anydata datastore-subtree-filter {
272 if-feature "sn:subtree";
274 "This parameter identifies the portions of the
275 target datastore to retrieve.";
277 "RFC 6241: Network Configuration Protocol (NETCONF),
280 leaf datastore-xpath-filter {
281 if-feature "sn:xpath";
284 "This parameter contains an XPath expression identifying
285 the portions of the target datastore to retrieve.
287 If the expression returns a node set, all nodes in the
288 node set are selected by the filter. Otherwise, if the
289 expression does not return a node set, the filter
290 doesn't select any nodes.
292 The expression is evaluated in the following XPath
295 o The set of namespace declarations is the set of prefix
296 and namespace pairs for all YANG modules implemented
297 by the server, where the prefix is the YANG module
298 name and the namespace is as defined by the
299 'namespace' statement in the YANG module.
301 If the leaf is encoded in XML, all namespace
302 declarations in scope on the 'stream-xpath-filter'
303 leaf element are added to the set of namespace
304 declarations. If a prefix found in the XML is
305 already present in the set of namespace declarations,
306 the namespace in the XML is used.
308 o The set of variable bindings is empty.
310 o The function library is comprised of the core
311 function library and the XPath functions defined in
312 Section 10 in RFC 7950.
314 o The context node is the root node of the target
317 "XML Path Language (XPath) Version 1.0
318 (https://www.w3.org/TR/1999/REC-xpath-19991116)
319 RFC 7950: The YANG 1.1 Data Modeling Language,
325 grouping selection-filter-objects {
327 "This grouping defines a selector for objects from a
329 choice selection-filter {
331 "The source of the selection filter applied to the
332 subscription. This will either (1) come referenced from a
333 global list or (2) be provided in the subscription itself.";
336 "Incorporates a filter that has been configured
338 leaf selection-filter-ref {
339 type selection-filter-ref;
342 "References an existing selection filter that is to be
343 applied to the subscription.";
346 case within-subscription {
348 "A local definition allows a filter to have the same
349 lifecycle as the subscription.";
350 uses selection-filter-types;
355 grouping update-policy-modifiable {
357 "This grouping describes the datastore-specific subscription
358 conditions that can be changed during the lifetime of the
360 choice update-trigger {
362 "Defines necessary conditions for sending an event record to
366 presence "indicates a periodic subscription";
368 "The publisher is requested to periodically notify the
369 receiver regarding the current values of the datastore
370 as defined by the selection filter.";
375 "Duration of time that should occur between periodic
376 push updates, in units of 0.01 seconds.";
379 type yang:date-and-time;
381 "Designates a timestamp before or after which a series
382 of periodic push updates are determined. The next
383 update will take place at a point in time that is a
384 multiple of a period from the 'anchor-time'.
385 For example, for an 'anchor-time' that is set for the
386 top of a particular minute and a period interval of a
387 minute, updates will be sent at the top of every
388 minute that this subscription is active.";
393 if-feature "on-change";
394 container on-change {
395 presence "indicates an on-change subscription";
397 "The publisher is requested to notify the receiver
398 regarding changes in values in the datastore subset as
399 defined by a selection filter.";
400 leaf dampening-period {
404 "Specifies the minimum interval between the assembly of
405 successive update records for a single receiver of a
406 subscription. Whenever subscribed objects change and
407 a dampening-period interval (which may be zero) has
408 elapsed since the previous update record creation for
409 a receiver, any subscribed objects and properties
410 that have changed since the previous update record
411 will have their current values marshalled and placed
412 in a new update record.";
419 grouping update-policy {
421 "This grouping describes the datastore-specific subscription
422 conditions of a subscription.";
423 uses update-policy-modifiable {
424 augment "update-trigger/on-change/on-change" {
426 "Includes objects that are not modifiable once a
427 subscription is established.";
432 "When this object is set to 'false', (1) it restricts an
433 on-change subscription from sending 'push-update'
434 notifications and (2) pushing a full selection per the
435 terms of the selection filter MUST NOT be done for
436 this subscription. Only updates about changes
437 (i.e., only 'push-change-update' notifications)
438 are sent. When set to 'true' (the default behavior),
439 in order to facilitate a receiver's synchronization,
440 a full update is sent, via a 'push-update' notification,
441 when the subscription starts. After that,
442 'push-change-update' notifications are exclusively sent,
443 unless the publisher chooses to resync the subscription
444 via a new 'push-update' notification.";
446 leaf-list excluded-change {
449 "Used to restrict which changes trigger an update. For
450 example, if a 'replace' operation is excluded, only the
451 creation and deletion of objects are reported.";
459 "Parameters associated with an error for a subscription
460 made upon a datastore.";
464 "Returned when the requested time period is too short. This
465 hint can assert a viable period for either a periodic push
466 cadence or an on-change dampening interval.";
468 leaf filter-failure-hint {
471 "Information describing where and/or why a provided filter
472 was unsupportable for a subscription.";
474 leaf object-count-estimate {
477 "If there are too many objects that could potentially be
478 returned by the selection filter, this identifies the
479 estimate of the number of objects that the filter would
482 leaf object-count-limit {
485 "If there are too many objects that could be returned by
486 the selection filter, this identifies the upper limit of
487 the publisher's ability to service this subscription.";
489 leaf kilobytes-estimate {
492 "If the returned information could be beyond the capacity
493 of the publisher, this would identify the estimated
494 data size that could result from this selection filter.";
496 leaf kilobytes-limit {
499 "If the returned information would be beyond the capacity
500 of the publisher, this identifies the upper limit of the
501 publisher's ability to service this subscription.";
509 rpc resync-subscription {
510 if-feature "on-change";
512 "This RPC allows a subscriber of an active on-change
513 subscription to request a full push of objects.
515 A successful invocation results in a 'push-update' of all
516 datastore nodes that the subscriber is permitted to access.
517 This RPC can only be invoked on the same session on which the
518 subscription is currently active. In the case of an error, a
519 'resync-subscription-error' is sent as part of an error
523 type sn:subscription-id;
526 "Identifier of the subscription that is to be resynced.";
531 rc:yang-data resync-subscription-error {
532 container resync-subscription-error {
534 "If a 'resync-subscription' RPC fails, the subscription is
535 not resynced and the RPC error response MUST indicate the
536 reason for this failure. This yang-data MAY be inserted as
537 structured data in a subscription's RPC error response
538 to indicate the reason for the failure.";
541 base resync-subscription-error;
545 "Indicates the reason why the publisher has declined a
546 request for subscription resynchronization.";
552 augment "/sn:establish-subscription/sn:input" {
554 "This augmentation adds additional subscription parameters
555 that apply specifically to datastore updates to RPC input.";
559 augment "/sn:establish-subscription/sn:input/sn:target" {
561 "This augmentation adds the datastore as a valid target
562 for the subscription to RPC input.";
565 "Information specifying the parameters of a request for a
566 datastore subscription.";
567 uses datastore-criteria;
571 rc:yang-data establish-subscription-datastore-error-info {
572 container establish-subscription-datastore-error-info {
574 "If any 'establish-subscription' RPC parameters are
575 unsupportable against the datastore, a subscription is not
576 created and the RPC error response MUST indicate the reason
577 why the subscription failed to be created. This yang-data
578 MAY be inserted as structured data in a subscription's
579 RPC error response to indicate the reason for the failure.
580 This yang-data MUST be inserted if hints are to be provided
581 back to the subscriber.";
584 base sn:establish-subscription-error;
587 "Indicates the reason why the subscription has failed to
588 be created to a targeted datastore.";
594 augment "/sn:modify-subscription/sn:input" {
596 "This augmentation adds additional subscription parameters
597 specific to datastore updates.";
598 uses update-policy-modifiable;
601 augment "/sn:modify-subscription/sn:input/sn:target" {
603 "This augmentation adds the datastore as a valid target
604 for the subscription to RPC input.";
607 "Information specifying the parameters of a request for a
608 datastore subscription.";
609 uses datastore-criteria;
613 rc:yang-data modify-subscription-datastore-error-info {
614 container modify-subscription-datastore-error-info {
616 "This yang-data MAY be provided as part of a subscription's
617 RPC error response when there is a failure of a
618 'modify-subscription' RPC that has been made against a
619 datastore. This yang-data MUST be used if hints are to be
620 provided back to the subscriber.";
623 base sn:modify-subscription-error;
626 "Indicates the reason why the subscription has failed to
637 notification push-update {
639 "This notification contains a push update that in turn contains
640 data subscribed to via a subscription. In the case of a
641 periodic subscription, this notification is sent for periodic
642 updates. It can also be used for synchronization updates of
643 an on-change subscription. This notification shall only be
644 sent to receivers of a subscription. It does not constitute
645 a general-purpose notification that would be subscribable as
646 part of the NETCONF event stream by any receiver.";
648 type sn:subscription-id;
650 "This references the subscription that drove the
651 notification to be sent.";
653 anydata datastore-contents {
655 "This contains the updated data. It constitutes a snapshot
656 at the time of update of the set of data that has been
657 subscribed to. The snapshot corresponds to the same
658 snapshot that would be returned in a corresponding 'get'
659 operation with the same selection filter parameters
662 leaf incomplete-update {
665 "This is a flag that indicates that not all datastore
666 nodes subscribed to are included with this update. In
667 other words, the publisher has failed to fulfill its full
668 subscription obligations and, despite its best efforts, is
669 providing an incomplete set of objects.";
673 notification push-change-update {
674 if-feature "on-change";
676 "This notification contains an on-change push update. This
677 notification shall only be sent to the receivers of a
678 subscription. It does not constitute a general-purpose
679 notification that would be subscribable as part of the
680 NETCONF event stream by any receiver.";
682 type sn:subscription-id;
684 "This references the subscription that drove the
685 notification to be sent.";
687 container datastore-changes {
689 "This contains the set of datastore changes of the target
690 datastore, starting at the time of the previous update, per
691 the terms of the subscription.";
692 uses ypatch:yang-patch;
694 leaf incomplete-update {
697 "The presence of this object indicates that not all changes
698 that have occurred since the last update are included with
699 this update. In other words, the publisher has failed to
700 fulfill its full subscription obligations -- for example,
701 in cases where it was not able to keep up with a burst of
706 augment "/sn:subscription-started" {
708 "This augmentation adds datastore-specific objects to
709 the notification that a subscription has started.";
713 augment "/sn:subscription-started/sn:target" {
715 "This augmentation allows the datastore to be included as
716 part of the notification that a subscription has started.";
718 uses datastore-criteria {
719 refine "selection-filter/within-subscription" {
721 "Specifies the selection filter and where it originated
722 from. If the 'selection-filter-ref' is populated, the
723 filter in the subscription came from the 'filters'
724 container. Otherwise, it is populated in-line as part
725 of the subscription itself.";
731 augment "/sn:subscription-modified" {
733 "This augmentation adds datastore-specific objects to
734 the notification that a subscription has been modified.";
738 augment "/sn:subscription-modified/sn:target" {
740 "This augmentation allows the datastore to be included as
741 part of the notification that a subscription has been
744 uses datastore-criteria {
745 refine "selection-filter/within-subscription" {
747 "Specifies the selection filter and where it originated
748 from. If the 'selection-filter-ref' is populated, the
749 filter in the subscription came from the 'filters'
750 container. Otherwise, it is populated in-line as part
751 of the subscription itself.";
761 augment "/sn:filters" {
763 "This augmentation allows the datastore to be included as part
764 of the selection-filtering criteria for a subscription.";
765 list selection-filter {
768 "A list of preconfigured filters that can be applied
769 to datastore subscriptions.";
773 "An identifier to differentiate between selection
776 uses selection-filter-types;
780 augment "/sn:subscriptions/sn:subscription" {
783 "This augmentation adds objects to a subscription that are
784 specific to a datastore subscription, i.e., a subscription to
785 a stream of datastore node updates.";
789 augment "/sn:subscriptions/sn:subscription/sn:target" {
791 "This augmentation allows the datastore to be included as
792 part of the selection-filtering criteria for a subscription.";
794 uses datastore-criteria;