forked from CESNET/netopeer2
-
Notifications
You must be signed in to change notification settings - Fork 0
1350 lines (1256 loc) · 45.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
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-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:[email protected]>
Author: Alexander Clemm
<mailto:[email protected]>
Author: Eric Voit
<mailto:[email protected]>
Author: Alberto Gonzalez Prieto
<mailto:[email protected]>
Author: Einar Nilsen-Nygaard
<mailto:[email protected]>
Author: Ambika Prasad Tripathy
<mailto:[email protected]>";
description
"This module defines a YANG data model for subscribing to event
records and receiving matching content in notification messages.
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.
Copyright (c) 2019 IETF Trust and the persons identified as
authors of the code. All rights reserved.
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).
This version of this YANG module is part of RFC 8639; see the
RFC itself for full legal notices.";
revision 2019-09-09 {
description
"Initial version.";
reference
"RFC 8639: A YANG Data Model for Subscriptions to
Event Notifications";
}
/*
* FEATURES
*/
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 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 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 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 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)";
}
/*
* 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.";
}
/*
* 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 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 subscription-suspended-reason {
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 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 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 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.";
}
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 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 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.";
}
/* 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 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-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 */
identity transport {
description
"An identity that represents the underlying mechanism for
passing notification messages.";
}
/*
* TYPEDEFs
*/
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-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 transport {
type identityref {
base transport;
}
description
"Specifies the transport used to send notification messages
to a receiver.";
}
/*
* 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.
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.
The XPath expression is evaluated on the representation of
individual, delineated event records as contained in
the event stream.
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
notification message sent to the receivers.
The expression is evaluated in the following XPath
context:
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.
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.
o The set of variable bindings is empty.
o The function library is comprised of the core
function library and the XPath functions defined in
Section 10 in RFC 7950.
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.";
}
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";
}
}
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.";
}
}
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;
}
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.";
}
}
/*
* 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.";
}
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.";
}
}
}
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
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.
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.
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.";
}
}
}
/*
* 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 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.";
}
}
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-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.";
}
}
}
}
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.";
}