blob: 9df4bde2bc4e896ce2ce96a9983005975b20e9b5 [file] [log] [blame]
sonugupta-huaweib5189f12017-12-11 17:28:58 +05301 module yrt-ietf-yang-push {
2 /*
3 * ---------------------------------------------------
4 * Not Supported
5 yang-version 1.1;
6 * ---------------------------------------------------
7 */
8 namespace "urn:ietf:params:xml:ns:yang:yrt-ietf-yang-push";
9 prefix yp;
10
11 import yrt-ietf-inet-types {
12 prefix inet;
13 }
14 import yrt-ietf-yang-types {
15 prefix yang;
16 }
17 import yrt-ietf-event-notifications {
18 prefix notif-bis;
19 }
20
21 organization "IETF";
22 contact
23 "WG Web: <http://tools.ietf.org/wg/netconf/>
24 WG List: <mailto:netconf@ietf.org>
25 WG Chair: Mahesh Jethanandani
26 <mailto:mjethanandani@gmail.com>
27 WG Chair: Mehmet Ersue
28 <mailto:mehmet.ersue@nokia.com>
29 Editor: Alexander Clemm
30 <mailto:alex@sympotech.com>
31 Editor: Eric Voit
32 <mailto:evoit@cisco.com>
33 Editor: Alberto Gonzalez Prieto
34 <mailto:albertgo@cisco.com>
35 Editor: Ambika Prasad Tripathy
36 <mailto:ambtripa@cisco.com>
37 Editor: Einar Nilsen-Nygaard
38 <mailto:einarnn@cisco.com>
39 Editor: Andy Bierman
40 <mailto:andy@yumaworks.com>
41 Editor: Balazs Lengyel
42 <mailto:balazs.lengyel@ericsson.com>";
43
44 description
45 "This module contains conceptual YANG specifications
46 for YANG push.";
47
48 revision 2016-10-28 {
49 description
50 "Updates to simplify modify-subscription, add anchor-time";
51 reference "YANG Datastore Push, draft-ietf-netconf-yang-push-04";
52 }
53
54 feature on-change {
55 description
56 "This feature indicates that on-change updates are
57 supported.";
58 }
59
60 /*
61 * IDENTITIES
62 */
63
64 /* Additional errors for subscription operations */
65 identity error-data-not-authorized {
66 base notif-bis:error;
67 description
68 "No read authorization for a requested data node.";
69 }
70
71 /* Additional types of streams */
72
73 identity yang-push {
74 base notif-bis:stream;
75 description
76 "A conceptual datastream consisting of all datastore
77 updates, including operational and configuration data.";
78 }
79
80 identity custom-stream {
81 base notif-bis:stream;
82 description
83 "A conceptual datastream for datastore
84 updates with custom updates as defined by a user.";
85 }
86
87 /* Additional transport option */
88 identity http2 {
89 base notif-bis:transport;
90 description
91 "HTTP2 notifications as a transport";
92 }
93
94 /*
95 * TYPE DEFINITIONS
96 */
97
98 typedef filter-id {
99 type uint32;
100 description
101 "A type to identify filters which can be associated with a
102 subscription.";
103 }
104
105 typedef change-type {
106 type enumeration {
107 enum "create" {
108 description
109 "A new data node was created";
110 }
111 enum "delete" {
112 description
113 "A data node was deleted";
114 }
115 enum "modify" {
116 description
117 "The value of a data node has changed";
118 }
119 }
120 description
121 "Specifies different types of changes that may occur
122 to a datastore.";
123 }
124
125
126 grouping update-filter {
127 description
128 "This groupings defines filters for push updates for a
129 datastore tree. The filters define which updates are of
130 interest in a push update subscription. Mixing and matching
131 of multiple filters does not occur at the level of this
132 grouping. When a push-update subscription is created, the
133 filter can be a regular subscription filter, or one of the
134 additional filters that are defined in this grouping.";
135 choice update-filter {
136 description
137 "Define filters regarding which data nodes to include
138 in push updates";
139 case subtree {
140 description
141 "Subtree filter.";
142 anyxml subtree-filter {
143 description
144 "Subtree-filter used to specify the data nodes targeted
145 for subscription within a subtree, or subtrees, of a
146 conceptual YANG datastore. Objects matching the filter
147 criteria will traverse the filter. The syntax follows
148 the subtree filter syntax specified in RFC 6241,
149 section 6.";
150 reference "RFC 6241 section 6";
151 }
152 }
153 case xpath {
154 description
155 "XPath filter";
156 leaf xpath-filter {
157 type yang:xpath1.0;
158 description
159 "Xpath defining the data items of interest.";
160 }
161 }
162 }
163 }
164
165 grouping update-policy {
166 description
167 "This grouping describes the conditions under which an
168 update will be sent as part of an update stream.";
169 choice update-trigger {
170 description
171 "Defines necessary conditions for sending an event to
172 the subscriber.";
173 case periodic {
174 description
175 "The agent is requested to notify periodically the
176 current values of the datastore or the subset
177 defined by the filter.";
178 leaf period {
179 type yang:timeticks;
180 mandatory true;
181 description
182 "Duration of time which should occur between periodic
183 push updates. Where the anchor of a start-time is
184 available, the push will include the objects and their
185 values which exist at an exact multiple of timeticks
186 aligning to this start-time anchor.";
187 }
188 leaf anchor-time {
189 type yang:date-and-time;
190 description
191 "Designates a timestamp from which the series of
192 periodic push updates are computed. The next update
193 will take place at the next period interval from the
194 anchor time. For example, for an anchor time at the
195 top of a minute and a period interval of a minute,
196 the next update will be sent at the top of the next
197 minute.";
198 }
199 }
200 case on-change {
201 if-feature "on-change";
202 description
203 "The agent is requested to notify changes in
204 values in the datastore or a subset of it defined
205 by a filter.";
206 leaf no-synch-on-start {
207 type empty;
208 description
209 "This leaf acts as a flag that determines behavior at the
210 start of the subscription. When present,
211 synchronization of state at the beginning of the
212 subscription is outside the scope of the subscription.
213 Only updates about changes that are observed from the
214 start time, i.e. only push-change-update notifications
215 are sent.
216 When absent (default behavior), in order to facilitate
217 a receiver's synchronization, a full update is sent
218 when the subscription starts using a push-update
219 notification, just like in the case of a periodic
220 subscription. After that, push-change-update
221 notifications only are sent unless the Publisher chooses
222 to resynch the subscription again.";
223 }
224 leaf dampening-period {
225 type yang:timeticks;
226 mandatory true;
227 description
228 "Minimum amount of time that needs to have
229 passed since the last time an update was
230 provided.";
231 }
232 leaf-list excluded-change {
233 type change-type;
234 description
235 "Use to restrict which changes trigger an update.
236 For example, if modify is excluded, only creation and
237 deletion of objects is reported.";
238 }
239 }
240 }
241 }
242
243 grouping subscription-qos {
244 description
245 "This grouping describes Quality of Service information
246 concerning a subscription. This information is passed to lower
247 layers for transport priortization and treatment";
248 leaf dscp {
249 if-feature "notif-bis:configured-subscriptions";
250 type inet:dscp;
251 default "0";
252 description
253 "The push update's IP packet transport priority.
254 This is made visible across network hops to receiver.
255 The transport priority is shared for all receivers of
256 a given subscription.";
257 }
258 leaf subscription-priority {
259 type uint8;
260 description
261 "Relative priority for a subscription. Allows an
262 underlying transport layer perform informed load
263 balance allocations between various subscriptions";
264 }
265 leaf subscription-dependency {
266 type string;
267 description
268 "Provides the Subscription ID of a parent subscription
269 without which this subscription should not exist. In
270 other words, there is no reason to stream these objects
271 if another subscription is missing.";
272 }
273 }
274
275 augment "/notif-bis:establish-subscription/notif-bis:input" {
276 description
277 "Define additional subscription parameters that apply
278 specifically to push updates";
279 uses update-policy;
280 uses subscription-qos;
281 }
282 augment "/notif-bis:establish-subscription/notif-bis:input/"+
283 "notif-bis:filter-type" {
284 description
285 "Add push filters to selection of filter types.";
286 case update-filter {
287 description
288 "Additional filter options for push subscription.";
289 uses update-filter;
290 }
291 }
292 augment "/notif-bis:establish-subscription/notif-bis:output" {
293 description
294 "Allow to return additional subscription parameters that apply
295 specifically to push updates.";
296 uses update-policy;
297 uses subscription-qos;
298 }
299 augment "/notif-bis:establish-subscription/notif-bis:output/"+
300 "notif-bis:result/notif-bis:no-success/notif-bis:filter-type" {
301 description
302 "Add push filters to selection of filter types.";
303 case update-filter {
304 description
305 "Additional filter options for push subscription.";
306 uses update-filter;
307 }
308 }
309 augment "/notif-bis:modify-subscription/notif-bis:input" {
310 description
311 "Define additional subscription parameters that apply
312 specifically to push updates.";
313 uses update-policy;
314 }
315 augment "/notif-bis:modify-subscription/notif-bis:input/"+
316 "notif-bis:filter-type" {
317 description
318 "Add push filters to selection of filter types.";
319 case update-filter {
320 description
321 "Additional filter options for push subscription.";
322 uses update-filter;
323 }
324 }
325 augment "/notif-bis:modify-subscription/notif-bis:output" {
326 description
327 "Allow to retun additional subscription parameters that apply
328 specifically to push updates.";
329 uses update-policy;
330 uses subscription-qos;
331 }
332 augment "/notif-bis:modify-subscription/notif-bis:output/"+
333 "notif-bis:result/notif-bis:no-success/notif-bis:filter-type" {
334 description
335 "Add push filters to selection of filter types.";
336 case update-filter {
337 description
338 "Additional filter options for push subscription.";
339 uses update-filter;
340 }
341 }
342 notification push-update {
343 description
344 "This notification contains a push update, containing
345 data subscribed to via a subscription.
346 This notification is sent for periodic updates, for a
347 periodic subscription. It can also be used for
348 synchronization updates of an on-change subscription.
349 This notification shall only be sent to receivers
350 of a subscription; it does not constitute a general-purpose
351 notification.";
352 leaf subscription-id {
353 type notif-bis:subscription-id;
354 mandatory true;
355 description
356 "This references the subscription because of which the
357 notification is sent.";
358 }
359 leaf time-of-update {
360 type yang:date-and-time;
361 description
362 "This leaf contains the time of the update.";
363 }
364 leaf updates-not-sent {
365 type empty;
366 description
367 "This is a flag which indicates that not all data nodes
368 subscribed to are included included with this
369 update. In other words, the publisher has failed to
370 fulfill its full subscription obligations.
371 This may lead to intermittent loss of synchronization
372 of data at the client. Synchronization at the client
373 can occur when the next push-update is received.";
374 }
375 /*
376 * --------------------------------------------------------------------
377 * datastore-contents not currently supported.
378 * Will replace datastore-contents-string in a future release.
379 anydata datastore-contents {
380 description
381 "This contains the updated data. It constitutes a snapshot
382 at the time-of-update of the set of data that has been
383 subscribed to. The format and syntax of the data
384 corresponds to the format and syntax of data that would be
385 returned in a corresponding get operation with the same
386 filter parameters applied.";
387 }
388 * --------------------------------------------------------------------
389 */
390 leaf datastore-contents-string {
391 type string;
392 description
393 "This contains the updated data. It constitutes a snapshot
394 at the time-of-update of the set of data that has been
395 subscribed to. The format and syntax of the data
396 corresponds to the format and syntax of data that would be
397 returned in a corresponding get operation with the same
398 filter parameters applied.";
399 }
400 /*
401 * --------------------------------------------------------------------
402 */
403
404 }
405 notification push-change-update {
406 if-feature "on-change";
407 description
408 "This notification contains an on-change push update.
409 This notification shall only be sent to the receivers
410 of a subscription; it does not constitute a general-purpose
411 notification.";
412 leaf subscription-id {
413 type notif-bis:subscription-id;
414 mandatory true;
415 description
416 "This references the subscription because of which the
417 notification is sent.";
418 }
419 leaf time-of-update {
420 type yang:date-and-time;
421 description
422 "This leaf contains the time of the update, i.e. the
423 time at which the change was observed.";
424 }
425 leaf updates-not-sent {
426 type empty;
427 description
428 "This is a flag which indicates that not all changes which
429 have occured since the last update are included with this
430 update. In other words, the publisher has failed to
431 fulfill its full subscription obligations, for example in
432 cases where it was not able to keep up with a change burst.
433 To facilitate synchronization, a publisher MAY subsequently
434 send a push-update containing a full snapshot of subscribed
435 data. Such a push-update might also be triggered by a
436 subscriber requesting an on-demand synchronization.";
437 }
438 /*
439 * --------------------------------------------------------------------
440 * datastore-changes not currently supported.
441 * Will replace datastore-change-string in a future release.
442 anydata datastore-changes {
443 description
444 "This contains datastore contents that has changed
445 since the previous update, per the terms of the
446 subscription. Changes are encoded analogous to
447 the syntax of a corresponding yang-patch operation,
448 i.e. a yang-patch operation applied to the YANG datastore
449 implied by the previous update to result in the current
450 state (and assuming yang-patch could also be applied to
451 operational data).";
452 }
453 *
454 * --------------------------------------------------------------------
455 */
456 leaf datastore-changes-string {
457 type string;
458 description
459 "This contains datastore contents that has changed
460 since the previous update, per the terms of the
461 subscription. Changes are encoded analogous to
462 the syntax of a corresponding yang-patch operation,
463 i.e. a yang-patch operation applied to the YANG datastore
464 implied by the previous update to result in the current
465 state (and assuming yang-patch could also be applied to
466 operational data).";
467 }
468 /*
469 * --------------------------------------------------------------------
470 */
471
472 }
473 augment "/notif-bis:subscription-started" {
474 description
475 "This augmentation adds push subscription parameters
476 to the notification that a subscription has
477 started and data updates are beginning to be sent.
478 This notification shall only be sent to receivers
479 of a subscription; it does not constitute a general-purpose
480 notification.";
481 uses update-policy;
482 uses subscription-qos;
483 }
484 augment "/notif-bis:subscription-started/notif-bis:filter-type" {
485 description
486 "This augmentation allows to include additional update filters
487 options to be included as part of the notification that a
488 subscription has started.";
489 case update-filter {
490 description
491 "Additional filter options for push subscription.";
492 uses update-filter;
493 }
494 }
495 augment "/notif-bis:subscription-modified" {
496 description
497 "This augmentation adds push subscription parameters
498 to the notification that a subscription has
499 been modified.
500 This notification shall only be sent to receivers
501 of a subscription; it does not constitute a general-purpose
502 notification.";
503 uses update-policy;
504 uses subscription-qos;
505 }
506 augment "/notif-bis:subscription-modified/notif-bis:filter-type" {
507 description
508 "This augmentation allows to include additional update
509 filters options to be included as part of the notification
510 that a subscription has been modified.";
511 case update-filter {
512 description
513 "Additional filter options for push subscription.";
514 uses update-filter;
515 }
516 }
517 augment "/notif-bis:filters/notif-bis:filter/"+
518 "notif-bis:filter-type" {
519 description
520 "This container adds additional update filter options
521 to the list of configurable filters
522 that can be applied to subscriptions. This facilitates
523 the reuse of complex filters once defined.";
524 case update-filter {
525 uses update-filter;
526 }
527 }
528 augment "/notif-bis:subscription-config/notif-bis:subscription" {
529 description
530 "Contains the list of subscriptions that are configured,
531 as opposed to established via RPC or other means.";
532 uses update-policy;
533 uses subscription-qos;
534 }
535 augment "/notif-bis:subscription-config/notif-bis:subscription/"+
536 "notif-bis:filter-type" {
537 description
538 "Add push filters to selection of filter types.";
539 case update-filter {
540 uses update-filter;
541 }
542 }
543 augment "/notif-bis:subscriptions/notif-bis:subscription" {
544 description
545 "Contains the list of currently active subscriptions,
546 i.e. subscriptions that are currently in effect,
547 used for subscription management and monitoring purposes.
548 This includes subscriptions that have been setup via RPC
549 primitives, e.g. establish-subscription, delete-subscription,
550 and modify-subscription, as well as subscriptions that
551 have been established via configuration.";
552 uses update-policy;
553 uses subscription-qos;
554 }
555 augment "/notif-bis:subscriptions/notif-bis:subscription/"+
556 "notif-bis:filter-type" {
557 description
558 "Add push filters to selection of filter types.";
559 case update-filter {
560 description
561 "Additional filter options for push subscription.";
562 uses update-filter;
563 }
564 }
565 }